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 / A few edits I was trying to implement to some scripts

Author
Message
DarkJames
15
Years of Service
User Offline
Joined: 11th Aug 2009
Location:
Posted: 27th Sep 2012 22:57
Hey ther!


Today I was trying to edit a script [Flashlight script. using the commands of TZK's mod] and I found myself attempting to change the scancodekey [using "33"] to mousestate=2, for a more lean enviroment, now, as looking at the script, I saw:

Quote: ":State=2,KeyPressed=33 1:FlashLightOn,State=3,hudshow=flash,Sound=AudioBank\onoff.wav
:State=3,KeyPressed=33 0:State=4
:State=4,KeyPressed=33 1:FlashLightOff,State=5,hudunshow=flash,Sound=AudioBank\onoff.wav
:State=5,KeyPressed=33 0:State=2"


And I saw mousestate would need to "Add" something to make up for "0" and "1", would you aid me in this? Also the fpi editpad didn't acknowledge "Mousestate" as a correct condition/action, do I have a big typo or am I going wrong somewhere here? I know I have to add "Pickup" in the first "intro" lines... I'm also not sure why is there a 0 and 1 after the keypressed.

------
Fenwolf
13
Years of Service
User Offline
Joined: 24th Oct 2011
Location: United States
Posted: 28th Sep 2012 09:13
I'll address the issue of the 0 and 1 first. When the script checks for the appropriate key to be pressed, the number 1 indicates that the condition is true and the key is pressed, while the 0 indicates that the key has been released. In the section of script that you posted, the condition "KeyPressed=33 1" is met when the key in held down. In order to keep the script from cycling too quickly, the script checks to assure that the key has been released "KeyPressed=33 0" before moving to the next state.

As to using mousestate, it would be used in a similar manner. "mousestate=1" checks to see if the left mouse button is depressed. "mousestate=2" checks to see if the right mouse button is depressed.
"mousestate=0" checks to assure that no mouse buttons are depressed.

Hope this helps.

Life is about living.

Login to post a reply

Server time is: 2024-11-23 20:02:17
Your offset time is: 2024-11-23 20:02:17