Author Topic: Dedicated Saving bug? [Solved]  (Read 909 times)

Solved: Download this file for the fix http://forum.blockland.us/index.php?action=dlattach;topic=89661.0;attach=65667



I recently started using the auto saver mod, which works great but fails to save datablocks in event output parameters.For example if you have:
onActivate -> self -> Spawn Item -> [Gun]
...after you dedi-save and load that event will become...
onActivate -> self -> Spawn Item -> [Hammer]

Similar things happen with sound events (anything with a datablock in the output) as well. I don't have a clue what a blockland save file is supposed to look like, so many someone could lend a hand? The problem is probably in this part of the code:

Code: [Select]
for(%b=0;%b<%brick.numEvents;%b++)
{
%targetClass = %brick.eventTargetIdx[%b] >= 0 ? getWord(getField($InputEvent_TargetListfxDTSBrick_[%brick.eventInputIdx[%b]], %brick.eventTargetIdx[%b]), 1) : "fxDtsBrick";
%paramList = $OutputEvent_parameterList[%targetClass, %brick.eventOutputIdx[%b]];
%params = "";
for(%c=0;%c<4;%c++)
{
if(firstWord(getField(%paramList, %c)) $= "dataBlock" && %brick.eventOutputParameter[%b, %c + 1] >= 0)
%params = %params TAB %brick.eventOutputParameter[%b, %c + 1].uiName;
else
%params = %params TAB %brick.eventOutputParameter[%b, %c + 1];
}
%file.writeLine("+-EVENT" TAB %b TAB %brick.eventEnabled[%b] TAB %brick.eventInput[%b] TAB %brick.eventDelay[%b] TAB %brick.eventTarget[%b] TAB %brick.eventNT[%b] TAB %brick.eventOutput[%b] @ %params);
}

thanks for any help or information regarding event saving.
« Last Edit: November 15, 2009, 11:55:42 AM by [USSR] Diggy »

I think I updated that (and something else). Try this:

Hey, I tried that but noticed something, the following line already references datablock without the (extra) .getDataBlock(); part:

so this...
Code: [Select]
%params = %params TAB %brick.eventOutputParameter[%b, %c + 1].getDataBlock();should be..
Code: [Select]
%params = %params TAB %brick.eventOutputParameter[%b, %c + 1];
I've tested this fix and it works, although it says the save file has one more brick than it really does (no big deal). Anyways here is the common.cs, someone should update the downloads for auto-saver...

What a save file looks like.

Open it with notepad if your wondering lul.