The first hack is that requested:
is it within ToBEX's ability to add a new scripting trigger? if so, it'd be amazing to be able to check a LOCAL on another creature.
Global(S:Name,O:Object,I:Value)
.. After actually thinking about this a bit more, TriggerOverride(O:Object*) would be better if feasible; it evaluates to True (taking up an extra slot in OR()) and makes the next trigger be evaluated on the given target:
My implementation is not quite the same.
-----1000 Expanded Triggers [M]
Enables the use of new triggers
Descriptions
0x4100 NextTriggerObject(O:Object*)
Defines the object that the next trigger will be evaluated in reference to
The trigger itself does not evaluate and does not count as a trigger in an OR() block
If the object cannot be found, the next trigger will evaluate to false
Options:
-0: disabled
-1: enabled
Triggers that do not get a separate switch statement typically evaluate to false, therefore it would not make sense to make the trigger evaluate to true as requested. So I thought it better to not evaluate the trigger at all. It is possible to make the trigger not count as one OR statement, but that will confuse the formatting in modder tools.
Let's have some examples:
IF NextTriggerObject("Imoen2") Global("IWasKickedOut","LOCALS",0) ActionListEmpty() THEN ...This trigger block will check the LOCALSIWasKickedOut for "Imoen2" and check whether the active creature containing this script has an empty action list.
IF NextTriggerObject(NearestEnemyOf(Myself)) HasSpell(WIZARD_MAGIC_MISSILE) THEN ...This trigger block will check whether the nearest enemy to the active creature containing this script has the Magic Missile spell.
IF NextTriggerObject(Myself) Range(NearestEnemyOf(Myself),6) THEN ...This trigger block has redundancy. First, the active creature is already Myself so you don't need a NextTriggerObject(). Second, Range() already allows specification of an object, so NextTriggerObject() isn't required. However, you can use NextTriggerObject() and Range() to with a different reference object, e.g.
IF NextTriggerObject(NearestEnemyOf(Myself)) Range(NearestMyGroupOfType,6) THEN ...attack the enemy within 6 of the nearest enemy...
NextTriggerObject() does not cumulate.
IF NextTriggerObject(NearestEnemyOf(Myself) NextTriggerObject(NearestMyGroupOfType) HPLT(Myself,50) THEN ...The reference is my nearest friend of the active creature, NOT the enemy's nearest friend.
Finally,
IF NextTriggerObject(NearestEnemyOf(Myself) THEN ...The default empty trigger block evaluates to FALSE. This trigger block will evaluate to FALSE because NextTriggerObject() does not evaluate.
What needs to be tested is whether such trigger will cause stutter in the active creature beyond that which is normally expected for a normal script. Will upload a test soon.
Edited by Ascension64, 18 February 2011 - 08:03 PM.