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 run a script once then destroy?

Author
Message
Troutflies
13
Years of Service
User Offline
Joined: 24th Feb 2011
Location: Stuck outside my map.
Posted: 17th Apr 2013 09:30
I have written a few trigger and soundzone scripts. It seems as though once I added the script to the zones my fps went from mid 40's to 10 once activated. my Ai bar is maxed out. so I am guessing the zone scripts are still looping in the backround. It has to be possible to either destroy the zone or stop the script from running.
Tomahawk
11
Years of Service
User Offline
Joined: 16th Dec 2012
Location: Where do you think I live?
Posted: 17th Apr 2013 16:15
I think it would just be to destroy the zone that would require scripting though.

Aarchduke
13
Years of Service
User Offline
Joined: 10th Aug 2011
Location: United Kingdom
Posted: 19th May 2013 23:47 Edited at: 20th May 2013 19:47
Here is the script layout I use for my once-only trigger zones:


;Artificial Intelligence Script

;Header

desc = My Own HUD

;Triggers

:state=0:hudreset,hudx=50,hudy=90,hudimagefine=gamecore\huds\MyHud.dds,hudname=HUD,hudhide=1,hudmake=display,state=1
:state=1,plrwithinzone=1:hudshow=HUD,state=2
:state=2,plrwithinzone=0:hudfadeout=HUD,destroy

;End of Script


It is that "destroy" command which ends the trigger zone from, just add that to the last line of your trigger zone, as I know that the default "plrwithinzone" scripts use a state=0 loop... Still, that huge drop in FPS is odd -

Anyway, Hope that helped

-Duke.

So we beat on, boats against the current, borne back ceaselessly into the past.
Corno_1
14
Years of Service
User Offline
Joined: 3rd Nov 2010
Location:
Posted: 20th May 2013 20:48
@Troutflies
It is always good to see what you did! Without something we can just speculate what you do wrong!

But if you want to destroy a triggerzone use this with your states:

:state=20:destroy,state=21


Login to post a reply

Server time is: 2024-11-23 14:18:36
Your offset time is: 2024-11-23 14:18:36