NPC triggering

Topics regarding Scripting with Reality Factory
Post Reply
User avatar
LtForce
Posts: 437
Joined: Wed May 03, 2006 11:15 am
Location: Vilnius, Lithuania

NPC triggering

Post by LtForce »

How do I make pawn to trigger something? here's how I want it. When pawn dies moving platform starts moving.
Lithuanians for Georgia!
User avatar
bernie
RF Moderator
Posts: 1249
Joined: Tue Nov 15, 2005 10:07 am
Location: Ireland

Post by bernie »

Set up a trigger to start your platform No collide and in pawn script add a LowLevel command ActivateTrigger("your trigger name");
User avatar
QuestOfDreams
Site Admin
Posts: 1520
Joined: Sun Jul 03, 2005 11:12 pm
Location: Austria
Contact:

Post 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.
User avatar
LtForce
Posts: 437
Joined: Wed May 03, 2006 11:15 am
Location: Vilnius, Lithuania

Post 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
Lithuanians for Georgia!
User avatar
Juutis
Posts: 1511
Joined: Thu Jan 12, 2006 12:46 pm
Location: Finland

Post 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);
} ]
Pain is only psychological.
User avatar
bernie
RF Moderator
Posts: 1249
Joined: Tue Nov 15, 2005 10:07 am
Location: Ireland

Post 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);
}]

}
User avatar
LtForce
Posts: 437
Joined: Wed May 03, 2006 11:15 am
Location: Vilnius, Lithuania

Post by LtForce »

I finally understood that thing about not mixing high and low level commands.
Lithuanians for Georgia!
Post Reply