Jump to content

Timers


Gabrielle

Recommended Posts

This is the first time I am moving towards advancement modding, using timers. One, I do not know anything about them really. Two I know this is done through scripting.

 

Ok on to the situation. Little evil party talks to <CHARNAME>, global for dialogue is set, party attacks pc. Little evil party is defeated. Some time later, lets say two days, big bad evil party appears to <CHARNAME> and is none too happy about their brethern being killed. How do I make Big Bad Evil Boss and gang appear in two days to meet <CHARNAME> in what ever area he/she is at, at night time?

Link to comment

Hardest part is identifying a script that will run constantly. If this is part of an NPC mod, it can go in that NPC's script, but if it's a quest mod, I guess you'd have to add it to baldur.bcs, although that's far from ideal. I guess you'd be OK if you EXTEND_BOTTOMed it (and tested thoroghly).

 

Depends how little evil party is defeated. If the idea is to kill them, you could do this

 

IF

Global("Evil","GLOBAL",1) //little evil dialogue happened

Dead("LittleEvilDV1")

Dead("LittleEvilDV2")

Dead("LittleEvilDV3")

//etc.

THEN

RESPONSE #100

SetGlobal("Evil","GLOBAL",2)

SetGlobalTimer("EvilTime","GLOBAL",TWO_DAYS)

END

 

IF

GlobalTimerExpired("EvilTime","GLOBAL")

Global("Evil","GLOBAL",2)

TimeOfDay(NIGHT)

THEN

RESPONSE #100

SetGlobal("Evil","GLOBAL",3)

CreateCreatureObjectOffset("BEcre1",Player1,[100.100]) //BEcre1 is big evil creature 1 cre code, the ##s are the x,y offset from player 1 in pixels

CreateCreatureObjectOffset("BEcre2",Player1,[150.75])

CreateCreatureObjectOffset("BEcre2",Player1,[150.125])

CreateCreatureObjectOffset("BEcre2",Player1,[200.50])

CreateCreatureObjectOffset("BEcre2",Player1,[200.100])

CreateCreatureObjectOffset("BEcre2",Player1,[200.150])

//that mess just created 1 ringleader and 5 enforcers in a pyramid formation down and a little to the right of the pc

END

Link to comment
Guest jastey_*
Hardest part is identifying a script that will run constantly.
For BGII that's easy: baldur.bcs is the "overall" script that runs in every area (for SoA, "baldur25.bcs" for ToB). The creatures could be spawn in relation to the PC (coordinates [-1.-1] I think), or with something like "CreateCreatureOffScreen(S:ResRef*,I:Face*)".

 

-jastey

Link to comment

I've had mixed results with Jastey's CreateCreatureOffScreen(). I had people missing the spawned creatures entirely and then wondering why Gavin's quests didn't start. So I moved it to spawning the creatures a bit closer to the PC.

Link to comment

"CreateCreatureOffScreen()" is used for Anomen's quest (messenger) and for Garren Windspear. I have the impression it is bound to fail if the creature get's created in an area it can't move to the PC (locked door in between etc.)

Link to comment

Yep, and sometimes you hear the scrambling, as though someone is moving, but they can't find you, usually because they don't see you. Or there's indeed a physical barrier. In Amkethran it was particularly nasty, because of that corridor at the beginning of the area.

Link to comment

Similar problems with CreateCreature() and MoveToObject() combinations when you are not in a cutscene... Dynaheir's quest had some playtests where Drizzt showed up after his timer, but the party was on the edge of the map. The MoveToObjectNoInterrupt() MTO(), etc. worked, but the party moved in different directions, finally leaving the map - stranding an unseen Drizzt in a random part of the map.

 

Safest to either use cutscenes, or code like the above, where it is hard for the party to miss the appointment :)

Link to comment

At normal resolutions, 50 pixels is something like 3/4".

 

 

Yeah, it's a bit jarring having something pop into existence *inside* your fog of war, but it's a lot less annoying than trying to find that darned quest spawn, especially when the party is hopping through maps pretty fast and the spawned creature could be *anywhere.*

Link to comment

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...