Home   Help Search Login Register  

Author Topic: Objects multiplying even though created with game logic [SOLVED]  (Read 1412 times)

0 Members and 1 Guest are viewing this topic.

Offline laggy

  • Members
  • *
  • "Behold a pale horse"
Hi,

Game logics init:

myobj = "Land_majak_podesta" createVehicle getpos this

This object gets multiplied in MP (at least on dedicated server).
Why is that? Shouldn't this solution (game logic) assure that it's only created on the server.
Or is this a known bug?

Laggy
« Last Edit: 19 Jan 2009, 22:36:15 by laggy »
And I looked and beheld a pale horse and his name that sat on him was Death and Hell followed with him.

Offline Spooner

  • Members
  • *
  • Mostly useless
    • Community Base Addons
Re: Objects multiplying even though created with game logic
« Reply #1 on: 19 Jan 2009, 20:54:28 »
No, a gamelogic created from the editor is only guaranteed to be "local" to the server. It is still a global (network) object, so the code will be run once on every machine. Code like this should only be run on the server to ensure it only happens once.

Code: (run from any object init or in the init.sqf/init.sqs) [Select]
if (isServer) then { myobj = "Land_majak_podesta" createVehicle getpos this; publicVariable "myobj"; };
[Arma 2] CBA: Community Base Addons
[Arma 1] SPON Core (including links to my other scripts)

Offline laggy

  • Members
  • *
  • "Behold a pale horse"
Re: Objects multiplying even though created with game logic
« Reply #2 on: 19 Jan 2009, 21:30:45 »
Thanks,

It works perfect.
I allways thaught that game logics didn't even "exist" on clients machines.

Laggy

And I looked and beheld a pale horse and his name that sat on him was Death and Hell followed with him.