Author Topic: 123 Commands  (Read 2281 times)

it looks like you might possibly (aside from the stuff headcrab mentioned)

hmm

yeah, are you actively planting the bricks from your brick cart, then testing the functions, or are you loading an existing save?

No, I'm always planting them. Just reminded me of the onLoadPlant function though. Need to add that to!
« Last Edit: October 25, 2013, 07:10:03 AM by xXDeadwolf456Xx »

Should it be %brick.trigger or %trigger.parent
Just change the %t.brick = %t; in the create trigger function to %t.parent = %t;

Hold up, putting this aside, what is wrong with this?

SERVER:
Code: [Select]
function serverCmdA(%client)
   {
      commandToClient(%client,'CreeRPG_getVariables',%client.curMoney);
   }

CLIENT:
Code: [Select]
function clientCmdCreeRPG_getVariables(%client)
   {
      curMoney2.setText(%client.curMoney);
   }

When I run the command it makes the curMoney2 textbox blank.

The server-side function passes %client.curMoney
But the client-side function accepts %client and tries to reference curMoney off the object.
So there's a mismatch of what the two functions are handling.
Change the client function argument to something like money, and change the setText argument in that function to the same name as you just changed the function argument to.


Also, you can't pass objects between client and server functions, the reciever will just get the number that the sender associates with that object, instead of the full object. I'm sure you were trying to do that, though

So should I do this instead?

SERVER:
Code: [Select]
function serverCmdA(%client)
   {
      %Gold = %client.curMoney;
      commandToClient(%client,'CreeRPG_getVariables',%Gold);
   }

CLIENT:
Code: [Select]
function clientCmdCreeRPG_getVariables(%client, %Gold)
   {
      curMoney2.setText(%Gold);
   }

There is no %client argument in a client command.  What would the server send there?  The client knows who he is, and there is only one server so there is no need for clarification in the function.

Other than that is it correct?

Other than that is it correct?

Assuming your variables and objects work, then yes.