I need to trigger DestroyObject on a specific creature when it enters a trigger. I've managed to put together what I think is everything I need from various tutorials, but I'm a bit stumped about the part where I need to check if the event creator is my creature.
Here is the script in question. I'd like to know what to put as the if statement (the trigger should only fire if the creature with the tag "my_creature" enters the area.
#include "events_h"
void main()
{
event ev = GetCurrentEvent();
int nEventType = GetEventType(ev);
switch(nEventType)
{
case EVENT_TYPE_ENTER:
{
object oCreature = GetEventCreator(ev); // creature entering the object
object oCorimae = GetObjectByTag("my_creature",1);
{
if ?????What goes here?????
{
DestroyObject(oCreature, 0);
DestroyObject(OBJECT_SELF, 0);
}
}
break;
}
}
}





Retour en haut






