Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

FPSC Classic Scripts / Is it possible to trigger another trigger zone with a trigger zone?

Author
Message
PW Productions
15
Years of Service
User Offline
Joined: 13th Mar 2009
Location: sitting in a chair.
Posted: 2nd Jun 2010 04:58
Like the title says, I don't think it's possible due to the options given in a Zone's properties, but I was wondering if there was a way to script it. I want it so that a player steps into a zone which in turn triggers another zone (whether it's a story, trigger or sound zone). That's all I was wondering. Thanks in advance!

-PwP-

BlackFox
FPSC Master
16
Years of Service
User Offline
Joined: 5th May 2008
Location: Knight to Queens Bishop 3
Posted: 2nd Jun 2010 05:32 Edited at: 2nd Jun 2010 05:34
Unfortunately, no. You can trigger a Win Zone, but can't trigger a trigger Zone.

You can, however, spawn a trigger zone by the following method:

1. Place an entity that you would pick up
2. In the If Used field, put the name of the trigger zone
3. In the Trigger Zone Start script, use the activateifused.fpi

You can also add in the pickup script the activateifused=1. This will ensure that the trigger is activated.

We have done this many times in our RPG Mod demos and such. Works like a charm. Particularly if the player is passing through a doorway into a room and I want the trigger to appear after they enter the room.

- BlackFox

PW Productions
15
Years of Service
User Offline
Joined: 13th Mar 2009
Location: sitting in a chair.
Posted: 2nd Jun 2010 06:00
Quote: "3. In the Trigger Zone Start script, use the activateifused.fpi"


Well, I wanted to use this so that when my players start backtracking through the level, they trigger trigger zones in places they've already gone. But they can't step into those trigger zones because they are not triggered. And, what I wanted the trigger zones to do is use the plrinzoneactivateifused.fpi script to spawn enemies.

Sorry, that was a mouthfull. But at least you gave me an idea Thanks BlackFox


-PwP-

Marc Steene
FPSC Master
18
Years of Service
User Offline
Joined: 27th Mar 2006
Location: Bahrain
Posted: 2nd Jun 2010 15:43
You could also use variables to deactivate trigger zones (very easy with Project Blue but possible too with stock).


[b]FPSC MIGRATION: http://forum.thegamecreators.com/?m=forum_view&t=142497&b=21
PW Productions
15
Years of Service
User Offline
Joined: 13th Mar 2009
Location: sitting in a chair.
Posted: 2nd Jun 2010 17:00
Quote: "(very easy with Project Blue"


Good - I own PB.

So using variables to deactivate trigger zones in certain areas while in others, variables would activate them? Could you explain furthermore, please?

-PwP-

Marc Steene
FPSC Master
18
Years of Service
User Offline
Joined: 27th Mar 2006
Location: Bahrain
Posted: 2nd Jun 2010 17:42
Sure. Say you wanted a door to open when passing through a trigger zone, but on your second trip through the level when you're backtracking. First, you'd need to give your door-activating trigger zone the following script:

:state=0:dimvar=enabled,setvar=enabled 0,state=1
:state=1,plrwithinzone=1,varequal=enabled 1:activateifused=1,state=2

Now, you need to place a trigger zone at the end of the level or where you want it to be enabled from and give it this script:

:state=0:state=1
:state=1,plrwithinzone=1:setvar=enabled 1

Hope this makes sense.


[b]FPSC MIGRATION: http://forum.thegamecreators.com/?m=forum_view&t=142497&b=21
PW Productions
15
Years of Service
User Offline
Joined: 13th Mar 2009
Location: sitting in a chair.
Posted: 2nd Jun 2010 18:53
Yes, that does make sense. Thanks for ellaborating, I'm gonna need that

-PwP-


Conjured Entertainment
AGK Developer
19
Years of Service
User Offline
Joined: 12th Sep 2005
Location: Nirvana
Posted: 2nd Jun 2010 20:38 Edited at: 2nd Jun 2010 20:58
Quote: "Unfortunately, no. You can trigger a Win Zone, but can't trigger a trigger Zone"

Sure you can.

Quote: "You could also use variables to deactivate trigger zones (very easy with Project Blue but possible too with stock)."

Yup, you can do that too. (use variables)

But there is another way.

settargetname=uniquetriggername1 (have unique names for the trigger zones)

activatetarget=67 (or whatever number you want within bounds)

Then just used activated=67 for your condition and then take whatever action you need in the Trigger Zones AIMain. (trigger)

Anyway, that is how I do it with the stock engine for 'Night of the Living Dead ~ The Game'.

I have trigger zones triggering other trigger zones and then they can trigger the first one again. (of course taking other actions too, like spawning characters and playing videos)

Nothing better than using the same trigger multiple times, especially when utilizing the map with backtracking.
It comes in really handy for restricting access to certain areas or cutscenes until other areas have been explored first.

   Conjured Entertainment

 WARNING: Intense Madness
PW Productions
15
Years of Service
User Offline
Joined: 13th Mar 2009
Location: sitting in a chair.
Posted: 2nd Jun 2010 20:58
Well, I wanted to use it so that my player is going through the level and he finds a gun and a key. So he has to backtrack, and that's when mutants and good ol' stuff start poppin' out from everywhere. But I don't want them to pop out before he has a weapon.

Now, I'm not the best at scripting, so you'll have to treat me like I'm dumb here. What does it mean by 'activatetarget=67'? And why 67?

Thanks for sticking with me guys,

-PwP-

Conjured Entertainment
AGK Developer
19
Years of Service
User Offline
Joined: 12th Sep 2005
Location: Nirvana
Posted: 2nd Jun 2010 21:07 Edited at: 2nd Jun 2010 21:15
67 has no significance other than being unique.

I chose 67 at random because it was in range and not being used.

That could be any number within range, like 2, or 3, or 52, or 93.

You see each trigger can serve as multiple triggers using its activated state.

This example used activated state 67 to perform the check and trigger the effect, which may or may not included triggering another trigger.

For example, I may want to have a video play when a user comes in front of the door, but I don't want it to play until they have triggered a different zone in the map.
So, I add the activated=67 to my conditions (plrwithinzone=1) that I was using for the video.

Then (in the other trigger's script) I set the target name of the videos trigger and then activate it to 67 when the player enters its zone.

Now that the original trigger is in an activated state of 67, it will now play the video when the player gets there.
Had the player not triggered that other zone, then the video would not have played because it would still be in an activated state of 0.

So, as you can see, triggers can have a hundred different effects that are triggered independently.
Keep in mind too that any entity can use the settargetname=x and activetarget=x to trigger the zones. (character's destroy script, etc)

Quote: "So he has to backtrack, and that's when mutants and good ol' stuff start poppin' out from everywhere. But I don't want them to pop out before he has a weapon."

If you mean having triggerzones that spawn the characters, then this is simple.
The gun or keys pickup script could activate the trigger zones to a state that would enable them active.
Much like the example above, you would add the activated=x to the usual plrwithinzone=1.
As long as the activated state for the trigger remains any state other than the one you pick, then the spawning action would not take place.

   Conjured Entertainment

 WARNING: Intense Madness
PW Productions
15
Years of Service
User Offline
Joined: 13th Mar 2009
Location: sitting in a chair.
Posted: 2nd Jun 2010 21:14
Oh, I see. This is a little above my head, sorry.

Conjured Entertainment
AGK Developer
19
Years of Service
User Offline
Joined: 12th Sep 2005
Location: Nirvana
Posted: 2nd Jun 2010 21:23 Edited at: 2nd Jun 2010 22:02
It would be better if I show you, rather than trying to explain it.

Are using the good old stock weapon.fpi for the weapon pick ups main ai?

Also, what script are you using for your trigger zone to spawn the character? (stock script?)

I'll modify them for this effect for the stock engine. (should work with most mods too)
That way, people searching for this effect will have another example.

If you are using the good old stock plrinzoneactivateused.fpi for the trigger zone to spawn the enemy then just add activated=67, like so....




And your aimain for the weapon's pick up would look like this...



As you can see the triggerzone would need to be renamed to "tzone1" for this example script to work.

Picking up the weapon activates the triggerzone, so that it will now meet its conditions once the player is in the zone.

The triggerzone cannot spawn its enemy until the weapon has been picked up, because it is now checking for that activated state.

   Conjured Entertainment

 WARNING: Intense Madness
PW Productions
15
Years of Service
User Offline
Joined: 13th Mar 2009
Location: sitting in a chair.
Posted: 2nd Jun 2010 22:20
Quote: "It would be better if I show you, rather than trying to explain it."


Yes it would, thank you.

Quote: "Are using the good old stock weapon.fpi for the weapon pick ups main ai?"


Yep.
Quote: "
Also, what script are you using for your trigger zone to spawn the character? (stock script?)"


plrinzoneactivateifused.fpi (so I can spawn enemies).


Wow! Thanks for all that help! That is exactly what I needed, and I actually understand it now Thank you so much, conjured. This is really, exactly what I needed. You will definitely be credited, along with Marc and Blackfox for all the help you've given me.

You see, usually when someone tries to help me with a script, they say, you're going to need this this and this. But how am I supposed to put it together? And you answered that before I could summon the will to ask, thank you.

Cheers guys

-PwP-

BlackFox
FPSC Master
16
Years of Service
User Offline
Joined: 5th May 2008
Location: Knight to Queens Bishop 3
Posted: 6th Jun 2010 21:43 Edited at: 6th Jun 2010 21:45
Thanks for the clarification Conjured Entertainment. I've tried to trigger a trigger zone, and gave up thinking it was not possible. I did notice that I did not use this:



Now I have made notes on this method for future reference. Thank you for the time and detailed explanation.

[EDIT] As I was typing this out, Bluefox politely reminded me that she triggers trigger zones in her development. Nothing like being corrected by my wife

Thanks again.

- BlackFox

SikaSina Games
16
Years of Service
User Offline
Joined: 5th Dec 2007
Location: Reading, UK
Posted: 6th Jun 2010 22:14
So, let me see if I've got this right: If a trigger zone is set to teleport the player to another trigger zone by the ifused name in the primary trigger zone, it won't work? That'd probably explain why my player didn't teleport to the place I wanted them to, let alone go anywhere xD.

-SSG

--=. ,=--

Login to post a reply

Server time is: 2024-11-24 23:46:27
Your offset time is: 2024-11-24 23:46:27