Post new topic    
Page «  1, 2
Liquid Metal Slime
Send private message
 
 PostSun Jun 14, 2020 8:12 pm
Send private message Reply with quote
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.
Ps. I love my wife
Slime Knight
Send private message
 
 PostMon Jun 15, 2020 5:40 am
Send private message Reply with quote
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:
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
Liquid Metal King Slime
Send private message
 
 PostMon Jun 15, 2020 12:04 pm
Send private message Reply with quote
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
Red Slime
Send private message
 
 PostMon Jun 15, 2020 6:37 pm
Send private message Reply with quote
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 Grin

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 Confused

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 )
Liquid Metal King Slime
Send private message
 
 PostMon Jun 15, 2020 7:42 pm
Send private message Reply with quote
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.
Liquid Metal Slime
Send private message
 
 PostMon Jun 15, 2020 10:04 pm
Send private message Reply with quote
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.
Ps. I love my wife
Liquid Metal King Slime
Send private message
 
 PostMon Jun 15, 2020 11:02 pm
Send private message Reply with quote
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
Metal King Slime
Send private message
 
 PostTue Jun 16, 2020 12:18 pm
Send private message Reply with quote
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?
Liquid Metal King Slime
Send private message
 
 PostTue Jun 16, 2020 2:10 pm
Send private message Reply with quote
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
Red Slime
Send private message
 
 PostTue Jun 16, 2020 3:41 pm
Send private message Reply with quote
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 globals 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 ;)
Display posts from previous:
Page «  1, 2