Hi,
I have script some code for the use of dialogs with an addon, it was hard and I have found some tips:
- The event init call in config.cpp is only on server side. (not test on a stand alone server, only hosting)
- If you want initialize a variable you do like this :
If (format ["%1", MyArray ] == "scalar bool array string 0xfcffffef") then { MyArray = [] }
- You can build array with public variables like this:
For build it in server or client
If (format ["%1", MyArray ] == "scalar bool array string 0xfcffffef") then { MyArray = [] }
_obj = _this select 0
MyArray = MyArray + [_obj ]
_ID = (count MyArray) - 1
PubArrayIndex = count MyArray ;publicvariable "PubArrayIndex"
Call format [ "PubArray%1 = _objDrone ; publicvariable {PubArray%1}",_ID ]
And use it in a client or server
MyArray = []
_i = 0
#BuildArray
_Temp = Call format [ "PubArray%1",_i ]
MyArray = MyArray + [_Temp ]
If (_i < PubArrayIndex - 1 ) then {_i = _i +1 ; goto "buildArray"}
This sample is for init, if you want a real time update array you add a public variable update and you manage the array in loops for looking changes in the array, if yes set the update boolean to true and start a build array sequence.
With this 2 tips you can know how many of specific addons are on the map, and manage them.
- You can use event for starting a script, some events are executed on all computers (obj setdammage 0.001 start the script)
Hope this help someone