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 / Need help with timer var...

Author
Message
Mr Love
19
Years of Service
User Offline
Joined: 9th Jun 2005
Playing: MAFIA 2
Posted: 7th Jan 2017 06:25
This timerscript works great, sadly I cant say the same about My hitbox_main script. What I want is to be able to turn off bullet-collision when the time has run out...

Timer script:

:activated=1
:state=0:dimvar=timecounter
:state=0:hudreset,hudx=50,hudy=15,hudsize=30,hudfont=verdana,hudtext=Time Left,hudname=timeleft,hudhide=1,hudmake=display
:state=0:hudreset,hudx=50,hudy=20,hudsizex=24,hudsizey=24,hudimagefine=gamecore\huds\numeric2.dds,hudtype=6,huduservar=timecounter,hudname=timecounter,hudhide=1,hudmake=numeric
:state=0:state=1

:hudunshow=timeleft,hudunshow=timecounter,destroy

:state=1,plrwithinzone=1:state=2
:state=2:hudshow=timeleft,state=3
:state=3:setvar=timecounter 30,state=4,hudshow=timecounter
:state=4:etimerstart,state=5
:state=5,etimergreater=1000:state=6
:state=6:subvar=timecounter 1,state=7
:state=7,vargreater=timecounter 0:state=4
:state=7,varless=timecounter 1:hudunshow=timeleft,hudunshow=timecounter,state=8
:state=8:music=0

Hitbox_main script:

:state=0,var??????:nobulletcol

Thanks for helping...
ncmako
12
Years of Service
User Offline
Joined: 19th Feb 2012
Location: Hendersonville,NC
Posted: 11th Jan 2017 11:10 Edited at: 11th Jan 2017 11:11
Mr Love
Quote: "turn off bullet-collision when the time has run out"

It should work if you take your last state (state=8) and add "nobulletcol" to the line?

Just remembered, this script is running in a trigger, correct? It only works with dynamic entities.
My games never have bugs. They just develop random features..
Lots and lots of random features...
Mr Love
19
Years of Service
User Offline
Joined: 9th Jun 2005
Playing: MAFIA 2
Posted: 12th Jan 2017 02:00 Edited at: 12th Jan 2017 02:06
Glad to see that You are back ncmako! It was both good and bad that You were gone for a while, because I now start to understand .fpi quite well...
And I did solve this problem with vars like in this destroy script for the hitbox: (The only problem is that the hudtext just flash for half a second on the screen)

;Artificial Intelligence Script

;Header

desc = Leave corpse

;Triggers
:state=0,vargreater=timecounter 0:state=2
:state=1,varless=timecounter 1:nobulletcol
:state=2:state=3,addvar=hpcounter 25,suspend,coloff,state=3
:state=3:hudunshow=timeleft,hudunshow=timecounter,activateifused=5
:state=3:etimerstart,hudreset,state=4
:state=4:fpgcrawtextsize=32,fpgcrawtextfont=Arial,fpgcrawtextr=255,fpgcrawtextg=255,fpgcrawtextb=255,fpgcrawtextx=50,fpgcrawtexty=40
:state=4:sound=audiobank\misc\ping.wav
:state=4:hudtext=You Collected 25 Hero Points
:state=4,etimergreater=3500:fpgcrawtextoff



;End of Script
ncmako
12
Years of Service
User Offline
Joined: 19th Feb 2012
Location: Hendersonville,NC
Posted: 12th Jan 2017 11:07 Edited at: 12th Jan 2017 11:08
Mr Love
Quote: "the hudtext just flash for half a second on the screen"

Since this is the "destroy" script it may be causing problems? The "suspend" command
may also be the problem?
Also, at line "state=2" you have "state=3" twice. Remove the first state=3 and test again?
":state=2:addvar=hpcounter 25,suspend,coloff,state=3"
Test this...
My games never have bugs. They just develop random features..
Lots and lots of random features...

Login to post a reply

Server time is: 2024-11-21 13:03:15
Your offset time is: 2024-11-21 13:03:15