Load From Slot exits script?

Ask and answer questions about making games and related topics. Unrelated topics go in that other forum.

Moderators: marionline, SDHawk

Post Reply
User avatar
kylekrack
Liquid Metal Slime
Posts: 1242
Joined: Mon Jun 16, 2014 8:58 am
Location: USA
Contact:

Load From Slot exits script?

Post by kylekrack »

I don't have a manual save feature and instead autosave on each map's autorun script. I also skip the load screen when the game opens up, so I have a conditional in the new game script to load from slot 1 if there is a save file there. When it does load, though, it loads the game up but ignores all other commands after that (a show value(0) command is in there to be sure).

Code: Select all

plotscript, new game, begin

	if(save slot used(1)) then(
		load from slot(1)
		show value(0)
		fade screen out
		suspend player
		initialize stuff
		fade screen in
		teleport to map(1,7,4)
		wait(1)
		fade screen in
		resume player
		exit script
	)
	suspend player
	opening words
	initialize stuff

	wait(4)
	resume player
end
Does load from slot(slot) exit the script it's in or do I need to order things differently?
My pronouns are they/them
Ps. I love my wife
User avatar
Bob the Hamster
Lord of the Slimes
Posts: 7660
Joined: Tue Oct 16, 2007 2:34 pm
Location: Hamster Republic (Ontario Enclave)
Contact:

Post by Bob the Hamster »

You are correct!

load from slot kills all running scripts when it loads.

To make things happen right after a load, you have to put them in your "load game" script instead.
User avatar
kylekrack
Liquid Metal Slime
Posts: 1242
Joined: Mon Jun 16, 2014 8:58 am
Location: USA
Contact:

Post by kylekrack »

Oh.... Duh. The dictionary doesn't say that explicitly. It might be a good thing to add, if anyone has the time.
My pronouns are they/them
Ps. I love my wife
TMC
Metal King Slime
Posts: 4308
Joined: Sun Apr 10, 2011 9:19 am

Post by TMC »

Went ahead and improved some of the docs.
User avatar
Spoonweaver
Liquid Metal King Slime
Posts: 6466
Joined: Mon Dec 08, 2008 7:07 am
Contact:

Post by Spoonweaver »

Would it be impossible to not kill scripts when you load a game?
TMC
Metal King Slime
Posts: 4308
Joined: Sun Apr 10, 2011 9:19 am

Post by TMC »

With the current script interpreter it should be pretty trivial to not kill the scripts. But with the new interpreter it'll be more complex, because it'll be aware of every slice handle, npc reference, etc, and those all need to be invalidated. Still, shouldn't be too big a task.

I guess not killing all scripts could be useful, but is it really more than just a small convenience?
User avatar
Spoonweaver
Liquid Metal King Slime
Posts: 6466
Joined: Mon Dec 08, 2008 7:07 am
Contact:

Post by Spoonweaver »

Ah, well the new interpreter sounds better than simply being able to not kill scripts. I'll try to think of something else for next HotOhr's feature request.
;D
Last edited by Spoonweaver on Sun Aug 16, 2015 4:25 pm, edited 1 time in total.
Post Reply