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 / I made a gas mask script, it suddenly stoped working !

Author
Message
Brunopark09
14
Years of Service
User Offline
Joined: 7th Jul 2010
Location: Santiago de Chile
Posted: 14th Nov 2011 02:18
Hi there folks, i got this

A gas mask script with a working hurt zone using a variable, it suddenly stoped working.

desc = Máscara de Gas

:state=0:globalvar=77,setvar=0
:state=0:hudreset,hudx=50,hudy=50,hudsizex=1680,hudsizey=881,hudimagefine=gamecore\huds\mascara.png,hudname=gm,hudhide=1,hudmake=display,state=1

:state=1,scancodekeypressed=34:hudshow=gm,loopsound=audiobank\music\breathing.wav,setvar=1,state=2
:state=2,scancodekeypressed=0:state=3
:state=3,scancodekeypressed=34:hudunshow=gm,stopsound,setvar=0,state=4
:state=4,scancodekeypressed=0:state=1


And...



desc = Zona de gas tóxico

:state=0:globalvar=77,state=1
:state=1,plrwithinzone=1,varequal=0:plraddhealth=-1

Any idea guys?


The bad way, the good way, the YNG-way.
Ched80
14
Years of Service
User Offline
Joined: 18th Sep 2010
Location: Peterborough, UK
Posted: 18th Nov 2011 06:54
It's possible the global variable you are using losses focus. I would also set the variable before setting or adjusting it such as:

Quote: "...globalvar=77,setvar=1...
or
:state=1:globalvar=77
:state=1,varequal=1:..."


I'm not sure what scancodekeypressed=0 does. I know "keypressed=34 0" is true when key 34 is not pressed, but I'm not sure "scancodekeypressed" does the same.

Brunopark09
14
Years of Service
User Offline
Joined: 7th Jul 2010
Location: Santiago de Chile
Posted: 18th Nov 2011 07:17
I think i'm getting your idea chad, and yes, the scancodekeypressed does exactly the same as keypressed=x y, it was actually the original command for key pressing recognition in fpsc


The bad way, the good way, the YNG-way.
TheDesertEagle
13
Years of Service
User Offline
Joined: 7th Jul 2011
Location: Canada - Who knows where else???
Posted: 18th Nov 2011 14:38
oh maybe try globalvar =gasmask

Joey-May god have mercy upon my enemies, because I won't.
Favourite Game-Call Of Duty MW2
BlackFox
FPSC Master
16
Years of Service
User Offline
Joined: 5th May 2008
Location: Knight to Queens Bishop 3
Posted: 18th Nov 2011 16:46 Edited at: 18th Nov 2011 16:47
Quote: "It's possible the global variable you are using losses focus."


Ched80 is on the right track. When the script runs, it will switch to that global variable called and then set the value according. It may not know what to do since you are trying to set the value in the middle of the script.

I would have done something like this using the "incvar" and "decvar", since I know the value will either be one or zero:



I have a 350+ line script for my inventory and this method works for me, so hopefully it should work for you.


Twitter: @NFoxMedia
Brunopark09
14
Years of Service
User Offline
Joined: 7th Jul 2010
Location: Santiago de Chile
Posted: 21st Nov 2011 08:46
Oh, thanks a lot everyone! it works and got it in mind in my scripts.


The bad way, the good way, the YNG-way.

Login to post a reply

Server time is: 2024-11-24 04:01:46
Your offset time is: 2024-11-24 04:01:46