Delaying a script?

Capitán

kind of a big deal
Veteran
Joined
Jul 9, 2013
Messages
572
Reaction score
145
First Language
Engilsh
Primarily Uses
RMMV
I've been wondering is it possible to delay a script being loaded until after the game is started instead of initial start up?
 

Hudell

Dog Lord
Veteran
Joined
Oct 2, 2014
Messages
3,545
Reaction score
3,715
First Language
Java's Crypt
Primarily Uses
RMMZ
You 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.
 

Capitán

kind of a big deal
Veteran
Joined
Jul 9, 2013
Messages
572
Reaction score
145
First Language
Engilsh
Primarily Uses
RMMV
You can use a different script to load the scripts from a file.
Wouldn't that script load the file on initial start up?

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.
I will attempt this method.
 

Hudell

Dog Lord
Veteran
Joined
Oct 2, 2014
Messages
3,545
Reaction score
3,715
First Language
Java's Crypt
Primarily Uses
RMMZ
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.
 

Capitán

kind of a big deal
Veteran
Joined
Jul 9, 2013
Messages
572
Reaction score
145
First Language
Engilsh
Primarily Uses
RMMV
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.
 

Andar

Veteran
Veteran
Joined
Mar 5, 2013
Messages
31,355
Reaction score
7,666
First Language
German
Primarily Uses
RMMV
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.
 

Users Who Are Viewing This Thread (Users: 0, Guests: 1)

Latest Threads

Latest Posts

Latest Profile Posts

How many parameters is 'too many'??
Yay, now back in action Happy Christmas time, coming back!






Back in action to develop the indie game that has been long overdue... Final Fallacy. A game that keeps on giving! The development never ends as the developer thinks to be the smart cookie by coming back and beginning by saying... "Oh bother, this indie game has been long overdue..." How could one resist such? No-one c
So I was playing with filters and this looked interesting...

Versus the normal look...

Kind of gives a very different feel. :LZSexcite:
To whom ever person or persons who re-did the DS/DS+ asset packs for MV (as in, they are all 48x48, and not just x2 the pixel scale) .... THANK-YOU!!!!!!!!! XwwwwX

Forum statistics

Threads
105,847
Messages
1,016,968
Members
137,561
Latest member
JaCrispy85
Top