cruoriss 12 Posted May 26, 2015 (edited) Hey, I'm trying to dynamicly fill a listbox with multiple vehicles . So i used lbData to store the vehicle VarName to use it after : works fine in the editor but not at all on dedicated without even testing jip . Like in this thread : http://forums.bistudio.com/showthread.php?170867-lbData-gt-String-to-Object I use _obj = missionNamespace getVariable [_objString, objNull]; (tried call compile too) but both commands break the vehicle VarName on dedicated server . Here is the full code : _lbPos = lbCurSel 4603; _selectedMHQ = lbData [4603, _lbPos]; _MHQ = missionNamespace getVariable [_selectedMHQ, objNull]; systemChat format ["%1", _selectedMHQ]; systemChat format ["%1", _MHQ]; The first systemChat (direct lbData return in string) works perfectly but the other one breaks on dedicated server . And also both code used to create the dialog + vehicle : { if (//code) then { //lbAdd code and display name _varName = _x getVariable "AOW_MHQ_VARNAME"; _x setVehicleVarName _varName; lbSetData [4603, _index_mhq, _varName]; systemChat format ["%1", _varName]; systemChat format ["%1", _x]; // Both syst chat works well on dedicated }; } forEach vehicles; _vehMHQ = createVehicle [ASORVS_CurrentVehicle, ASORVS_VehicleSpawnPos, [], 0, "CAN_COLLIDE"]; _vehMHQ_var = [] call AOW_fnc_getFreeNames; // Used to generate a random name _vehMHQ setVehicleVarName _vehMHQ_var; _varName = vehicleVarName _vehMHQ; _vehMHQ setVariable ["AOW_MHQ_VARNAME", _varName, true]; Thanks EDIT : All this code is called client side Edited May 26, 2015 by Cruoriss Share this post Link to post Share on other sites
killzone_kid 1331 Posted May 26, 2015 // Both syst chat works well on dedicated Except it shouldn't work at all. Share this post Link to post Share on other sites
cruoriss 12 Posted May 26, 2015 Except it shouldn't work at all. Why ? Btw in my tests i had the whole thing working if I used a static name for the created vehicle that i "publicVariable'd" . But since i want to be able to create multiple vehicles it wasn't good . Share this post Link to post Share on other sites
das attorney 858 Posted May 26, 2015 He's saying there's noway systemChat will display as there is no display on a DS. (no UI). Share this post Link to post Share on other sites
cruoriss 12 Posted May 26, 2015 He's saying there's noway systemChat will display as there is no display on a DS. (no UI). I meant when playing on a dedicated server i can see the messages while being a client, the dialog insn't created directly on the server . Share this post Link to post Share on other sites
killzone_kid 1331 Posted May 26, 2015 I meant when playing on a dedicated server i can see the messages while being a client, the dialog insn't created directly on the server . Well it wasn't obvious from your post that this is what you meant. Are you creating vehicle in preinit? Share this post Link to post Share on other sites
cruoriss 12 Posted May 26, 2015 Well it wasn't obvious from your post that this is what you meant. Are you creating vehicle in preinit? My bad i should have said while playing on dedicated . No, they are created later using a vehicle spawner called by client . Share this post Link to post Share on other sites
fight9 14 Posted May 27, 2015 I like to use BIS_fnc_objectVar instead of setVehicleVarName (it does it for you). It has always worked for me when I require vehicles to have a name. It can accept a pre-made name or create one for you. It will then return that name in string format. Use call compile or getVar to access that vehicle. let function assign a name: _varName = _object call BIS_fnc_objectVar; _vic = call compile _varName; or assign the name yourself _varName = [_object,"TheName"] call BIS_fnc_objectVar; _vic = missionNamespace getVariable _varName; Share this post Link to post Share on other sites
cruoriss 12 Posted May 27, 2015 I like to use BIS_fnc_objectVar instead of setVehicleVarName (it does it for you). It has always worked for me when I require vehicles to have a name. It can accept a pre-made name or create one for you. It will then return that name in string format. Use call compile or getVar to access that vehicle.let function assign a name: _varName = _object call BIS_fnc_objectVar; _vic = call compile _varName; or assign the name yourself _varName = [_object,"TheName"] call BIS_fnc_objectVar; _vic = missionNamespace getVariable _varName; Damn, BIS_fnc_objectVar is my new best friend . It perfectly fix my dedicated environement issues and also works for jip . Thanks a lot (Btw i looked at what it was in the function viewer and i saw that it pubVar'd a local variable ... that was the part i was stuck at and thought it was impossible to do so, BIS black magic i guess) Share this post Link to post Share on other sites
Larrow 2822 Posted May 27, 2015 let function assign a name:Code: _varName = _object call BIS_fnc_objectVar; _vic = call compile _varName; or assign the name yourself Code: _varName = [_object,"TheName"] call BIS_fnc_objectVar; _vic = missionNamespace getVariable _varName; No need to call compile the var, it is a global var (missionNamespace) holding a reference to the object.So either _varName = _object call BIS_fnc_objectVar; myObject = missionNamespace getVariable _varName; OR _name = "MyObjectsName" _object setVehicleVarName _name; missionNamespace setVariable [ _name, _object ]; publicVariable _name; Share this post Link to post Share on other sites