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 / Destroy a triggerzone

Author
Message
A dude
14
Years of Service
User Offline
Joined: 15th Mar 2010
Location: The Solar System
Posted: 29th Sep 2011 02:16
Is it possible to destroy a triggerzone with a script?
BlackFox
FPSC Master
16
Years of Service
User Offline
Joined: 5th May 2008
Location: Knight to Queens Bishop 3
Posted: 29th Sep 2011 02:47
Yes it is. You can use either variables to do it, or you have a script elsewhere running that will destroy the particular trigger.

Here's an example...

I have an outdoor level. The player is to collect a map in a room and proceed to navigate a mine. If they do not pick up the map, they will have a hud come up part way through telling them they need the map. If they have the map, the hud does not show and that trigger is destroyed. I used the variable method for this example. When the player picks up the map, a global variable #1 is set to the value of 1. When they reach that trigger, the script in the trigger runs and checks that global variable when the player is in the zone. If the value of the variable equals 1, it destroys; if not, the hud appears and the player must return for the map. I also have it looping back to check again just in case the player thinks they can bypass getting the map.

Another example not using variables...

I can set the map entity's script to set target to the name of the trigger, then activate that target. The trigger's main script is running and checking to see if it has been activated in the beginning states. If it is not activated, it waits for about 1 second, then returns to check again. If it has been activated, I give the "state=<number>:destroy" which destroys the trigger.

There are a few other methods, but those are the common two I use myself. A bit of scripting knowledge, but it uses the basic commands available.


Twitter: @NFoxMedia
maho76
13
Years of Service
User Offline
Joined: 31st May 2011
Location: universe-hub, playing the flute
Posted: 29th Sep 2011 11:09 Edited at: 29th Sep 2011 11:09
sorry, wrong thread
A dude
14
Years of Service
User Offline
Joined: 15th Mar 2010
Location: The Solar System
Posted: 29th Sep 2011 22:17 Edited at: 29th Sep 2011 22:17
I want the hurtzone to destroy after a few seconds. Here's what I made:


It doesn't destroy
BlackFox
FPSC Master
16
Years of Service
User Offline
Joined: 5th May 2008
Location: Knight to Queens Bishop 3
Posted: 29th Sep 2011 22:22 Edited at: 29th Sep 2011 22:27
Script syntax has a few errors. A few of your lines contain a colon instead of a comma, and you should use "etimerstart/etimergreater" instead of "timergreater".



Now if you want to change the time, adjust the value in the "etimergreater". I'm not too sure what you have the second and third line for- I just corrected your supplied script. If you gave me an example, I could tell you 100% how to write it. Hopefully my rewrite gives you a better direction.


Twitter: @NFoxMedia
A dude
14
Years of Service
User Offline
Joined: 15th Mar 2010
Location: The Solar System
Posted: 30th Sep 2011 00:00 Edited at: 30th Sep 2011 00:21
Thanks Blackfox.

I want the animated health bar to go from 0 to 100 for 7 seconds but I can't because the hurt zone does damage too quickly so I need the bar to go from 0 to 100 and then recharge as that should take up close to 7 seconds.
BlackFox
FPSC Master
16
Years of Service
User Offline
Joined: 5th May 2008
Location: Knight to Queens Bishop 3
Posted: 30th Sep 2011 00:19
You are welcome. Anytime.


Twitter: @NFoxMedia

Login to post a reply

Server time is: 2024-11-24 04:57:59
Your offset time is: 2024-11-24 04:57:59