Putting the 'role' back in role-playing games since 2002.
Donate to Codex
Good Old Games
  • Welcome to rpgcodex.net, a site dedicated to discussing computer based role-playing games in a free and open fashion. We're less strict than other forums, but please refer to the rules.

    "This message is awaiting moderator approval": All new users must pass through our moderation queue before they will be able to post normally. Until your account has "passed" your posts will only be visible to yourself (and moderators) until they are approved. Give us a week to get around to approving / deleting / ignoring your mundane opinion on crap before hassling us about it. Once you have passed the moderation period (think of it as a test), you will be able to post normally, just like all the other retards.

Divinity Editor thread

SniperHF

Arcane
Joined
Aug 22, 2014
Messages
1,110
did they actually release the official (import?) export plugin for 3dsmax, which they promised in a patch months ago and "forgot" to include?

No.
There was a little bit of movement from modders on this though awhile back, dunno if you caught that.
http://larian.com/forums/ubbthreads.php?ubb=showflat&Number=564303&an=

btw did i miss some drama or 'sup?

Drama would require interested and or involved parties :lol:. So I'm pretty sure it was the latter.

Reading this thread again reminds me of this post too:
where one can select through dialogue how much hours to wait and an according change of atmosphere in 4-5 steps (night to morning, morning to midday, midday to afternoon and afternoon to night), plus a global integer to get the time/count of day(s), would be a more pleasing day/night simulation.

I did a little more work in this area and found that this is already in the game script to some extent Larian just doesn't use it for much other than vendor refreshing.

The tl;dw version is check the file AAA_Firstgoal. I used it to make an hour by hour day/night cycle and it counts days.



I mentioned before that one of the problems with controlling time would be having to teleport everyone around and it would look weird. I've been playing around with doing some AoD style scene transitions for certain quest sequences. The same thing could be used for controlling time. Going that far with a day/night cycle is definitely farther than I wanted to go due to the work involved but maybe something I mess with after the content is done.

Right now I've got 13 quests done, 7 of which impact the results of the main story. Most of them have multiple results/solutions/outcomes.

3 and a half more to go or so plus the end game dungeon. Then some minor results cleanup like this NPC or that NPC Is alive, they go where after the quest, etc.
 

Semper

Cipher
Joined
Jan 12, 2012
Messages
747
MCA Project: Eternity
There was a little bit of movement from modders on this though awhile back, dunno if you caught that.

yeah, i noticed that community tool. and while it's a huge step in the right direction and will undoubtedly open up lots of possibilities, it's still limited to already available skeletons. afaik you can't create custom creatures from scratch, not that there's a pool of modders there with the needed skills to achieve that goal. but it also kills conversion projects. while nwn2 suffered from the same problem a long time, obsidian released their plugin (only to later remove it due to copyright claims by radtools) and a new creature popped up every now and then over the years.

@day/night cycles: gratz, this looks really well! if i ever go back to modding d.os i at least know whom i have to bump to ask pestering questions :D
 

SniperHF

Arcane
Joined
Aug 22, 2014
Messages
1,110
Update: My mod is now playable from beginning to end.

There's some minor crap I need to tie up before having a possible first version to release:
~10 Quest Journal Entries
Name my NPCs and edit text entries referencing placeholders.
3-4 more flavor dialogs.
Assign stats to the last couple combats.


After that I have to decide on releasing the first version without NPC scheduling and adding it in later, or adding it first and then releasing. I wanted to release it feature complete but now I'm thinking just put it out, since the EE is probably gonna beat me by a few weeks anyway.
 

Zeriel

Arcane
Joined
Jun 17, 2012
Messages
13,458
Definitely release. I'm curious to see what can actually be done with the editor once someone understands its quirks.
 

JasonNH

Augur
Joined
Jun 10, 2009
Messages
277
Update: My mod is now playable from beginning to end.

After that I have to decide on releasing the first version without NPC scheduling and adding it in later, or adding it first and then releasing. I wanted to release it feature complete but now I'm thinking just put it out, since the EE is probably gonna beat me by a few weeks anyway.

Congrats! How much work do you expect it to be to add in the NPC schedules? How impactful will it be to the way that the quests are solved?

If you need any other testing done, give me a shout.
 

SniperHF

Arcane
Joined
Aug 22, 2014
Messages
1,110
How impactful will it be to the way that the quests are solved?

Not too much, fortunately or unfortunately depending on how you look at it. Doing them at all is more for learning how to do it rather than make the campaign overly based on it. That's sort of how the whole thing unfolded. Started just to learn a few things, bolted a few other things on, 11 months later....

There's a few quests that are a little janky as a result of this since I didn't know as much about things back in Feburary when I really got going. I might try and clean them up a little, but because the way I made them they might actually be easier to just blow up and start from scratch. Now that I have a system it's much easier to modify and fix things on my more recent content.

There are a few factors like you might not be able to start certain quests in the nighttime hours since that NPC is unavailable. One thing I did was truncate the night hours, since it drives me crazy when games keep a realistic night hours proportion to day time. I hate having playsessions where I'm walking around at night all the time.

Still not exactly sure what to do about vendors, right now I think I'm going to have a night shift of vendors that switch places with the regular ones.

Changing lighting on the fly is also a pain to deal with in the Divinity editor, probably for the exact reason of them dropping the cycle during development. It's just designed to be mostly static.

The other thing I'm not sure about yet is companions. I have one mostly fleshed out serious NPC. I know I need one more and that should be pretty easy to add as I have that outlined already. So the party will be 3 characters, 1 PC and 2 NPCs. If I go all the way up to 1 PC and 3 NPCs it might change the balance too much. It's a 1 player mod and story wise it has to stay that way.


Some other things I know will be kind of incomplete for the first version are:
Loot balance
Combat Balance has a first pass done but needs tuning.
Encounters are the same, they have a first pass but need tuning.
Certain environment details in a few areas that I intentionally kept barebones to get the content done.
Certain polish things like getting NPCs to look proper directions when they move around.

The biggest elephant in the room though is the Div:OS mantra of being able to kill anyone. Currently you can't really do that in my campaign. I have a few ideas on how to make that possible and I did have them in mind throughout, so I don't think it will be very hard to do. But I might not implement that for the first version. The main issue is the big turn in the story, which leads you to the end game is all done through dialog. Skipping important dialogs in D:OS is usually done with notes or objects. Story wise, doing that just doesn't make a ton of sense in my campaign.
 

JasonNH

Augur
Joined
Jun 10, 2009
Messages
277
One thing I did was truncate the night hours, since it drives me crazy when games keep a realistic night hours proportion to day time. I hate having playsessions where I'm walking around at night all the time.

I agree, I've made the same decision.

Still not exactly sure what to do about vendors, right now I think I'm going to have a night shift of vendors that switch places with the regular ones.

That's not a bad idea.

Changing lighting on the fly is also a pain to deal with in the Divinity editor, probably for the exact reason of them dropping the cycle during development. It's just designed to be mostly static.

For reasons other than those we've mentioned already? Like the fact that the atmosphere triggers only fire on movement and are local to the camera of the player being controlled?

The biggest elephant in the room though is the Div:OS mantra of being able to kill anyone. Currently you can't really do that in my campaign.

I have no intentions of supporting that. While it's a commendable design goal making sure players aren't railroaded into one way of doing things, it's rather absurd in most contexts. I could have wished Larian would have spent less time on designing their game so you can kill everyone and put that effort into NPC schedules instead. ;)

Shoot me a PM when you get to a place where you need some QA, either here or as Windemere on the Larian forums.

Good luck and really looking forward to seeing what you've come up with.
 

SniperHF

Arcane
Joined
Aug 22, 2014
Messages
1,110
For reasons other than those we've mentioned already? Like the fact that the atmosphere triggers only fire on movement and are local to the camera of the player being controlled?

Yeah, basically anything to do with the Light Source Manager cannot be modified during the game by the scripting tools. They don't have the option to be made global. There's no calls I know of that can handle them via GUID.

There are some standard root templates which provide lighting, but there's far less options for customization with them.
 

JasonNH

Augur
Joined
Jun 10, 2009
Messages
277
If you're still interested in the editor, make sure you add your own experiences and subsequent "wish list" for the Divinity Editor over on the Larian forum thread asking for feedback.
 

Zeriel

Arcane
Joined
Jun 17, 2012
Messages
13,458
If you're still interested in the editor, make sure you add your own experiences and subsequent "wish list" for the Divinity Editor over on the Larian forum thread asking for feedback.

Did someone already shout "Make item/equipment/NPC editing part of the editor rather than in excel files"? I can respect ability/skill editing being obscure and hard to do, but stuff like what an NPC is wearing shouldn't be so obtuse.
 

pakoito

Arcane
Patron
Joined
Jun 7, 2012
Messages
3,092
Excel? Like...Excel? If so, there's a reason for that. They wanted designers to tweak things without installing/learning tools. It's more common in IT than you'd expect, as people for some arcane reason refuses to learn productivity tools.
 

Zeriel

Arcane
Joined
Jun 17, 2012
Messages
13,458
Excel? Like...Excel? If so, there's a reason for that. They wanted designers to tweak things without installing/learning tools. It's more common in IT than you'd expect, as people for some arcane reason refuses to learn productivity tools.

That's fine in theory, but in practice it's probably the most inefficient and backwards way of doing those particular things. It's like using an abacus to do higher order astronomy calculations.
 

Zeriel

Arcane
Joined
Jun 17, 2012
Messages
13,458
May you never work in a corporation.

I've worked in them. And I can say from personal experience that the janky back-ends dating from some guy's 80's UNIX code we used made more sense and were more efficient for what we were trying to do than the Larian editor for everything outside of terrain/area creation.
 

JasonNH

Augur
Joined
Jun 10, 2009
Messages
277
Did someone already shout "Make item/equipment/NPC editing part of the editor rather than in excel files"? I can respect ability/skill editing being obscure and hard to do, but stuff like what an NPC is wearing shouldn't be so obtuse.

Yes, it has been brought up and I also agreed with it.
 

SniperHF

Arcane
Joined
Aug 22, 2014
Messages
1,110
Did someone already shout "Make item/equipment/NPC editing part of the editor rather than in excel files"? I can respect ability/skill editing being obscure and hard to do, but stuff like what an NPC is wearing shouldn't be so obtuse.

I think the way to do this would be to create another editor menu which can create entries in those files. The Excel files aren't directly used, they generate TXT files. So having an editor plugin that can modify the txt files with entries probably wouldn't be too hard for them. The editor could give you a list of root templates, you pick the item level, it cross references that with the TXT file CLUB @ Lvl 3 = WPN_Cudgel_B.

You can already do this with Items placed in the world, but not on a character. Place a root template for that club, called WPN_Human_Normal_Mace_B. By default that's a WPN_KnobbedMace which is a LVL 3 Club, req strength 6. But if you want to change that all you need to do is open the sidebar and find the STATS drop menu, and pick say WPN_Cudgel. That would change it from a lvl 3 club to a lvl 2 club. So the editor can already read those TXT files and grab data from them. It just needs to be more robust so that it displays the fact that it's a lvl 2 club. Now you have to look up what a WPN_Cudgel is.

So I think it would be possible to keep their current format, but provide more of this information directly in the editor. And make it even possible to make entries in the Equipment.txt, which is the particular file in question here.

They'd have to include the requisite warnings though that if you did delve into and run a macro in the excel files, it would wipe your stuff. Maybe there's a way they can separate it, but probably not without changing the entire format. That I don't see happening.

I actually just spent about 2 hours monkeying around with the excel files for my mod. Still a novice at messing with them. This time I was able to combine several of the vendor inventories into just a few, since I don't have as many NPC vendors compared to the main campaign.
 

SniperHF

Arcane
Joined
Aug 22, 2014
Messages
1,110
Gonna do a playtest myself, then release something.

Couple outstanding questions I wouldn't mind some feedback on:

1. Do you prefer NPCs to be named, or is say just calling the Blacksmith, the Blacksmith, fine? I can go either way on this myself.

I already renamed the obviously placeholder names, but there's a few significant NPCs out there currently named after their function.


2. Companions - So my mod is currently set as a 1 PC + 2 companion mod. But currently one of the companions is possible to miss depending on your choices in the story. Do I need to add a third so you can have a full party in such an event? Maybe just get some generic merc types you can hire as a temp fix?



Also another modder released his mini-campaign today.
http://larian.com/forums/ubbthreads.php?ubb=showflat&Number=569847#Post569847

Haven't played it myself, but it looks to be pretty short so it wouldn't take long to check out. I don't think he's supporting all the D:OS systems though.
 

Ninjerk

Arcane
Joined
Jul 10, 2013
Messages
14,323
Just "Blacksmith" should do if you don't have any kind of significant character development (I'm thinking of what you see in theatre, e.g. "Fool" instead of Malvolio or w/e his name was in The Twelfth Night)
 

SniperHF

Arcane
Joined
Aug 22, 2014
Messages
1,110
So I'm plugging along, adding a nice baseline schedule for some NPCs. Even added a cool randomizer that varies the wakeup and sleep times so it looks natural. Everything works fine.

Till you leave the area....

Apparently local scripting is put on hold when you aren't near that particular NPC. So if you walk to town at say noon, you'll see a giant parade of NPCs walking to their spots.
:rage:


So I can either move all my script to the global engine (and rewrite it because it uses different syntax) or just scrap it.
 

SniperHF

Arcane
Joined
Aug 22, 2014
Messages
1,110
You know what to do
:0-13:

P. much.

I think I'm going to just global everything and see what happens. I don't have a ton of NPCs so it shouldn't nuke performance I don't think.
The good thing is global scripting is way easier than local char scripting so it will be faster to do.


I do have an idea on making a hybrid system that would work. Global the major moves, so the NPC get at least in the general area of where they are supposed to be. Then once they reach their destination that throws a characterflag which initiates their local behavior.

This is more complicated than either basic method but I think it would work. Gonna start with all global first and see what happens.
 

JasonNH

Augur
Joined
Jun 10, 2009
Messages
277
Yeah, I suspected as much. My plan was to investigate a synchronization script anytime you enter an area. Each NPC would have a kind of database as to where they should be at certain times of day and when you enter, a script would go down the list of all schedulable NPCs and move them to their designated spots and then start the scheduling AI. Not having done it, I'm not sure how feasible it is.
 

SniperHF

Arcane
Joined
Aug 22, 2014
Messages
1,110
Yeah, I suspected as much. My plan was to investigate a synchronization script anytime you enter an area. Each NPC would have a kind of database as to where they should be at certain times of day and when you enter, a script would go down the list of all schedulable NPCs and move them to their designated spots and then start the scheduling AI. Not having done it, I'm not sure how feasible it is.

That's basically what my plan C is. It is 100% feasible just more difficult than strictly global or strictly charscript.

The part you mentioned about entering an area though, that I'm not going to bother with. I'll just let them operate continuously.

I had already global/osiris scripted some of the scheduling because another thing I figured out (which led me to figuring out the local scripting issue) was that NPCs off in an instanced area also do not perform actions. So I ended up global scripting all my NPCs who sleep in instanced 2nd floors.

So to essentially activate local scripting once they arrive at their location, all I'd have to do is reference the last character event from Osiris and the DB they are in. Then using my state manager script flip on their behavior like this:

IF
CharacterEvent(_Char,"At12PMPlace")
AND
DB_CycleDinerInstance(CHARACTER_Fort_Diner_Townie1,ITEM_Fort_Diner_1stStair_UP,ITEM_DinerChair_1,ITEM_Bed_Diner_Up_001,ITEM_Fort_diner_2ndStairDown);
THEN
CharacterSetVarFixedString(_Char, "currentState", "State_12PM");

This is the script for my NPCs that hangout in the diner:

Code:
INIT:
//Diner Patron DBs
//DB layout (Character, Lower Stair,LowerChair,InstanceBed,InstanceStair)
DB_CycleDinerInstance(CHARACTER_Fort_Diner_Townie1,ITEM_Fort_Diner_1stStair_UP,ITEM_DinerChair_1,ITEM_Bed_Diner_Up_001,ITEM_Fort_diner_2ndStairDown);
DB_CycleDinerInstance(CHARACTER_Fort_Diner_Townie7,ITEM_Fort_Diner_1stStair_UP,ITEM_DinerChair_2,ITEM_Bed_Diner_Up_002,ITEM_Fort_diner_2ndStairDown);
DB_CycleDinerInstance(CHARACTER_Fort_Diner_Townie8,ITEM_Fort_Diner_1stStair_UP,ITEM_DinerChair_3,ITEM_Bed_Diner_Up_003,ITEM_Fort_diner_2ndStairDown);
DB_CycleDinerInstance(CHARACTER_Fort_Diner_Townie9,ITEM_Fort_Diner_1stStair_UP,ITEM_DinerChair_4,ITEM_Bed_Diner_Up_004,ITEM_Fort_diner_2ndStairDown);
DB_CycleDinerInstance(CHARACTER_Fort_Diner_Townie10,ITEM_Fort_Diner_1stStair_UP,ITEM_DinerChair_5,ITEM_Bed_Diner_Up_005,ITEM_Fort_diner_2ndStairDown);


//Workers sit at seperate table:
DB_LazyWorkerInstance(CHARACTER_Fort_Diner_Townie2,ITEM_Fort_Diner_1stStair_UP,ITEM_DinerChair_9,ITEM_Bed_Diner_Up_009,ITEM_Fort_diner_2ndStairDown);
DB_LazyWorkerInstance(CHARACTER_Fort_Diner_Townie3,ITEM_Fort_Diner_1stStair_UP,ITEM_DinerChair_13,ITEM_Bed_Diner_Up_000,ITEM_Fort_diner_2ndStairDown);
DB_LazyWorkerInstance(CHARACTER_Fort_Diner_Townie4,ITEM_Fort_Diner_1stStair_UP,ITEM_DinerChair_10,ITEM_Bed_Diner_Up_010,ITEM_Fort_diner_2ndStairDown);
DB_LazyWorkerInstance(CHARACTER_Fort_Diner_Townie5,ITEM_Fort_Diner_1stStair_UP,ITEM_DinerChair_11,ITEM_Bed_Diner_Up_011,ITEM_Fort_diner_2ndStairDown);
DB_LazyWorkerInstance(CHARACTER_Fort_Diner_Townie6,ITEM_Fort_Diner_1stStair_UP,ITEM_DinerChair_14,ITEM_Bed_Diner_Up_012,ITEM_Fort_diner_2ndStairDown);
DB_LazyWorkerInstance(CHARACTER_Fort_Diner_Townie11,ITEM_Fort_Diner_1stStair_UP,ITEM_DinerChair_15,ITEM_Bed_Diner_Up_013,ITEM_Fort_diner_2ndStairDown);


KB:
//Workers are slackers Schedule.
//Awake time.
IF
TimerFinished("TimeOfDay")
AND
Time(_,13,_)
AND
DB_LazyWorkerInstance((CHARACTER)_Char,(ITEM)_LowerStair,(ITEM)_LowerChair,(ITEM)_BedUpper,(ITEM)_StairUpper)
AND
CharacterGetVarInteger(_Char,"OffCycle",0)
THEN
CharacterMoveToItem(_Char,_StairUpper,0,"ReachedUpperStair");

IF
CharacterEvent(_Char,"ReachedUpperStair")
AND
DB_LazyWorkerInstance((CHARACTER)_Char,(ITEM)_LowerStair,(ITEM)_LowerChair,(ITEM)_BedUpper,(ITEM)_StairUpper)
THEN
//CharacterTeleportToTrigger(_Char,TRIGGER_Fort_Diner_1stStair_UP,"MorningSit");
CharacterUseItem(_Char,_StairUpper,"MorningSit");

IF
CharacterEvent(_Char,"MorningSit")
AND
DB_LazyWorkerInstance((CHARACTER)_Char,(ITEM)_LowerStair,(ITEM)_LowerChair,(ITEM)_BedUpper,(ITEM)_StairUpper)
THEN
CharacterUseItem(_Char,_LowerChair,"SittingDown");

/*
IF
CharacterEvent(_Char,"SittingDown")
AND
DB_CycleDinerInstance((CHARACTER)_Char,(ITEM)_LowerStair,(ITEM)_LowerChair,(ITEM)_BedUpper,(ITEM)_StairUpper)
THEN
CharacterSetVarFixedString(_Char, "currentState", "State_IdleAnimation"); */


//Sleep time.
IF
TimerFinished("TimeOfDay")
AND
Time(_,5,_)
AND
DB_LazyWorkerInstance((CHARACTER)_Char,(ITEM)_LowerStair,(ITEM)_LowerChair,(ITEM)_BedUpper,(ITEM)_StairUpper)
AND
CharacterGetVarInteger(_Char,"OffCycle",0)
THEN
//CharacterSetVarFixedString(_Char, "currentState", "");
CharacterMoveToItem(_Char,_LowerStair,0,"ReachedLowerStair");

IF
CharacterEvent(_Char,"ReachedLowerStair")
AND
DB_LazyWorkerInstance((CHARACTER)_Char,(ITEM)_LowerStair,(ITEM)_LowerChair,(ITEM)_BedUpper,(ITEM)_StairUpper)
THEN
//CharacterTeleportToTrigger(_Char,TRIGGER_Fort_Diner_1stStair_UP,"MorningSit");
CharacterUseItem(_Char,_LowerStair,"NightSleep");

IF
CharacterEvent(_Char,"NightSleep")
AND
DB_LazyWorkerInstance((CHARACTER)_Char,(ITEM)_LowerStair,(ITEM)_LowerChair,(ITEM)_BedUpper,(ITEM)_StairUpper)
THEN
CharacterUseItem(_Char,_BedUpper,"SleepingInBed");


//Diner Patrons
//Awake time.
IF
TimerFinished("TimeOfDay")
AND
Time(_,6,_)
AND
DB_CycleDinerInstance((CHARACTER)_Char,(ITEM)_LowerStair,(ITEM)_LowerChair,(ITEM)_BedUpper,(ITEM)_StairUpper)
AND
CharacterGetVarInteger(_Char,"OffCycle",0)
THEN
CharacterMoveToItem(_Char,_StairUpper,0,"ReachedUpperStair");

IF
CharacterEvent(_Char,"ReachedUpperStair")
AND
DB_CycleDinerInstance((CHARACTER)_Char,(ITEM)_LowerStair,(ITEM)_LowerChair,(ITEM)_BedUpper,(ITEM)_StairUpper)
THEN
//CharacterTeleportToTrigger(_Char,TRIGGER_Fort_Diner_1stStair_UP,"MorningSit");
CharacterUseItem(_Char,_StairUpper,"MorningSit");

IF
CharacterEvent(_Char,"MorningSit")
AND
DB_CycleDinerInstance((CHARACTER)_Char,(ITEM)_LowerStair,(ITEM)_LowerChair,(ITEM)_BedUpper,(ITEM)_StairUpper)
THEN
CharacterUseItem(_Char,_LowerChair,"SittingDown");

/*
IF
CharacterEvent(_Char,"SittingDown")
AND
DB_CycleDinerInstance((CHARACTER)_Char,(ITEM)_LowerStair,(ITEM)_LowerChair,(ITEM)_BedUpper,(ITEM)_StairUpper)
THEN
CharacterSetVarFixedString(_Char, "currentState", "State_IdleAnimation"); */


//Sleep time.
IF
TimerFinished("TimeOfDay")
AND
Time(_,21,_)
AND
DB_CycleDinerInstance((CHARACTER)_Char,(ITEM)_LowerStair,(ITEM)_LowerChair,(ITEM)_BedUpper,(ITEM)_StairUpper)
AND
CharacterGetVarInteger(_Char,"OffCycle",0)
THEN
//CharacterSetVarFixedString(_Char, "currentState", "");
CharacterMoveToItem(_Char,_LowerStair,0,"ReachedLowerStair");

IF
CharacterEvent(_Char,"ReachedLowerStair")
AND
DB_CycleDinerInstance((CHARACTER)_Char,(ITEM)_LowerStair,(ITEM)_LowerChair,(ITEM)_BedUpper,(ITEM)_StairUpper)
THEN
//CharacterTeleportToTrigger(_Char,TRIGGER_Fort_Diner_1stStair_UP,"MorningSit");
CharacterUseItem(_Char,_LowerStair,"NightSleep");

IF
CharacterEvent(_Char,"NightSleep")
AND
DB_CycleDinerInstance((CHARACTER)_Char,(ITEM)_LowerStair,(ITEM)_LowerChair,(ITEM)_BedUpper,(ITEM)_StairUpper)
THEN
CharacterUseItem(_Char,_BedUpper,"SleepingInBed");

One thing you might notice in there is I added the charvarinteger "OffCycle" as a check. Whenever one of my NPCs has OffCycle=1, they stop all their day/night functions. This is what I'm doing when quest behavior demands it.

I was originally going to remove them and add them back to the DB, but this is way easier.
 

JasonNH

Augur
Joined
Jun 10, 2009
Messages
277
The part you mentioned about entering an area though, that I'm not going to bother with. I'll just let them operate continuously.

Thanks for sharing. Do you have any interface for resting and quickly allowing for time to pass? That was one of the other reasons for wanting to develop a quick way to 'synchronize' everything to a specific time. Then again, I haven't solved how to do that in multiplayer anyway since it would require all players to rest and that kind of breaks the playstyle of the game.
 

SniperHF

Arcane
Joined
Aug 22, 2014
Messages
1,110
Thanks for sharing. Do you have any interface for resting and quickly allowing for time to pass? That was one of the other reasons for wanting to develop a quick way to 'synchronize' everything to a specific time. Then again, I haven't solved how to do that in multiplayer anyway since it would require all players to rest and that kind of breaks the playstyle of the game.

No, I'm not doing any time advancing.

I don't think it would be too difficult to do though just a lot of brute forcing via database. Defining where everyone is to be at every hour. The way I'm doing it, I only need to track where they are when they specifically move.

For controlled advancing basically I'd have two conditional statements.

Code:
1 based on my normal Time elapse:
IF
TimerFinished("TimeOfDay")
AND
Time(_,21,_)
THEN
SCHEDULE STUFF

Another based on player controlled time:  Say you use a stone to move forward in time
IF
CharacterItemEvent(_Player,ITEM_TIMESTONE,"TimeStone5HourRest")
AND
Time(_,16,_)
AND
_Player.isPlayer()
THEN
Time(_,21,_);  //this would be done more elegantly. 
TimerCancel("TimeOfDay")  //kill the timer so you don't get conflicting behavior from the first conditional.
DB_FadePlayer(_Player)  //I know from experience you want to do this when fading, trust me. 
FadeToBlack(_Player,5.0,0)  // 5 second fade to black.
TimerLaunch("TimeFadeTimer",5100)  //always make the timer a little longer than the fade. 

IF
TimerFinished("TimeFadeTimer")
AND
DB_FadePlayer(_Player)
AND
DB_LazyWorkerInstance((CHARACTER)_Char,(ITEM)_LowerStair,(ITEM)_LowerChair,(ITEM)_BedUpper,(TRIGGER)_DinerUpperFloor)  //21 is when these chars go to sleep
THEN
CharacterPurgeQueue(_Char);  //if you don't do this, and you teleport them to an instanced area they will probably instantly teleport back to finish what they were doing.
TimerLaunch("TimeOfDay",whatevertimeyouuseforanhour)
CharacterTeleportToTrigger(_Char,_DinerUpperFloor,"Sleeptime")
FadeToBlack(_Player,5.0,1)  //unfade the player from before. 

//this part you could local, just doing global for example.
IF
CharacterEvent(_Char,"SleepTime")
AND
DB_LazyWorkerInstance((CHARACTER)_Char,(ITEM)_LowerStair,(ITEM)_LowerChair,(ITEM)_BedUpper,(TRIGGER)_DinerUpperFloor)  //21 is when these chars go to sleep
THEN
CharacterUseItem(_Char,_BedUpper,"Sleeping")



MP, yeah that's trickier. I think you are right in that it would have to force all players into it.
 

SniperHF

Arcane
Joined
Aug 22, 2014
Messages
1,110
Since I still had a few more schedules to implement, I gave the hybrid local and global scheduling a go. Wasn't too bad since I already had a template for each.

I ran into a gamebreaking problem when they transition to an instanced area. If you have them "Use" a ladder or stairs which teleport the character this can sometimes throw an insane amount of those generic memory access errors causing an instacrash.

The trick around this is to guide them through it:

So instead of just
CharacterMovetoItem(_Char,ITEM_STAIR_UP,0,"GOTOSTAIRS");
CharacterUseItem(_Char,ITEM_STAIR_UP,"USEDSTAIRS");



You need to do these two.
CharacterMoveToItem(_Char,ITEM_STAIR_UP,0,"GOTOSTAIRS");

IF
CharacterEvent(_Char,"GOTOSTAIRS")
THEN
CharacterTeleportToTrigger(_Char,TRIGGER_UPSTAIRS_POINT,"CharIsUpStairs");


Then after that you can tell them to use their bed or whatever. You also need to have a trigger upstairs, since you can't teleport to items.


That will essentially perform the same function and stop the crashes. If you are scheduling for NPCs that don't need to switch to instanced areas, this is not a problem.
 

As an Amazon Associate, rpgcodex.net earns from qualifying purchases.
Back
Top Bottom