Author Topic: Loading Events With Serverdirectsavefileload()  (Read 3638 times)

I'm back with yet another problem. I have made serverdirectsavefileload() load bricks on server creation, which apparently there were problems with before, by creating a brickgroup and assigning the $LoadingBricks_Brickgroup to it. Bricks are loaded, but events are not. I need events to load.

Here is the brickgroup I created:
Code: [Select]
       %bl_id = getNumKeyID();
        new simGroup("BrickGroup_NAMEHERE")
        {
            bl_id = %bl_id;
            name = "*******";
            client = 0;
        };

Here is a dump of serverdirectsavefileload() after bricks are loaded when my mod is disabled (just for reference):
Code: [Select]
Member Fields:
Tagged Fields:
  bl_id = "11902"
  client = "4582"
  name = "Greek2me"
  numPhysVehicles = "2"
  potentialTrust15042 = "2"
  potentialTrust17536 = "2"
  potentialTrust6930 = "2"
  potentialTrust7261 = "1"
  potentialTrust8002 = "2"
  potentialTrust9740 = "2"
  potentialTrustCount = "6"
  potentialTrustEntry0 = "6930"
  potentialTrustEntry1 = "8002"
  potentialTrustEntry2 = "7261"
  potentialTrustEntry3 = "9740"
  potentialTrustEntry4 = "15042"
  potentialTrustEntry5 = "17536"
  QuotaObject = "5220"
  spawnBrick0 = "5354"
  spawnBrick1 = "5432"
  spawnBrick10 = "6731"
  spawnBrick11 = "6775"
  spawnBrick12 = "6872"
  spawnBrick2 = "5772"
  spawnBrick3 = "5945"
  spawnBrick4 = "6035"
  spawnBrick5 = "6156"
  spawnBrick6 = "6329"
  spawnBrick7 = "6660"
  spawnBrick8 = "6677"
  spawnBrick9 = "6710"
  spawnBrickCount = "13"
  vargroup = "4787"
Methods:
  add() - set.add(obj1,...)
  addNTName() -
  addPotentialTrust() -
  addScheduledEvent() -
  addSpawnBrick() -
  bringToFront() - set.bringToFront(object)
  cancelEvents() -
  chainBlink() -
  chainDeleteAll() -
  clear() - set.clear()
  ClearAllNTNames() -
  clearEvents() -
  clearNTObjectName() -
  clientDeleteAll() - set.clientDeleteAll()
  delete() - obj.delete()
  deleteAll() - set.clientDeleteAll()
  dump() - obj.dump()
  dumpEvents() -
  DumpNTNames() -
  dumpSpawnPoints() -
  getBottom() -
  getBrickSpawnPoint() -
  getCanvasPosition() -
  getClassName() - obj.getClassName()
  getClient() -
  getCount() - set.getCount()
  getGroup() - obj.getGroup()
  getId() - obj.getId()
  getName() - obj.getName()
  getObject() - set.getObject(objIndex)
  getType() - obj.getType()
  hasUser() -
  isMember() - set.isMember(object)
  listObjects() - set.listObjects();
  ProcessInputEvent() -
  pushToBack() - set.pushToBack(object)
  remove() - set.remove(obj1,...)
  removeNTName() -
  removeSpawnBrick() -
  save() - obj.save(fileName, <selectedOnly>)
  schedule() - object.schedule(time, command, <arg1...argN>);
  serializeEvent() -
  serializeEventToString() -
  SetEventEnabled() -
  setName() - obj.setName(newName)
  setNTObjectName() -
  shift() -
  swap() -
  ToggleEventEnabled() -

My guess is that I am missing something in the brickgroup that allows events to load.
« Last Edit: October 19, 2010, 07:41:54 PM by Greek2me »

Why not just assign $LoadingBricks_Brickgroup to your brickgroup? :|

Why not just assign $LoadingBricks_Brickgroup to your brickgroup? :|
Dedicated server without requiring the host to be there to load.


You probably are already, but are you placing the brickgroup in the right simgroup?

I'm creating a new simgroup, I shouldn't have to place it in one, should I?

You might need to put it within the main brick group. By default, a simobject will be placed in missioncleanup, but all of the regular brickgroups are found in a simgroup within missioncleanup.

Put tree(); in the console while you are hosting, and check for yourself.

You might need to put it within the main brick group. By default, a simobject will be placed in missioncleanup, but all of the regular brickgroups are found in a simgroup within missioncleanup.

Put tree(); in the console while you are hosting, and check for yourself.
That's correct.

Code: [Select]
        %bl_id = getNumKeyID();
        MainBrickGroup.add(new simGroup("BrickGroup_NAMEHERE")
        {
            bl_id = %bl_id;
            name = "*******";
            client = 0;
        });

I already tried doing this:
Code: [Select]
        %bl_id = getNumKeyID();
        new simGroup("BrickGroup_NAMEHERE")
        {
            bl_id = %bl_id;
            client = 0;
            name = "******";
        };
        mainbrickgroup.add(Brickgroup_NAMEHERE);
Isn't that the same thing? In any case, I'll try that when I get a chance.

Events still do not load after trying that.

Try using the brickgroup created automatically, then selectively delete variables.

Do you mean with that list posted previously? It does not work with that either.

.save("base/brickgroup.txt"); the real brickgroup that's created by the game.

Create the fake group using the contents of brickgroup.txt.

See if that works.

It just spits out the host's brickgroup. I have all the elements in that brickgroup in my fake one. I'll try to change the client number from 0