Layered Walkabout / Visible Equippment / Could use a hand

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

Moderators: marionline, SDHawk

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

Post by kylekrack »

DWRL wrote: Update,
I had problems with loading save states, I guess my grasp of what the OHR does and doesn't isn't as firm as it could be.
(Seems the globals stored the slice handles just fine, only the slices themselves were quite nonexistent after saving and loading the game... XD)
There is a bitset to save script-generated slices. I believe it's in General Game Settings > Saved Game Settings. The other route is to have a load-game script that re-generates all of the necessary slices based on globals, etc.
My pronouns are they/them
Ps. I love my wife
User avatar
Bird
Slime Knight
Posts: 227
Joined: Thu Jan 26, 2012 2:19 pm
Location: Germany

Post by Bird »

Also try out a menu on-close script (you find that under "Edit Menus", then the second to last entry). Or use the plotscript command "run script by ID (@Update Doll)". That let's you call a plotscript directly from another script wherever you want. Or you use a script instead of a plotscript, which let's you use this list of commands which are bundled in the script, elsewhere too.

Code: Select all

script,update routines,begin
 ...check equipment...
 ...change character look...
end

plotscript,find self-attachable armor,begin
 ...find object, have a speech over it, etc...
 update routines # Calls the script
end

plotscript,close menu,begin
 update routines
end

plotscript,equip menu,begin
 ...equip menu scripts...
 update routines
end
User avatar
Spoonweaver
Liquid Metal King Slime
Posts: 6462
Joined: Mon Dec 08, 2008 7:07 am
Contact:

Post by Spoonweaver »

DWRL wrote:
Spoonweaver wrote:Why does your script convert indvidual choices into 1 variable and then convert them back again?
why not just have the editor or equip screen set pGender pHairstyle pHaircolor pSkintone and pClothes seperately and leave them seperate in stead of smashing them into PlayerSettings?
Am I missing something?
This way it can all be stored in one global variable.
Yea no I see that
but why is that a good thing?
I can't imagine the need to use less memory to that degree
and I can't think of a single thing you can do with that combine global variable that you wouldn't be better off using the collection of globals for
User avatar
DWRL
Red Slime
Posts: 35
Joined: Wed Jan 15, 2020 2:26 am
Location: Germany
Contact:

Post by DWRL »

kylekrack wrote:There is a bitset to save script-generated slices. (...) The other route is to have a load-game script that re-generates all of the necessary slices based on globals, etc.
Well, I went the latter route, but it sounds like I could have saved me some coding there XP
Thank you, this will make it far easier :D
Bird wrote:Also try out a menu on-close script (you find that under "Edit Menus", then the second to last entry). Or use the plotscript command "run script by ID (@Update Doll)". That let's you call a plotscript directly from another script wherever you want. Or you use a script instead of a plotscript, which let's you use this list of commands which are bundled in the script, elsewhere too.
Hm, I don't plan on using the menus from the OHR, but if I understand correctly, you suggest having a script running just before quiting, 'cleaning house' and prepare everything for the next loading?
On the last sentence you lost me, sorry. What am I missing :???:
Spoonweaver wrote:Yea no I see that
but why is that a good thing?
I can't imagine the need to use less memory to that degree
and I can't think of a single thing you can do with that combine global variable that you wouldn't be better off using the collection of globals for
Functionally, the only difference would be the abillity to store far more data if needed, but I guess here it is mostly preference.
Having related data in one global seems more tidy, and somewhat more logical to me since it is all in one place, and one can move related data together with less code in the long run.
This becomes mostly beneficial with scale, for 20 characters I need only 20 globals instead of 120, which I feel decreases code complexity and thus makes the code more robust.
For one character this would be overkill of course XD

The memory usage actually increases a bit, I think, since once you unpack the values you need local variables to temporarily store and actually use them, and the decoding takes cpu time too.

(Edit: On an unrelated note, might I just mentioned how... weird, but strangely satisfying it is to get experience points and money for posting? :v: )
Last edited by DWRL on Mon Jun 15, 2020 6:39 pm, edited 1 time in total.
User avatar
Spoonweaver
Liquid Metal King Slime
Posts: 6462
Joined: Mon Dec 08, 2008 7:07 am
Contact:

Post by Spoonweaver »

Ah, if you are doing this for multiple characters it does make more sense to me.

And yea the leveling system on slime salad is pretty funny. You get strength for posting games.
User avatar
kylekrack
Liquid Metal Slime
Posts: 1240
Joined: Mon Jun 16, 2014 8:58 am
Location: USA
Contact:

Post by kylekrack »

I gotta start spamming (even more) terrible, half-baked games onto the games list for them GAINZ. Gotta get SWOLE.

Edit: I was confused about the single variable thing, too. But that clears it up a bit. I would have gone the route of saving the data in slices, but I know a lot of people aren't a fan of doing that.
Last edited by kylekrack on Mon Jun 15, 2020 10:05 pm, edited 1 time in total.
My pronouns are they/them
Ps. I love my wife
User avatar
Spoonweaver
Liquid Metal King Slime
Posts: 6462
Joined: Mon Dec 08, 2008 7:07 am
Contact:

Post by Spoonweaver »

I would and DO just save it all in hundreds of variables.

Oh and good luck with that strength training
You'll never beat Bob or me in stats
TMC
Metal King Slime
Posts: 4308
Joined: Sun Apr 10, 2011 9:19 am

Post by TMC »

The memory and cpu costs are extremely far from being significant, and anyway packing them all into one variable actually requires more processing (it trades memory for time).
kylekrack wrote:
DWRL wrote: Update,
I had problems with loading save states, I guess my grasp of what the OHR does and doesn't isn't as firm as it could be.
(Seems the globals stored the slice handles just fine, only the slices themselves were quite nonexistent after saving and loading the game... XD)
There is a bitset to save script-generated slices. I believe it's in General Game Settings > Saved Game Settings.
The setting in the Saved Games menu to save slices only saves slices parented to the script player. Hero slices (and slices parented to them) will not bve saved, but that is actually something I want to implement, and I might as well do it now, since it's a natural extension of the hero slice stuff I just did recently.
Bird wrote:How was it with strings, that can be stored after the game was quit? They needed to be exported to a file, right? Someone did this somewhere...
Also, in the same menu is a setting to save strings in saved games.
Bird wrote:Or use the plotscript command "run script by ID (@Update Doll)". That let's you call a plotscript directly from another script wherever you want.
Instead of writing "Update Doll" to call the script?
Last edited by TMC on Tue Jun 16, 2020 12:19 pm, edited 1 time in total.
User avatar
Spoonweaver
Liquid Metal King Slime
Posts: 6462
Joined: Mon Dec 08, 2008 7:07 am
Contact:

Post by Spoonweaver »

simple solution to all plotscripting issues caused by saving your game
save the current map, and the x and y axis cords to globals and then teleport the player to a blank saving map during the saving process using a custom scripted menu.
Or make saving points that exist in small sectioned off maps with little to no scripting
User avatar
DWRL
Red Slime
Posts: 35
Joined: Wed Jan 15, 2020 2:26 am
Location: Germany
Contact:

Post by DWRL »

kylekrack wrote:(...) I would have gone the route of saving the data in slices, but I know a lot of people aren't a fan of doing that.
I am a bit cautious about that, since I a) don't fully understand slices to this depth and b) my slices didn't persist between saving/loading.
But if I get this right, you:
- put your data into the extradata slot
- chain the slice to the script layer (as per TMC remark)
- leave it without graphics

and I can use it and the slice structures to save (and structure/nest) my data?

TMC wrote:Hero slices (and slices parented to them) will not bve saved
Could I just reparent them before saving to the script layer, and reverse this after loading?
(And does it even make any sense effort wise compared to just loading them again...?)
TMC wrote:Also, in the same menu is a setting to save strings in saved games.
Good to know, thank you. Might there be any way to read them from the save slot, like import [s]globals[/s] strings (slot)?
Spoonweaver wrote:save the current map, (...) teleport the player to a blank saving map [with with little to no scripting] during the saving process using a custom scripted menu.
And thus my next headache disappeared, thank you ;)
Post Reply