setVariable – Talk

From Bohemia Interactive Community
Jump to navigation Jump to search
mNo edit summary
No edit summary
Line 7: Line 7:


--[[User:Raedor|raedor]] 16:14, 19 July 2006 (CEST)
--[[User:Raedor|raedor]] 16:14, 19 July 2006 (CEST)
:: Ok, explicit synchronization would probably be best solution, both from scripting and bandwidth point of view. For purely AI or player-controlled objects this isn't much of a problem even if they cannot be synchronized because all objects are local for either server or client and scripts that are interested in such variables run mostly local to that vehicle. There are however some cases like pilot controlled jump lights in F-27 Fokker paratrooper plane in FDFMod, where pilot could enable red/yellow/green jump light, and other players in cargo would see appropriate jump light textures in cargo area via setObjectTexture. In OFP:R it would require fake animation and scripts that check status of that animation repeatedly, some way of making object variables global would make such cases a lot cleaner to implement (we never got it to work really right :). All it would need then is an EventHandler to catch when object variables are synced... --[[User:Feersum|Feersum]] 02:57, 20 July 2006 (CEST)


: It is local, and there is no automatic synchronization planned. The whole object synchronization on our engine should be viewed as unreliable and non-guaranteed, and synchronizing object variables this way would probably make a lot of confusion. I think we could add some explicit synchronization mechanism if desired, similar to publicVariable. --[[User:Suma|Suma]] 19:43, 19 July 2006 (CEST)
: It is local, and there is no automatic synchronization planned. The whole object synchronization on our engine should be viewed as unreliable and non-guaranteed, and synchronizing object variables this way would probably make a lot of confusion. I think we could add some explicit synchronization mechanism if desired, similar to publicVariable. --[[User:Suma|Suma]] 19:43, 19 July 2006 (CEST)

Revision as of 01:57, 20 July 2006

Is this variable space local or global in multiplayer environment? If it is local, is there any way to transmit it across to all client in MP environment?

--Feersum 16:11, 19 July 2006 (CEST)


From what I know it is local. Afaik there's no way to transmit it. But remember that this info may change, as ArmA is not yet done. Maybe we can get a statement of Suma here, he should know more...

--raedor 16:14, 19 July 2006 (CEST)

Ok, explicit synchronization would probably be best solution, both from scripting and bandwidth point of view. For purely AI or player-controlled objects this isn't much of a problem even if they cannot be synchronized because all objects are local for either server or client and scripts that are interested in such variables run mostly local to that vehicle. There are however some cases like pilot controlled jump lights in F-27 Fokker paratrooper plane in FDFMod, where pilot could enable red/yellow/green jump light, and other players in cargo would see appropriate jump light textures in cargo area via setObjectTexture. In OFP:R it would require fake animation and scripts that check status of that animation repeatedly, some way of making object variables global would make such cases a lot cleaner to implement (we never got it to work really right :). All it would need then is an EventHandler to catch when object variables are synced... --Feersum 02:57, 20 July 2006 (CEST)
It is local, and there is no automatic synchronization planned. The whole object synchronization on our engine should be viewed as unreliable and non-guaranteed, and synchronizing object variables this way would probably make a lot of confusion. I think we could add some explicit synchronization mechanism if desired, similar to publicVariable. --Suma 19:43, 19 July 2006 (CEST)

In my opinion, they should be by default global or there should be function to sync object local variables across all the clients or we will never get rid of ugly hack like defining "fake" animations to have per-object global numeric variables. Of course that could get very interesting if you transmit unit/vehicle/object references and they are still local for each client...

--Feersum 16:24, 19 July 2006 (CEST)

@MP behaviour: Same here :)

--raedor 16:44, 19 July 2006 (CEST)

I have to correct myself here. This command better stays local. setVehicleInit can be used for global execution of this command (this saves bandwidth performance when you don't want to have the variables public). --raedor 19:18, 19 July 2006 (CEST)


Is it a way to have local variable to an object, like a real Object Langage (C++, Java...) ? Example:

  Class Myclass
  {
     Attribute1 = ...
     Attirbute2 = ...
     Method1() {}
     Method2() {}
  }

I hope it is, allowed us to attach some special thing to an unique object on map, because the only solution we have today is boolean animation in p3d models.

Can you explain that BI and improve our dreams? :)

--SoldierIsNotHistory 16:49, 19 July 2006 (CEST)

I'm not BI, but with this command you can attach a certain variable with a certain value to a certain object. You can attach a variable with the same name to different objects and with different values. --raedor 19:18, 19 July 2006 (CEST)