RMRK is retiring.
Registration is disabled. The site will remain online, but eventually become a read-only archive. More information.

RMRK.net has nothing to do with Blockchains, Cryptocurrency or NFTs. We have been around since the early 2000s, but there is a new group using the RMRK name that deals with those things. We have nothing to do with them.
NFTs are a scam, and if somebody is trying to persuade you to buy or invest in crypto/blockchain/NFT content, please turn them down and save your money. See this video for more information.
[XP] Evented Cheat Code System

0 Members and 1 Guest are viewing this topic.

***
Rep:
Level 86
Yeah... about that.....
I'm not sure if Event Systems are like Tutorials, Resources, and Scripts, and have to be moved to th Event System forum like the others are moved to the respective databases, so I'll post this here and hopefully someone will tell me.


Anyways...  I made a cheat system with Events.

REQUIREMENTS:
One Common Event
One Switch
One Way To Call Name Input Processing
An Extra Character Slot



To begin, make a new Character Slot in the Database.  I made it #16 so I wouldn't try to accidentally use it.  Leave the name blank.

Make a new Common Event.  Name it "Cheat Code" and have it a parallel process activated by a switch.  I used switch one, and named it "Cheat Code" also.

Start a conditional branch, set to "If Character [Whatever character you just made] is name '[cheat code]' applied".  For have the [cheat code] be the cheat code.  I just simply used Cheat Code.  So,  it would say for me "Conditional Branch:  [] is name 'Cheat Code' applied".  I unchecked the box at the bottom, "Set handling when conditions do not apply" because it doesn't matter.

If the conditions are met, we want the player to be rewarded, right?  Let's give him a thousand bucks for being a cheating little skank.  "Change Gold: +1000".

If we just stop here, then your gold will just keep going up until you can't add anymore gold.  While the player wouldn't mind, you prolly do.  After you have the player get 1000 gold, throw in a Change Name (NOT input name) and change the cheat code character's name back to blank.

Well, now we need to allow the character to insert the code.  There's two ways we can do this.

First, let's have cheat codes ony enterable at certain spots.  If you use a save point type thing, you prolly wanna have cheats here.  Make a new event on your map.  Choose the graphic, and have the event do "Name Input Processing: [cheat character], 16 characters".

If you want the player to hit a button and call the cheat code, go back to our common event.  Insert a conditional branch above the first one, set to "If Button is being pushed".  Have it call Name Input Processing like above.  Have the button be whatever you want the cheat button to be.

Tada!!

I'll get some screens up in a bit.  For some reaso, my computer keeps shutting down when I try to do a print screen lately.

EDIT:  Forgot the Demo.  It only has the event based system, not the anywhere input.
« Last Edit: February 23, 2014, 04:19:54 PM by modern algebra »
This is a signature.

***
Rep:
Level 86
Yeah... about that.....
Ah yes, so it seems.  But I figured with most games, cheats are case sensitive, so I didn't bother to include the other ways.

However, how could it be "inadvertently creating an unusable code"?

Thanks, though.
This is a signature.

*
Resident Cloud
Rep:
Level 91
hi, you can use a script snippet in a conditional to make this alittle cleaner. I know there scary but this is real simple ill even explain the script snippet. It is only one line :D


the script box is on the 4th page of the conditionals. Paste this into it:

Code: [Select]
($game_party.actors[0].name =~ /unlockme/i) ? true:false

ill explain it.
Code: [Select]
( ) ? :
this is a shorthand ruby if statement, the condition eg. if gold is more then 14 goes in the brackets. then the ? indicates its an if. You place what should happen if the condition is true before the colon and what should happen if its false afterwards.

Code: [Select]
$game_party.actors[0].name
this gets your first party members name. Computers oftern start counting at 0 i used to think it was weird to. If you want your second party members name then change the "0" to a "1" and so on.

Code: [Select]
=~

this is an operation its performed on the thing before it using stuff after it. this one here means check whats before me against the regular expression after me.

Code: [Select]
/unlockme/i
this is the regular expression. it simply looks for matches for the stuff inbetween the /s the i after the last "/" means case insensitve. This pattern will match:
unlockme
UNLOCKME
UnlockME
unLockme

and so on.

Code: [Select]
true:false

this says that the conditional will be true(matching) if the previous condition was matched or false if it wasnt. If it is true then your event will continue with the commands underneath the conditional. IF its not itll go to the else statement.

You can place anything you want in the regular expression pattern /do you like beans/i is just an example :D.

EDIT: heres a quick image showing how this works and that its still 95% eventing and 5% a script:


« Last Edit: June 04, 2008, 10:33:51 AM by anchovy »

***
Rep:
Level 86
Yeah... about that.....
Once again, thanks for that, but for most games the cheat codes are case-sensitive.

Does that only work for players in the party, or does it work for characters in the database?  Because I don't particularly want to have an extra character in the party.
This is a signature.

*
Resident Cloud
Rep:
Level 91
try experimenting should work if not let me know and ill make some changes :D