Aller au contenu

Photo

Mobile trigger?


  • Veuillez vous connecter pour répondre
4 réponses à ce sujet

#1
Apolyon6k

Apolyon6k
  • Members
  • 175 messages
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.

#2
Proleric

Proleric
  • Members
  • 2 361 messages
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
Apolyon6k

Apolyon6k
  • Members
  • 175 messages
i'll have to research that, thanks for the tip.

#4
Sunjammer

Sunjammer
  • Members
  • 926 messages

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 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.

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
Apolyon6k

Apolyon6k
  • Members
  • 175 messages
Thanks, Sunjammer.

You are a god ;)

I'll study your notes and give you credit on my mod.