Jump to content

Does the IE script engine execute like this:


i30817

Recommended Posts

http://www.shsforums...post__p__528002

 

I'm trying to use a "trick" to see if there is only one selected party npc, due to some costly script.

 

The trick wastes a AI script execution to count the number of selected party npcs by increasing a global and guarding against double increases with a local and a hotkey (hotkeys are only delivered if the party member is selected). There is no continue in this block, so it stops here.

 

So the next time the script executes (and passes over the increase because of the local guard) it will have the global set to 1 if only one npc is selected.

 

But this will only work if the execution of the engine is as described in the post. Assuming the party is filled:

from player1 to player6 (or some other order), where there are no repetitions,

 

So no player1, player2, player1, player3. for instance.

 

Do you know if it behaves like i think it does (I think this since interleaving would require threads or continuations)?

Link to comment

gemrb could easily expose something akin SetSelection - SelectionLT, SelectionEQ, SelectionGT triggers.

 

SelectedCharacter Object is already there.

Maybe this would work in GemRB:

 

if

Exist(SelectedCharacter)

!Exist(SecondNearest(SelectedCharacter))

Link to comment

Oh, Ascension64 is already considering something like that at my urging:

http://www.shsforums...post__p__528014

NumInPartySelected trigger

 

In my special case, i don't really need to know THE selected character, since Hotkey are only sent to selected chars; and there is one char selected, and there was a hotkey that initiated this process -> ergo, i am the only selected char.

 

I was just wondering if my workaround rationale is sound as a workaround before Ascension64 (maybe) implements the cleaner solution.

 

No offense, but i'm not in a hurry to make my mod Gemrb specific. Though if both projects agree on a function it would be great.

Link to comment

Archived

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

×
×
  • Create New...