Author Topic: Packaging gameConnection::createPlayer(%this) always makes you spawn way up  (Read 555 times)

Try it.
Package it, add some small code
no matter waht I do
i do
functionbalhja
%parent = parent;:;asdlkfa
jasfjasfa();
return %parent;

and it still gives me stuff.

What does your code look like?

What does your code look like?
   function gameConnection::createPlayer(%client)
   {
      %r = parent::createPlayer(%client);

      if(isObject(%save = CTSSave))
      {
         if(%save.data[%client,"Level"] $= "")
         {
            %save.data[%client.bl_id,"Level"] = 1;
            %save.data[%client.bl_id,"item0"] = "Sword";
            %save.data[%client.bl_id,"item1"] = -1;
            %save.data[%client.bl_id,"item2"] = -1;
            %save.data[%client.bl_id,"item3"] = -1;
            %save.data[%client.bl_id,"item4"] = -1;
         }
         %client.player.getItems();
      }
      if(!isEventPending(%client.bottomPrintLoop))
         %client.craftingBottomPrint();
      return %r;
   }

Why not package gameConnection::spawnPlayer and load the data if the %client.hasspawnedonce (i think thats the variable name) is false?

Pretty sure createPlayer has multiple parameters. Not sure what they are, however. I believe position is one though. GameConnection::spawnPlayer only has the one object variable though, to my knowledge.

edit:
gameConnection::createPlayer(%this, %spawnPoint)

gameConnection::createPlayer(%this, %spawnPoint)
This is correct.

Pretty sure createPlayer has multiple parameters. Not sure what they are, however. I believe position is one though. GameConnection::spawnPlayer only has the one object variable though, to my knowledge.

edit:
gameConnection::createPlayer(%this, %spawnPoint)

Yeah, the only parameter is the transform to spawn the player at. It's typically the result of pickSpawnPoint().