Mystic Software
The original resource site for the RPG Toolkit Community
: Mystic Software / Articles / Help / Modified Commands

Articles
- Modified Commands-
Written By Don't_Think_So



If your like me, then maybe at some point or another you have wanted to change a command very slightly, like if you wanted to know the current font size, you could look at a variable (say fontsize!) that was automatically stored with the #fontsize command.

So, maybe you want something like this:

#mwin("The current font size is !")
#prompt("What would you like it to be?",picksize!)
#fontsize(picksize!)
#mwin("Here is font size . Do you think it is better?")

As you could see, this has quite some ability. For example, you could make a #save command that doesnt save cheats. Ok, now do I have your attention? Good. So, we start by making a method. Following our #fontsize command...

#method modifiedfontsize(size!)
{
#fontsize!=size!
#killredirect(#fontsize)
#fontsize(size!)
#redirect(#fontsize,#mymodcommands.modifiedfontsize)
}

Now, most people would, at this point, take you step-by-step through this bit of code, but I think your smart enough to know that it basically puts the variable size! into fontsize!, then runs the command as normal, through the #redirect and #killredirect commands. If you are lost, here is another example:

#method modifiedsav(destsave$)
{
#if(cheathpmod!=1)
{
#givehp("You",-900)
*this assumes that you made a cheat that gave you 900 health, and it only *worked once.
}
#killredirect(#save) *gives the toolkit the ability to use the normal command #save(destsave$) *uses the normal command
#redirect(#save,#mymodcommands.modifiedsave)
*makes the toolkit run through this same process next
*time.
}

Just read the comments. You'll understand.

-Dont_Think_So

All logos and trademarks in this site are property of their respective owner. The submitted content are property of their owners.
Mystic Software © 2004