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 / Just wondering about cheat codes

Author
Message
Ocho Geek
17
Years of Service
User Offline
Joined: 16th Aug 2007
Location: Manchester, UK
Posted: 3rd Sep 2008 22:26
Sorry if this sounds like a request...

now i think (i've only done small scripts so sorry if im wrong) scancodekeypressed= is the command that checks if (or waits for) you to press a key, i was wondering if:

you could have a number of keys (a coded message) pressed together with a time limit between each key (5sec) so you dont accidently discover the secret code

im terrible at scripting from scratch, but heres my attempt minus a few things



have yet to try, and is unfinished, will it work as it is?

zeza
16
Years of Service
User Offline
Joined: 27th Jun 2008
Location:
Posted: 3rd Sep 2008 23:21
What keys do you want the player to press?
Seth Black
FPSC Reloaded TGC Backer
19
Years of Service
User Offline
Joined: 22nd Feb 2005
Location: Pittsburgh, PA
Posted: 4th Sep 2008 00:20
...this script won't get to state 3, or state 10, and will only check to see if the player is in the zone once.


xplosys
18
Years of Service
User Offline
Joined: 5th Jan 2006
Playing: FPSC Multiplayer Games
Posted: 4th Sep 2008 03:53
Perhaps the best way to go about this is not with a zone or any kind of proximity, but with a key press to initiate the script. In other words...

:state=0,scancodekeypressed=41:state=1

41 denotes the tilde key, though you can use any key you please. When the player presses the tilde key, the script progresses to state 1 and waits for a cheat code to be entered. This way, the player can enter a code any time, and not only when in a zone. Such a script must be assigned to a dynamic entity. A light entity is a good one.

Also, I suggest reading a few tutorials on scripting so you know the syntax. What you wrote does not follow the fpi scripting conventions and will not work. As with any scripting language, there is no room for error, and your code must be perfect.

Best.

Ocho Geek
17
Years of Service
User Offline
Joined: 16th Aug 2007
Location: Manchester, UK
Posted: 4th Sep 2008 18:27 Edited at: 4th Sep 2008 18:30
thanks the tilde is a good idea

also, if it dosent check the player zone will i only have to walk through the zone for the cheat code to become active?

xplosys
18
Years of Service
User Offline
Joined: 5th Jan 2006
Playing: FPSC Multiplayer Games
Posted: 4th Sep 2008 18:48
No zone will be necessary. You press the tilde key to activate cheat code access, then type the cheat code in. The cheat can instantly be active when you type in the code.

Best.

Plystire
21
Years of Service
User Offline
Joined: 18th Feb 2003
Location: Staring into the digital ether
Posted: 4th Sep 2008 19:34
And please, for the love of god, put the second colon in there! Nothing will function without it.

To help you out, I will show you your script. In these lines I will highlight conditions in bold and actions in underlined italics.

:state=0,plrwithinzone=1,state=1
:state=1,scancodekeypressed=36,state=2
:state=3,scancodekeypressed=19,state=10
:state=10,plraddhealth=50,plrsound=audiobank\items\healthup.wav,state=1


This is need to know information. Conditions ask a question (Is the State equal to 10?) whereas Actions DO something (Set the State equal to 10)

Now.... in BETWEEN the conditions and actions... you put a colon. This is uber important.


Get it right and you'll be better off.



As for debugging... You have one of your lines set the state to "2" but there is no line in your script that checks for a state of 2, so once it gets there, it will stop working.


The one and only,


Those who live in the past, are destined to insanity. Those who live only for the future, will be slaves to their ambitions.
Those who live in the moment... only they, are truly happy.
Little Bill
16
Years of Service
User Offline
Joined: 18th Jun 2008
Location: UK
Posted: 4th Sep 2008 21:48
I like to think of it as the first colon being "if" and the second being "then". If you've programmed in a different language this helps quite a bit as I found out.


Win XP - 2GB RAM - NVIDIA GeForce 7300LE
TGPEG
17
Years of Service
User Offline
Joined: 28th Dec 2006
Location: Bristol, United Kingdom
Posted: 5th Sep 2008 00:03
and if you still can't do it, try Ply's scripting guide (it's how I learned)

http://forum.thegamecreators.com/?m=forum_view&t=116527&b=23

[center]
Gunn3r
18
Years of Service
User Offline
Joined: 12th Jun 2006
Location: Portland, OR
Posted: 5th Sep 2008 07:51
Where does state=2 go to? I'm not following...

Gunn3r Games
Ocho Geek
17
Years of Service
User Offline
Joined: 16th Aug 2007
Location: Manchester, UK
Posted: 6th Sep 2008 23:55
right thanks a tonne for the help

Ocho Geek
17
Years of Service
User Offline
Joined: 16th Aug 2007
Location: Manchester, UK
Posted: 10th Sep 2008 19:01 Edited at: 10th Sep 2008 19:07
hmm, can you see any errors it still wont work



Nickydude
Retired Moderator
18
Years of Service
User Offline
Joined: 4th Nov 2006
Location: Look outside...
Posted: 10th Sep 2008 20:29
Does the player have to type 'healmequick'? If so where the player has to type 'quick', you only have 4 states; 7, 8, 9, 10, for player input, should there be 5?

Ocho Geek
17
Years of Service
User Offline
Joined: 16th Aug 2007
Location: Manchester, UK
Posted: 10th Sep 2008 23:02
... right

Ocho Geek
17
Years of Service
User Offline
Joined: 16th Aug 2007
Location: Manchester, UK
Posted: 10th Sep 2008 23:25 Edited at: 10th Sep 2008 23:33
Cheat Code Script Complete

Here Is the COMPLETE script, with credits to all that helped get the script working

Usage
This Script Will Not Work In Test Game.
The Debug commands in Test Game will give you 9999 health if you try to type it out!

This script only works in the final build, if you modify this script, CHECK IT WORKS IN THE FINAL BUILD.


Isnt Very Hard To Modify the Script to make different Codes and Results, self explanitary to anybody with basic scripting Knowledge

Liscence
As I Like To Give media away for free, this can be use with no restrictions, however dont be a dirtbag, keep it free
Please Give Credit to Ocho(me), Xplosys, Plystire & NickyDude Whom all helped in one way or another to complete this




Use THIS to create new codes


Find This And More At My FPSC Site!

Plystire
21
Years of Service
User Offline
Joined: 18th Feb 2003
Location: Staring into the digital ether
Posted: 11th Sep 2008 08:19
Congrats! Let's see more scripts!


The one and only,


Those who live in the past, are destined to insanity. Those who live only for the future, will be slaves to their ambitions.
Those who live in the moment... only they, are truly happy.

Login to post a reply

Server time is: 2024-11-24 13:46:21
Your offset time is: 2024-11-24 13:46:21