SaveGame v. 0.6 - Page 5

SaveGame v. 0.6

Discuss Lua based Spring scripts (LuaUI widgets, mission scripts, gaia scripts, mod-rules scripts, scripted keybindings, etc...)

Moderator: Moderators

R-TEAM
Posts: 177
Joined: 22 Jan 2009, 19:25

Re: SaveGame v. 0.4

Post by R-TEAM »

Hi,
Argh wrote:Sorry, I haven't released that update yet.

Hold on, I'm still tracking the loading bug. It's something wrong with main.lua in the game, which is some ancient copy of CA's main instead of Spring's current. Cutting it out == most of the stuff working, leaving it == no reload. Pretty annoying, but that's curable.
he,he - i know - the mod is longer time not updatet ;)
But i will try to give him save/load .. other mods i will convert (from tdf to lua and then insert save/load) :
arachnomania 0.8f
ESO 0.53
EvolutionRTS 1.09
EE 0.46
MetropolisSpring 0.15
Micro Modules 1.08
SimBase a25.1E4
SmallMod 0.867

;)
User avatar
Argh
Posts: 10920
Joined: 21 Feb 2005, 03:38

Re: SaveGame v. 0.4

Post by Argh »

OK, I've figured out what's wrong.

I need to a few more tests, but I think I'm pretty close to resolving the problems. I need to do a few more checks to be sure, though, so please be patient.
User avatar
Argh
Posts: 10920
Joined: 21 Feb 2005, 03:38

Re: SaveGame v. 0.4

Post by Argh »

OK, here's version 0.5- this seems to resolve the problems with old mods that use variant structures for some of the Lua base files, and fixes a couple of deeper issues with GG save-states that weren't exposed earlier.

This should also hopefully mean it gets along with CA / BA and the other games using CA base files as well (yay!).

Seems to operate well with REVELATION; please let me know if this resolves the bugs for you.
Attachments
SAVEGAMES.sdd.zip
(382.13 KiB) Downloaded 24 times
User avatar
aegis
Posts: 2456
Joined: 11 Jul 2007, 17:47

Re: SaveGame v. 0.5

Post by aegis »

you realize {} probably isn't the same as nil... and what was wrong with tostring()? that fixed nil string concat issues for me...

and replacing functions with nils doesn't sound like an awesome way to preserve state either <_<
User avatar
Argh
Posts: 10920
Joined: 21 Feb 2005, 03:38

Re: SaveGame v. 0.5

Post by Argh »

1. The tostring doesn't work with [1], basically.

2. Functions aren't causing problems, per se; it's when they're supposed to return something and the result is nil that it's a mess. That breaks the entire Gadget right there and then.

I think that storing a function call in GG is just plain bad design anyhow, and I'm not sure if there is any way to fix that issue.

3. It's obviously not the only problem with GG atm; the other one is unitIDs, and code that expects them to be valid.

I'm "looking forward" to preparing my Squad code to be save-friendly, for example :P
R-TEAM
Posts: 177
Joined: 22 Jan 2009, 19:25

Re: SaveGame v. 0.5

Post by R-TEAM »

Hi,

save now "work" (doing a save ..)
But load still not work, only partialy.
Infolog:
[ 0] invalid added point: Start 2
[ 0] invalid added point: Start 0
[ 0] invalid added point: Start 1
[ 0] <SkirmishAI: AAI 0.9 (team 0)>: water map detected
[ 0] <SkirmishAI: AAI 0.9 (team 0)>: AAI loaded
[ 1] <SkirmishAI: AAI 0.9 (team 0)>: ressurected
[ 1] <SkirmishAI: AAI 0.9 (team 0)>: ressurected
[ 1] <SkirmishAI: AAI 0.9 (team 0)>: ressurected
[ 1] <SkirmishAI: AAI 0.9 (team 0)>: ressurected
[ 1] <SkirmishAI: AAI 0.9 (team 0)>: ressurected
[ 1] LuaRules::RunCallIn: error = 2, GameFrame, [string "savegame1.lua"]:1120: attempt to call field '?' (a nil value)
stack traceback:
[string "savegame1.lua"]:1120: in function 'GameFrame'
[string "LuaRules/gadgets.lua"]:920: in function <[string "LuaRules/gadgets.lua"]:918>
(tail call): ?
[ 31] Skirmish AI "Bot1" took over control of team 0
[ 62] Skirmish AI "Bot2" took over control of team 1
User avatar
Argh
Posts: 10920
Joined: 21 Feb 2005, 03:38

Re: SaveGame v. 0.5

Post by Argh »

What does "partially" mean?

I mean, with AAI, I would be quite surprised if Spring didn't just crash outright.
R-TEAM
Posts: 177
Joined: 22 Jan 2009, 19:25

Re: SaveGame v. 0.5

Post by R-TEAM »

Hi,

yes - this was with AAI .. so it is not supportet ?
And partialy:
Only ~30% of my units/buildings was here.
Mostly on wrong positions and the half with wrong health
status.
User avatar
Argh
Posts: 10920
Joined: 21 Feb 2005, 03:38

Re: SaveGame v. 0.5

Post by Argh »

yes - this was with AAI .. so it is not supportet ?
It's up to AI developers to make sure their code can handle save states.

There's very little we can do about that from the Lua end of things.
And partialy:
Only ~30% of my units/buildings was here.
Mostly on wrong positions and the half with wrong health
status.
That must be related to whatever that message was:
LuaRules::RunCallIn: error = 2, GameFrame, [string "savegame1.lua"]:1120: attempt to call field '?' (a nil value)
stack traceback:
[string "savegame1.lua"]:1120: in function 'GameFrame'
[string "LuaRules/gadgets.lua"]:920: in function <[string "LuaRules/gadgets.lua"]:918>
But I need the savegame file to know why it stopped there.
R-TEAM
Posts: 177
Joined: 22 Jan 2009, 19:25

Re: SaveGame v. 0.5

Post by R-TEAM »

Hi,

have now testet with 2 RAI, the same result , infolog:
[ 1] LuaRules::RunCallIn: error = 2, GameFrame, [string "savegame1.lua"]:1261: attempt to call field '?' (a nil value)
stack traceback:
[string "savegame1.lua"]:1261: in function 'GameFrame'
[string "LuaRules/gadgets.lua"]:920: in function <[string "LuaRules/gadgets.lua"]:918>
(tail call): ?

Savegame File:
Attachments
savegame1.lua
(56.2 KiB) Downloaded 108 times
User avatar
Argh
Posts: 10920
Joined: 21 Feb 2005, 03:38

Re: SaveGame v. 0.5

Post by Argh »

OK, seems that Spring.AddBuildOrders no longer exists :P I'll get that fixed for the next version, no problem.

So... here... does this savegame run all right?
Attachments
savegame1.lua
(56.21 KiB) Downloaded 104 times
User avatar
Argh
Posts: 10920
Joined: 21 Feb 2005, 03:38

Re: SaveGame v. 0.5

Post by Argh »

And here's a fix for writesave- should fix that issue for now, so that Factory queues get restored correctly...
Attachments
WriteSave.lua
(14.38 KiB) Downloaded 106 times
R-TEAM
Posts: 177
Joined: 22 Jan 2009, 19:25

Re: SaveGame v. 0.5

Post by R-TEAM »

Hi,

yes - the postet savegame loads flawles, except that the Vehicle-lab
was under build and now it is ready but have not full HP.

Will test the new writesave.lua ....
User avatar
Argh
Posts: 10920
Joined: 21 Feb 2005, 03:38

Re: SaveGame v. 0.5

Post by Argh »

yes - the postet savegame loads flawles, except that the Vehicle-lab
was under build and now it is ready but have not full HP.
Well, that's a problem- I'll look at the build issue. IIRC, didn't somebody say we weren't allowed to set it backwards? I thought that got fixed...

Ah, duh... I needed to set "build" to "true" in CreateUnit(). Here's another fix for that issue... should set Units that aren't built all the way to the correct status.

Still working on GG issues- the squad system in P.U.R.E. is proving to be a pretty good proving-ground for what will have to get done, and thus far it's a bit obnoxious but mainly I think it's just that I'm tired and need to get some sleep now :P
Attachments
WriteSave.lua
(14.57 KiB) Downloaded 107 times
R-TEAM
Posts: 177
Joined: 22 Jan 2009, 19:25

Re: SaveGame v. 0.5

Post by R-TEAM »

Hi,

have nice sleep ;)
and -> the new file stop save working :\
By clicking of save -> nothing happen ..
User avatar
Argh
Posts: 10920
Joined: 21 Feb 2005, 03:38

Re: SaveGame v. 0.5

Post by Argh »

:oops: Fixed. Off to bed now.
Attachments
WriteSave.lua
(14.57 KiB) Downloaded 106 times
Tobi
Spring Developer
Posts: 4598
Joined: 01 Jun 2005, 11:36

Re: SaveGame v. 0.5

Post by Tobi »

Argh wrote:I think that storing a function call in GG is just plain bad design anyhow, and I'm not sure if there is any way to fix that issue.
Where do you put them?
3. It's obviously not the only problem with GG atm; the other one is unitIDs, and code that expects them to be valid.

I'm "looking forward" to preparing my Squad code to be save-friendly, for example :P
Why not just offer each gadget a way to save some of the data it needs and a way to load it, and let the gadget handle what it needs to save from GG, and how it should restore it?
R-TEAM
Posts: 177
Joined: 22 Jan 2009, 19:25

Re: SaveGame v. 0.5

Post by R-TEAM »

Hi,
Argh wrote::oops: Fixed. Off to bed now.
sorry - Nope - Still doing nothing - no save ...
User avatar
Argh
Posts: 10920
Joined: 21 Feb 2005, 03:38

Re: SaveGame v. 0.5

Post by Argh »

Sorry, there must still be another bug, nothing like coding when I'm sleep-deprived 8) I'll take another look in a little while.
User avatar
Argh
Posts: 10920
Joined: 21 Feb 2005, 03:38

Re: SaveGame v. 0.5

Post by Argh »

Nevermind, that was a 30-second problem... sleep is good.
Attachments
WriteSave.lua
(14.58 KiB) Downloaded 106 times
Post Reply

Return to “Lua Scripts”