Jump to content
Sign in to follow this  
barbolani

Mods ruining editor placed variables

Recommended Posts

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

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

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

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

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

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
Sign in to follow this  

×