Noobie Question's

Topics regarding Scripting with Reality Factory
Post Reply
User avatar
creekmonkey
Posts: 116
Joined: Tue Oct 23, 2007 2:55 pm

Noobie Question's

Post by creekmonkey »

As I am very new to RF I am in need of help. I want to make a trigger to open a door when a pawn Dies. I have searched the forum and read Dan Valeo's book but am still confused. I am able to make a trigger open the door when the trigger is touched. But I want to trigger the door when a pawn dies. I have read the post on the subject and attempted to put in the ACTIVATETRIGGER("trig1") cammand in the DEATH routine But I keep getting the error "ACTIVATETRIGGER" not found. Do I need to define the trigger elsewhere in the script?
User avatar
Juutis
Posts: 1511
Joined: Thu Jan 12, 2006 12:46 pm
Location: Finland

Post by Juutis »

The command is called ActivateTrigger(), not ACTIVATETRIGGER(). There's a difference between a normal letter and a capital letter. :wink:
Pain is only psychological.
User avatar
creekmonkey
Posts: 116
Joined: Tue Oct 23, 2007 2:55 pm

Post by creekmonkey »

I have the correct spelling in the script itself, just caps in the post.
User avatar
federico
RF Dev Team
Posts: 443
Joined: Tue Jul 05, 2005 3:14 pm
Contact:

Post by federico »

You are probably using the right command in the wrong level. RF script has two levels: High-level and Low-level. The latter is quite similar to C and execute the commands as frame loop, the former execute the list of commands as a task manager. The command names usually differ in the two levels. So I don't think ActivateTrigger exists in lowlevel, try SetEventState(your_trigger_name, true); if you are in lowlevel.
Are you in lowlevel? that's the question: your script starts highlevel and executes the orders before the pawn death. So before the last order, somewhere before, there should be a LowLevel(""); command to switch to lowlevel, otherwise you're still in highlevel.
User avatar
bernie
RF Moderator
Posts: 1249
Joined: Tue Nov 15, 2005 10:07 am
Location: Ireland

Post by bernie »

ActivateTrigger is a LOW LEVEL command and does not exist in high level.

In the death routine replace the command
Remove(true);
with

LowLevel("operatetrig");

then add a new order

operatetrig[()
{
ActivateTrigger("trig1");
HighLevel("Death_2");
}]

then add another order

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

That should do the job for you
Last edited by bernie on Tue Oct 30, 2007 10:32 am, edited 1 time in total.
User avatar
steven8
RF Moderator
Posts: 1489
Joined: Wed Aug 24, 2005 9:08 am
Location: Barberton, OH

Post by steven8 »

Yargh. I've asked this more than once of people, how do we know high level fom low level. I'm sorry, but federico's explanation doesn't really get it for me. Would someone please post a colored-up script showing low and high and denoting the point at which we can tell we have gone from high to low?

Thanks.

*whew* - I just had to get that out. Sorry.
Steve Dilworth - Resisting change since 1965!
User avatar
bernie
RF Moderator
Posts: 1249
Joined: Tue Nov 15, 2005 10:07 am
Location: Ireland

Post by bernie »

Steven. I try to make low level orders start with small case ie blahblah[() and high level orders start with upper case ie Blahblah[() is sort of helps a bit. If thatss what you mean.
User avatar
steven8
RF Moderator
Posts: 1489
Joined: Wed Aug 24, 2005 9:08 am
Location: Barberton, OH

Post by steven8 »

That's cool, but how do I know, if I'm fixing to use a command, whenther it's a high or low level. Say, if I have no example at hand?
Steve Dilworth - Resisting change since 1965!
User avatar
bernie
RF Moderator
Posts: 1249
Joined: Tue Nov 15, 2005 10:07 am
Location: Ireland

Post by bernie »

Check it up in the doc's. A lot of commands are both high and low level these days anyway. All the commands are listed in the doc's under pawn scripting.
User avatar
steven8
RF Moderator
Posts: 1489
Joined: Wed Aug 24, 2005 9:08 am
Location: Barberton, OH

Post by steven8 »

bernie wrote:Check it up in the doc's. A lot of commands are both high and low level these days anyway. All the commands are listed in the doc's under pawn scripting.
I just downloaded Dan's book as well. It's time I RTFM. . .I'd say. :roll:

Thanks bernie.
Steve Dilworth - Resisting change since 1965!
User avatar
federico
RF Dev Team
Posts: 443
Joined: Tue Jul 05, 2005 3:14 pm
Contact:

Post by federico »

I agree with bernie about the use of capital letters while writing an highlevel order. Sorry about the wrong info I was sure that activatetrigger was only highlevel. :oops:
Anyway I would add that the use of SetEventState gives you more control on states and triggering...
User avatar
creekmonkey
Posts: 116
Joined: Tue Oct 23, 2007 2:55 pm

Post by creekmonkey »

Thanks guys
Using the LowLevel for the Trigger and HighLevel to remove the player worked for me.
Post Reply