Common Serialization (Saving) Pitfalls

Ask for help about creating mods and scripts for Grimrock 2 or share your tips, scripts, tools and assets with other modders here. Warning: forum contains spoilers!
minmay
Posts: 2768
Joined: Mon Sep 23, 2013 2:24 am

Re: Common Serialization (Saving) Pitfalls

Post by minmay »

Yes. It would be quite difficult to use ScriptComponent usefully if functions could not be saved and loaded.
Grimrock 1 dungeon
Grimrock 2 resources
I no longer answer scripting questions in private messages. Please ask in a forum topic or this Discord server.
User avatar
AndakRainor
Posts: 674
Joined: Thu Nov 20, 2014 5:18 pm

Re: Common Serialization (Saving) Pitfalls

Post by AndakRainor »

Makes sens. I feared it could be somehow excluded from saved games and reloaded directly from the dat file (without overwriting other variables from the script... I have strange ideas sometimes).
User avatar
ratman
Posts: 158
Joined: Fri Jan 10, 2020 1:13 am

Re: Common Serialization (Saving) Pitfalls

Post by ratman »

I'm confused about the minimal savestate: if the rock item was minimal savestate, and I used this script:

Code: Select all

rock_1:setWorldPositionY(1)
outside of a function, wouldn't it set rock_1 at WorldPositionY 1 every time they load the game?
minmay
Posts: 2768
Joined: Mon Sep 23, 2013 2:24 am

Re: Common Serialization (Saving) Pitfalls

Post by minmay »

No.
Grimrock 1 dungeon
Grimrock 2 resources
I no longer answer scripting questions in private messages. Please ask in a forum topic or this Discord server.
Post Reply