Advertisement
dragonbane

Lua Scripting

Dec 13th, 2015
144
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.89 KB | None | 0 0
  1. -Use static pushback vector that contains the lua state, the filename and status booleans (started, savestates etc)
  2. -When emulation starts Init() gets called: Find all lua files that start with an _ and add them to the vector to be launched immediately
  3. -On shutdown of emulation remove all active scripts and delete the lua states so the user can edit the files
  4. -Have Launch Script UI under Zelda tab that refreshes a dropdown list of all script files every time it is Shown (closed and re-opened)
  5. -Launching a script places it inside the vector as well, also have button to cancel a script and remove it based on filename to allow quick editing
  6. -Split superswim and normal script update calls in SI_GCController
  7. -Normal script updates check all lua states in the vector, check if a script needs to be launched (hasStarted = false) and updates all the started ones (scriptUpdate, scriptStart, scriptEnd)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement