barbolani 198 Posted December 30, 2015 Hi! I have a very weird bug report from a player which we know is caused by one of those: CBA,RHS, ACE or TFAR. But the weird thing is not whatever those mods are doing. I'll explain: I have an editor placed unit which is the "Default Commander" of the mission. It has on it's init an assigned variable: "comandante" Ok, initServer.sqf waits for all the players to connect and after that, checks if someone has picked the default commander and if not, selects a random player as commander. It's something like: If (isNil "comandante") then {comandante = (playableUnits select 0)}; if (isNull comandante) then {comandante = (playableUnits select 0)}; Ok, here is the funny thing in .rpt: 1:07:17 Error position: <comandante) then {comandante = (playable> 1:07:17 Error Undefined variable in expression: comandante Ok, so I "bulletproofed" that variable and I have an undefined variable error? WTF??? I know the isNull part is useless but I putted it just in case. And the other funny thing, remember, when the player starts on vanilla, no error... Share this post Link to post Share on other sites
donelsarjo 60 Posted December 30, 2015 in singleplayer playableunits = []; use switchable units in multiplayer playableunits = [ unit_1 , unit_2 etc] and switchableunits = []; just use unitlist = playableunits + switchableunits Share this post Link to post Share on other sites
killzone_kid 1333 Posted December 30, 2015 playable units is empty if no player spawned, and so [] select 0 is nil Share this post Link to post Share on other sites
barbolani 198 Posted December 30, 2015 Oh no friends, the script is initServer.sqf, and of course the player with the issue is having it in MP And, as I said, all this is after some waitUntil which checks all the non-jip players are in. More specific: waitUntil {({(isPlayer _x) and (!isNull _x) and (_x == _x)} count allUnits) == (count playableUnits)}; Don't know if that's the best way, but worked for ages.... And, remember, removing the mods removes the problem!!!!! Share this post Link to post Share on other sites
davidoss 552 Posted December 30, 2015 I some time ago got similar problem too. It was the mod ALiVE causing it. http://alivemod.com/forum/1416-vehiclevarname You can easily debug what is going wrong by aiming at that unit and typing in debug console direct debug field : cursorTarget. This will give you current unit "editor" name. Maybe this can help you figure this out. Share this post Link to post Share on other sites
barbolani 198 Posted December 30, 2015 Well, if those mods are ruining editor placed variables I think authors should spend some time on hollydays... But anyway I'm more interested on the solution. So the question still is, if some variable has been niled, no matter why and how, and then I have this: If (isNil "comandante") then {comandante = (playableUnits select 0)}; That variable should have been bulletproofed against anything, isn't it??? And please count it worked in the past, and indeed works for other players which just have nil'ed that variable because they just don't pick that slot. Share this post Link to post Share on other sites