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 / Small Question - About One-Time Scripts

Author
Message
DarkJames
15
Years of Service
User Offline
Joined: 11th Aug 2009
Location:
Posted: 20th Aug 2012 20:45
Well! Hello there!


I do have a question for all those amazing scripters in this community.

I want, lets say, that in my game, when the player goes through "X" sound zone [Or Trigger Zone] something, a sound or a creature, will appear, but nontheless of the player stepping on that zone again, the effect that "X" did, will not repeat.

------
The Storyteller 01
15
Years of Service
User Offline
Joined: 11th May 2009
Location: On a silent hill in dead space
Posted: 20th Aug 2012 21:14 Edited at: 20th Aug 2012 21:17
For all Trigger Zone scripts you only want to run once, just add DESTROY to the end of the very last line.


Destroying scripted entities after they aren't needed anymore is always the best solution, because every active script takes a tiny toll on the game performance

In case you find my grammar and spelling weird ---> native German speaker ^^
DarkJames
15
Years of Service
User Offline
Joined: 11th Aug 2009
Location:
Posted: 20th Aug 2012 21:25 Edited at: 20th Aug 2012 21:34
Do I need to add a new "State" line?

Addendum

You may not know, but I'm a "Noob" at scripting.

Addendum-b

Nevermind, I added the previous state line before "Destroy" and it worked.

------
BlackFox
FPSC Master
16
Years of Service
User Offline
Joined: 5th May 2008
Location: Knight to Queens Bishop 3
Posted: 20th Aug 2012 21:39 Edited at: 20th Aug 2012 21:43
Quote: "For all Trigger Zone scripts you only want to run once, just add DESTROY to the end of the very last line."


You can also use the following:



Both have the same effect. The DESTROY carries it one step further by running the "destroy" script of the entity. For entities set to "fade" (such as a character), this is the better method.


Twitter: @NFoxMedia
DarkJames
15
Years of Service
User Offline
Joined: 11th Aug 2009
Location:
Posted: 20th Aug 2012 21:43
Thanks both of you! Too bad they don't include scripts such as "soundinzone-onlyonce" and so on the stock scripts, they could have saved me the shame!

------
BlackFox
FPSC Master
16
Years of Service
User Offline
Joined: 5th May 2008
Location: Knight to Queens Bishop 3
Posted: 20th Aug 2012 21:47
Quote: "Thanks both of you! Too bad they don't include scripts such as "soundinzone-onlyonce" and so on the stock scripts, they could have saved me the shame!"


This one works as it should. It plays the sound once and that is it.

soundinzone.fpi




Twitter: @NFoxMedia
DarkJames
15
Years of Service
User Offline
Joined: 11th Aug 2009
Location:
Posted: 20th Aug 2012 21:53
Thanks! Also, I wonder, or I may have to do another thread... But I want to feel no more shame for my so-so nooby skills at Scripting... Do you have a script for [Without battery-charge] Wasp Mod's flashlight?

------
The Storyteller 01
15
Years of Service
User Offline
Joined: 11th May 2009
Location: On a silent hill in dead space
Posted: 20th Aug 2012 23:17 Edited at: 20th Aug 2012 23:17
There are several working flashlight scripts around.

Just type "flashlight" into the search box below and you'll see all the threads.

Btw, there is no "best" flashlight script imo, everyone has has his or her preferences for their own games.

In case you find my grammar and spelling weird ---> native German speaker ^^
DarkJames
15
Years of Service
User Offline
Joined: 11th Aug 2009
Location:
Posted: 20th Aug 2012 23:20
Mhm! But I haven't seen one using Wasp Mod's capabilities, as in "Flashlight on" or so. I have seen Hud flashlights though, but they don't use the Wasp commands.

------

Login to post a reply

Server time is: 2024-11-23 22:57:02
Your offset time is: 2024-11-23 22:57:02