Jump to content
  • 0

Is 1.0.5.1 more strict now ? when it comes to 'Undefined variable in expression' ?


Sandbird

Question

I am converting my old 1.0.4.2 script to the 1.0.5.1 version and i keep getting my client log spammed with messages like:

  Error position: <s_vehicle_unlock;
player_curre>
  Error Undefined variable in expression: s_vehicle_unlock
File mpmissions\__CUR_MP.Tavi\addons\specials.sqf, line 64

All i got in that line is:

player_Vehicle removeAction s_vehicle_unlock;

This is a variable inside a while loop that guarantees to remove an addaction from the player's options....because sometimes players turn too fast or something and some addactions are getting stuck in their GUI.

 

This worked fine before...and its not the first Undefined variable in expression i see...i keep getting errors like this when i 'remove' addactions or even when i am calling methods inside my code when the method is bellow the executing code.

Example as an algorithm:

private ["_blah","_myvalue"];


1. [_blah] call my_custom_funtion;
2.  if (_myvalue == "5") {
3.  ...do stuff then
4.  };
....
....
77.  my_custom_funtion = {
        .....
99.     _myvalue = "5"; 
100. };

Like this, i would get 100% a undefined variable in expression on for the _myvalue on line 2, although i am calling my_custom_function every time and with proper data.

The same code was working fine in 1.0.4.2...

 

 

 

Link to comment
Share on other sites

Recommended Posts

  • 0

Well to be honest this whole thing could fail if it goes inside the if...and not the else, true jahangir.

 

The proper way to do this Rythron is to overwrite the variables.sqf file (if you havent done it already in your init.sqf)

 

And in there set all these variables you find from removeAction to an initial value of -1. In your case :

dayz_addsirens = objNull;
s_player_sirens_on = -1;
s_player_sirens_off = -1;

I dont know if you are initializing dayz_addsirens....thats why i did that as well.

 

Ok add them to the variables and see what happens ..

Did not had them there..   :rolleyes:

thx

Link to comment
Share on other sites

  • 0

yeah pretty much you got the same problem...You see with this latest arma patch the fracked up pretty good...for example in your case....you see this ?

} else {
    dayz_addsirens removeAction s_player_sirens_on;
    dayz_addsirens removeAction s_player_sirens_off;
    s_player_sirens_on = -1;
    s_player_sirens_off = -1;
};

you first say remoteaction s_player_sirens_on  but the engine doesnt know wtf is that value...is it a number ? is it an array ? what it is ?

but you bellow you declare it.....s_player_sirens_on is a number and its -1.

So doing that first then it would not give you an error anymore.....so you have to rewrite you else like this:

} else {
    s_player_sirens_on = -1;
    s_player_sirens_off = -1;
    dayz_addsirens removeAction s_player_sirens_on;
    dayz_addsirens removeAction s_player_sirens_off;
};

And this has to happen for tons of other variables..... :/

Yeah i understand what you mean ..  It is reading it wrong ... 

Link to comment
Share on other sites

  • 0

@Sandbird: did that work yesterday with that = objNull I've found somewhere? (to initialize your dialog var)

 

nope :/ still get that error

 

I didnt fix it :P

It only comes out when the dogs are looking for zombies to kill.

 

but if i rememeber correctly just initialize _target

Link to comment
Share on other sites

  • 0

Good, will also do this.

I am wondering, and encountered that already months ago...that if there is an error somwewhere, other errors are not far.

What I mean: if there are errors nobody else has (and I guess they would hopefully not release a new Epoch version if there are errors like in zombie_agent.sqf in there) there must be something else wrong and there are maybe subsequent faults from something else.

 

So I need to check why I get this error now and did not get this the last days. Really, I hate this language/interpreter. I have not a fraction of the trouble with any other scripting language whatever that is ;)

Link to comment
Share on other sites

  • 0

Sorry if it's alreaddy set ( Did not read whole topic due to lack of time at my work^^ )

 

But i know you guys are more advanced in coding, so you probably forgot to add the action to your variables.sqf 

dayz_resetSelfActions = {
	s_player_fire = -1;
	s_player_cook = -1;
	s_player_boil = -1;
	s_player_fireout = -1;
	s_player_butcher = -1;
	s_player_packtent = -1;
	s_player_packvault = -1;
	s_player_lockvault = -1;
	s_player_unlockvault = -1;
	s_player_fillwater = -1;
	s_player_fillwater2 = -1;
	s_player_fillfuel = -1;
	s_player_grabflare = -1;
	s_player_callzombies = -1;
	s_player_showname = -1;
	s_player_debuglootpos = -1;
	s_player_pzombiesattack = -1;
	s_player_pzombiesvision = -1;
	s_player_pzombiesfeed = -1;
	s_player_removeflare = -1;
	s_player_painkiller = -1;
	s_player_studybody = -1;
	s_player_tamedog = -1;
	s_player_madsci_crtl = -1;
	s_player_parts_crtl = -1;
	s_build_Sandbag1_DZ = -1;
	s_build_Hedgehog_DZ = -1;
	s_build_Wire_cat1 = -1;
	s_player_deleteBuild = -1;
	s_player_forceSave = -1;
	s_player_checkGear = -1;
	s_player_flipveh = -1;
	s_player_stats = -1;
	s_player_sleep = -1;
	s_player_movedog = -1;
	s_player_speeddog = -1;
	s_player_calldog = -1;
	s_player_feeddog = -1;
	s_player_waterdog = -1;
	s_player_staydog = -1;
	s_player_trackdog = -1;
	s_player_barkdog = -1;
	s_player_warndog = -1;
	s_player_followdog = -1;
	s_player_repair_crtl = -1;
	s_player_information = -1;
	s_player_fuelauto = -1;
	s_player_fuelauto2 = -1;
	s_player_fillgen = -1;
	s_player_upgrade_build = -1;
	s_player_maint_build = -1;
	s_player_downgrade_build = -1;
	s_player_towing = -1;
	s_halo_action = -1;
	s_player_SurrenderedGear = -1;
	s_player_maintain_area = -1;
	s_player_maintain_area_preview = -1;
	s_player_heli_lift = -1;
	s_player_heli_detach = -1;
	s_player_lockUnlock_crtl = -1;
};

Sorry, if this was already mentioned or was not the case.

 

^^

Link to comment
Share on other sites

  • 0

And i read something about zombie againt errors,

 

That is caused by spawning loot on the zeds, i haven't look into it yet, but at the errors its constructing,

 

it looked like the _loot varaible doesnt get initialised

 

So probably the loot table has objects in it that dont excist in the config.

Link to comment
Share on other sites

  • 0

@Sandbird: I thought I've send another reply but it does not seem to be here. For your dialog initialization I've found this:

https://community.bistudio.com/wiki/isNull

 

There are different Null types for different kind of objects. Maybe that can be used ;)

 

 

@ZUPA: if you will look into zombie_agent.sqf, please let me know how Zeds can react more accurately, hehe. I was searching for this for so long and I cannot figure this out. What I mean: I have walking Zeds...and if I move along them, they still continue with their move , I guess until it finishes, bevor they recognize where I am and then slowly turn into my direction. What I want is: I walk along them and in the moment I am in their back, they should already follwo me. Don't know if that can be accomplished (but I know that you have a very good understanding how things work here and how they fit together...maybe you have an idea) ;)

Link to comment
Share on other sites

  • 0

Hence the declaration in variables.sqf....most of these values are global variables....thats why all the sudden they give errors.

The private ones are private...there is no mistake there...99% you have declared them.

But since before the steam update, noone was paying attention to the global ones....thats why they give errors now.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Advertisement
  • Discord

×
×
  • Create New...