Is it possible to create a mobile trigger?
By "mobile trigger" a mean a fixed area around a character regardless of his position.
If the player leaves that trigger a script fires that kills the player. The script is no problem but triggers are normally set in areas and not for creatures.
Mobile trigger?
Débuté par
Apolyon6k
, déc. 04 2010 06:03
#1
Posté 04 décembre 2010 - 06:03
#2
Posté 05 décembre 2010 - 09:21
You could do that with a pseudo-heartbeat event that checks the distance between the character and the player.
Modifié par Proleric1, 05 décembre 2010 - 09:22 .
#3
Posté 05 décembre 2010 - 04:00
i'll have to research that, thanks for the tip.
#4
Posté 06 décembre 2010 - 12:55
An Area of Effect (AOE) applied to a creature is the correct way to address this issue. An AOE acts very much like a static trigger except that they are created at runtime and can be applied to moving objects.Apolyon6k wrote...
Is it possible to create a mobile trigger?
By "mobile trigger" a mean a fixed area around a character regardless of his position.
If the player leaves that trigger a script fires that kills the player. The script is no problem but triggers are normally set in areas and not for creatures.
An AOE has the same ENTER and EXIT event types as a trigger however there is an important difference: the event creator (returned by GetEventCreator) is not the object that triggered the event but rather the object that created the AOE effect (the oCreator parameter in ApplyEffectOnObject and Engine_ApplyEffectOnObject). To get the object that triggered the event you must use GetEventTarget.
When you create an AOE you specify the effect's id (which corresponds to a row in the AOE 2DA file which in turn determines its shape and size); the script it should use to handle its events; and, if you like, a visual effect (VFX) to be displayed.
I've thrown together some notes which you can download from my website. They are a little rough just now so if you have (or anyone else has) any questions let me know. Once the Friendly Toolset Initiative has worked its magic I'll expand them into a proper tutorial for the new toolset wiki.
Modifié par Sunjammer, 06 décembre 2010 - 01:10 .
#5
Posté 06 décembre 2010 - 03:03
Thanks, Sunjammer.
You are a god
I'll study your notes and give you credit on my mod.
You are a god
I'll study your notes and give you credit on my mod.





Retour en haut






