what is "cover4"
i dont recognise it as an object/vehicle class
and from what you posted, you havent shown that you have declared it as anything
eg cover4 = "
classname of object"
and it needs to be either the real classname of an object, or a variable that has been declared as one
*****************************************************
To know how to use titletext format or hint format to debug a script, is propabably the most useful weapon in a scripters arsenal.
i give you an example.
A fired event handler, returns an array of various elements every trime it is triggered.
say for instance we didnt know what those elements were or how many there were
we can find out in the following way
INIT.sqsplayer addEventHandler ["Fired", {_this exec "debug.sqs"}]
DEBUG.sqs_A = _this select 0;
_B = _this select 1
_C = _this select 2
_D = _this select 3
_E = _this select 4
_F = _this select 5
_G = _this select 6
hint format ["A = %1\n\nB = %2\n\nC = %3\n\nD = %4\n\nE %5\n\nF=%6\n\nG=%7",_A,_B,_C,_D,_E,_F,_G]
when you as a player fire a weapon a hint box will appear and the following will be displayed
A= Terox
B= M16Grenadelauncher
C= M16Muzzle
D= Burst
E= M16
F = stringoxcliffee etc etc
G = stringoxcliffee etc etc
we can then see that there are only 5 elements
first element = players name
2cnd element = weapon name etc.
Now that we have this info, we can further debug the script we are working on.
Lets say for instance, that we are developing a weapon jamming system
and we are trying to remove and re add the magazine for the M16grenadelauncher when the weapon is fired using the standard rifle, not the grenade launcher part
we find that in our script, when we fire the weapon normally, the script doesnt remove the mag
and are sure that the line
?(_C == "M16muzzlemode"): Player removemagazines "M16"is correct.
So we run another hint format in our debug script
hint format ["Muzzle Type = %1",_C]hey presto, it returns
Muzzletype = M16muzzle"
debugged and so we change the line
to
?(_C == "M16muzzle"): Player removemagazines "M16"Additional items you can use in debugging is
Have a radio trigger that when activated causes a boolean to become true
Then you know, that even if the trigger didnt activate the boolean, you did
or a marker that you setmarkerpos to an object, so that you can see where that object is etc etc
Hope that helps a bit