Script Help Thread (DO NOT REQUEST SCRIPTS)
View Single Post
August 4th, 2011 (11:52 AM).
My advanced eval trick allows one to pass the value of a variable into a script that accepts only raw values and not variables. The "dynamic script compilation at run-time" link in my signature links to an explanation of how it works.
Basically, with some complex RAM edits, you can literally write a script at run-time. You'd take your script -- "setmaptile 0xWWXX 0xYYZZ 0x1 0x0 ; return" -- and convert it to hex. You'd write those hex values into variables, and then use some tricky RAM manipulation to call those variables and get the game to treat them as script code. Since you're building the script at run-time, any part of it can be changed -- in this case, the WWXX and YYZZ that get passed to setmaptile.
The effect is that functions that only take values can have those values "injected" from variables.
I should note that it is a very complex technique, but it solves problems like this quite effectively.
PokeMart as debug input
script compilation at runtime
music: a dreadful tutorial
I'm not active and don't do this kind of stuff anymore. I'm now trying to create my own game engine.
two message boxes at once
[WIP] firered RAM map
list of all known flags/vars in firered
script command ref: 114 complete / 175 documented / 214
Joined Jul 2010
View Public Profile
Send a private message to DavidJCobb
Find all posts by DavidJCobb
Find threads started by DavidJCobb
Ignore Posts by DavidJCobb