I've been wondering is it possible to delay a script being loaded until after the game is started instead of initial start up?
Delaying a script?
RGSSx Script SupportYou can use a different script to load the scripts from a file.
Or you can assign the whole script as a string to a variable and eval that variable when you want the script to be loaded.
Or you can assign the whole script as a string to a variable and eval that variable when you want the script to be loaded.
The script should let you load it whenever you want.
Ahh, Both still evaluated the script on start up;
I tried with http://forums.rpgmakerweb.com/index.php?/topic/20589-external-scripts-framework/
I tried with http://forums.rpgmakerweb.com/index.php?/topic/20589-external-scripts-framework/
The script will be evaluated at the moment you run "load_script(filename)" or "eval(variable)".
If you're calling it from inside the script editor, it will still be loaded on startup, you'll have to call it with the "call script" command on an event.
If you're calling it from inside the script editor, it will still be loaded on startup, you'll have to call it with the "call script" command on an event.
It's still being evaluated on start up because of the
def load_script(path) eval(load_data(path))endI don't have the load_script() function in my script editor.
def load_script(path) eval(load_data(path))endI don't have the load_script() function in my script editor.
Please back up a step: why do you want to delay what script?
All scripts are usually loaded at startup and later loading only works for a very limited number of scripts for the same reason that you need to start a new game after adding most scripts: they need the initialisation done at new game to function properly.
Now, if you want some function of the script delayed the way to go is to condition that function on the use of a switch and trigger that switch in your game.
That usually requires a rewrite of parts of the script, and it can't be done in general but is different for each script.
So please link us to the script you're talking about, and then we can check what is possible.
All scripts are usually loaded at startup and later loading only works for a very limited number of scripts for the same reason that you need to start a new game after adding most scripts: they need the initialisation done at new game to function properly.
Now, if you want some function of the script delayed the way to go is to condition that function on the use of a switch and trigger that switch in your game.
That usually requires a rewrite of parts of the script, and it can't be done in general but is different for each script.
So please link us to the script you're talking about, and then we can check what is possible.
Original thread: https://forums.rpgmakerweb.com/threads/delaying-a-script.40706/