OFPEC Forum

Editors Depot - Mission Editing and Scripting => ArmA - Editing/Scripting Multiplayer => Topic started by: laggy on 19 Jan 2009, 20:19:38

Title: Objects multiplying even though created with game logic [SOLVED]
Post by: laggy on 19 Jan 2009, 20:19:38
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
Title: Re: Objects multiplying even though created with game logic
Post by: Spooner 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"; };
Title: Re: Objects multiplying even though created with game logic
Post by: laggy 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