Page 1 of 1

NPC triggering

Posted: Sat Sep 15, 2007 3:23 pm
by LtForce
How do I make pawn to trigger something? here's how I want it. When pawn dies moving platform starts moving.

Posted: Sat Sep 15, 2007 3:43 pm
by bernie
Set up a trigger to start your platform No collide and in pawn script add a LowLevel command ActivateTrigger("your trigger name");

Posted: Sat Sep 15, 2007 3:46 pm
by QuestOfDreams
Or just use the following command
SetEventState(char *Trigger, bool State );

Set a trigger called Trigger to the true/false state of State. These triggers can be checked by other entities or by Pawns by using the Trigger name as the name of the desired trigger. If the state of the trigger has never been set then it will be off to other entities.

Posted: Sat Sep 15, 2007 5:57 pm
by LtForce
QOD's post kinda confused me so I tried Bernie's method, but I don't understand why doesn't it work. Here's the script:

Code: Select all

{
Spawn[()
{
Console(true);
AttributeOrder("enemy_health",20,"Die");
SetFOV(360);
HostilePlayer(true);
HostileSame(false);
HostileDifferent(false);
SetGroup("Enemy");
}]
Die[()
{
Remove(true);
ActivateTrigger("try");
}]
}
Sorry is this is a really dumb question. I started learning RF scripting just now, because I didn't need it earlier

Posted: Sat Sep 15, 2007 6:05 pm
by Juutis
You are removing the pawn before it activates the trigger. The last order should be:

Code: Select all

Die[ ()
{
ActivateTrigger("try");
Remove(true);
} ]

Posted: Sat Sep 15, 2007 6:40 pm
by bernie
ALSO: ActivateTrigger is a LowLevel command You can't mix HighLevel and LowLevel commands.
You need something like

{
Spawn[()
{
Console(true);
AttributeOrder("enemy_health",20,"Die");
SetFOV(360);
HostilePlayer(true);
HostileSame(false);
HostileDifferent(false);
SetGroup("Enemy");
}]

Die[()
{
LowLevel("trig");
}]

trig[()
{
ActivateTrigger("try");
HighLevel("Die1");
}]

Die1[()
{
Remove(true);
}]

}

Posted: Sun Sep 16, 2007 6:16 am
by LtForce
I finally understood that thing about not mixing high and low level commands.