Jump to content

Timers


Sillara of the Tamari

Recommended Posts

And I would use MoveGlobals instead of EscapeAreaMove, otherwise LOCALS may not work. EscapeArea or EscapeAreaMove means totally destroy your .CRE object and re-create its copy if the lattest is choosen. And if you destroy your .CRE you may forget about LOCALS.

I have problems to believe that this is the way "EscapeAreaMove" works.

 

Looking at Anomen's P.DLG it's obvious that the the LOCALS are not lost after "EscapeAreaMove". After kickout, there comes the "do" action:

 

DO ~SetGlobal("KickedOut","LOCALS",1)
EscapeAreaMove("AR0406",1522,1662,0)
~ EXIT

 

The local variable "KickedOut" is set to "0" again once Anomen is taken back into the group. So by "EscapeAreaMove" the local variables can't be lost to the character. Does anyone know more about this?

Link to comment

It probably works that way for party-joinable characters because they're included in the GAM file, so the CRE doesn't get deleted, their location just points to a different area. Sort of like MoveBetweenAreas, only they take an exit rather than disappearing into thin air.

Link to comment

GAM and ARE files deal with CREs similarly, but GAM files have a global scope and ARE files a local scope.

 

GAM files have NPC headers. These headers contain info like currently equipped weapon, quick items, number of kills, time with party, current area, current location within that area, etc. When a new game is created, all referenced CREs are loaded and attached to their respective NPC headers, where they remain for the rest of the game.

 

If a new character (added by a mod) joins the party, his/her CRE is loaded into a newly created NPC header in the GAM file. (This won't work in BG1, so you have to add new NPCs to the GAM file with WeiDU, for mods, or NI, if you aren't going to distribute.) The default GAM file contains pre-created NPC structures for every party-joinable character in the unmodded game.

 

ARE files have an Actor header. This contains the current location and orientation of the actor within the area, as well as a presence variable. When you first enter an area, all actor CREs get loaded and attached to their respective Actor structures within the ARE file. If a new creature is created via script, spell or spawn point, new Actor headers are created and the CREs are attached accordingly.

 

So EscapeAreaMove won't hurt variables in a CRE contained in a GAM file because the CRE is permanent for the remainder of that game. The CRE is global in scope and can 'move' from area to area simply by changing the area and location variables in the NPC header. The CRE itself stays in the GAM file.

 

For ARE files this would be different, as the CRE would have to be deleted from the current ARE and added to the target ARE. Here I haven't tested to see if locals (and any other effects) are preserved by EscapeAreaMove. This would be easy to test though. Create a creature, set a LOCALS variable on it (value other than zero), make it move to another area with EscapeAreaMove, then check that LOCALS variable to see if it's still set. If you get a zero, the effect was removed (LOCALS are stored in a CRE via an effect).

 

This isn't complete info and doesn't cover every option, but it should give you a basic idea of how the mechanics work. To answer your question directly: joinable mod NPCs are added permanently to the GAM file, so their variables, effects, spells and equipment will be preserved as they 'move' from area to area.

Link to comment
It probably works that way for party-joinable characters because they're included in the GAM file

 

Exactly. I f you don't add your NPCs to BALDUR.GAM than his LOCALS and unremovable items (!) are stored only untill he exists in your group or in a specific area. When Kachiko had been stolen I was ought to use MoveGlobals (instead of EscapeArea or EscapeAreaMove or even MoveBetweenAreas) to transfer her to another unusable area in BG2, and when she had been resurrected later I used again MoveGlobals through the cutscene to bring her back with all her LOCALS and unremovable items.

Link to comment

I think locals would work, the only problem is that the movement is before setting the global.

Some actions like casting/moving seem to clear the execution queue.

 

Btw, it don't know much about this, there would be good if IESDP contains subtle information like this. For example: which actions clear the queue, how see/lastseenby works in different engines (if there is a difference), etc.

Link to comment

Archived

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

×
×
  • Create New...