Author Topic: Bricks Not Loading Correctly (resolved)  (Read 758 times)

I'm trying to load a save file using this:
Code: [Select]
serverDirectSaveFileLoad("saves/Pyramid.bls", 3, "", 0);
Bricks stop appearing after the first couple bricks, even though the server is still "loading" them. It even says that it has loaded 14871/14871 bricks.

However, the brickcount is listed as -42616. (Negative!) This also appears repeatedly in console:
Quote
Set::add: Object "0" doesn't exist

base/server/scripts/allGameScripts.cs (3030): Unable to find object: '0' attempting to call function 'setTransform'
BackTrace: ->ServerLoadSaveFile_Tick


base/server/scripts/allGameScripts.cs (3031): Unable to find object: '0' attempting to call function 'trustCheckFinished'
BackTrace: ->ServerLoadSaveFile_Tick


base/server/scripts/allGameScripts.cs (3034): Unable to find object: '0' attempting to call function 'plant'
BackTrace: ->ServerLoadSaveFile_Tick


base/server/scripts/allGameScripts.cs (3055): Unable to find object: '0' attempting to call function 'setRayCasting'
BackTrace: ->ServerLoadSaveFile_Tick


base/server/scripts/allGameScripts.cs (3057): Unable to find object: '0' attempting to call function 'setColliding'
BackTrace: ->ServerLoadSaveFile_Tick


base/server/scripts/allGameScripts.cs (3059): Unable to find object: '0' attempting to call function 'setRendering'
BackTrace: ->ServerLoadSaveFile_Tick

It looks like the bricks aren't being created because of a quota or something. Any ideas?

Also, placing the code directly into the console works fine. Executing it through my function does not.
« Last Edit: February 09, 2014, 11:33:18 PM by Greek2me »

Also, placing the code directly into the console works fine. Executing it through my function does not.
well post the function

i don't know what good it will do, but if it's working without the function, and not working with it, we should have the function as reference

It's an event.

Code: [Select]
function ServerEventTargetSO::loadSaveFile(%this, %fileName, %ownership, %loadOffset)
{
%fileName = trim(%fileName);
if(%fileName $= "")
return;
if(striPos(%fileName, ".bls") == -1)
%fileName = %fileName @ ".bls";
if(striPos(%fileName, "/") == -1)
%fileName = "saves/" @ %fileName;
if(!isFile(%fileName))
return;

$loadOffset = %loadOffset;

serverDirectSaveFileLoad(%fileName, 3, "", %ownership);
}
registerOutputEvent(ServerEventTargetSO, "loadSaveFile", "string 200 176" TAB "list Host 0 SavedOwner 1 Public 2" TAB "vector", 0);

Echoes show that all of the values are set correctly. Is there a function I'm supposed to call before serverDirectSaveFileLoad?


I know about those variables but we shouldn't have to use them anymore.

According to Rotondo's game mode reference, we can just use serverDirectSaveFileLoad. It actually does load some bricks, but stops after the first hundred or so. (possibly after the first loading tick)

...Oh, it's called as an event, so it hits the object cap for events. That's probably what's happening.

...Oh, it's called as an event, so it hits the object cap for events. That's probably what's happening.

There's a quota for objects created by events?

Resolved! I called clearCurrentQuotaObject() before calling serverDirectSaveFileLoad. I'm not sure yet if this will create any problems.

solution:
Code: [Select]
%quotaObj = getCurrentQuotaObject();
clearCurrentQuotaObject();

serverDirectSaveFileLoad(%fileName, 3, "", %ownership);

setCurrentQuotaObject(%quotaObj);
« Last Edit: February 09, 2014, 11:36:24 PM by Greek2me »