Jump to content

Recommended Posts

 this setSpeciality ["camouflageCoef",0.00010];

 

used to wok in my mission no problem but now I get a missing ';' error

 

 

Edit: Ahhh.Well, there it is.

 

Thanks Jona33

Share this post


Link to post
Share on other sites

 this setSpeciality ["camouflageCoef",0.00010];

 

used to wok in my mission no problem but now I get a missing ';' error

SetSpeciality has been renamed to setUnitTrait

Share this post


Link to post
Share on other sites

SetSpeciality has been renamed to setUnitTrait

Indeed, this is its final name  :292:

 

As reminder, default traits are:

  1. medic (bool)
  2. engineer (bool)
  3. ExplosiveSpecialist (bool)
  4. camouflageCoef (scalar)
  5. audibleCoef (scalar)
  6. fatigueCoef (scalar)

 

You can also define custom trait (bool only) with: unitName setUnitTrait ["customTrait", traitValue, true];

Share this post


Link to post
Share on other sites

I see mentionings of filtering actions from the action menu. Are we going to finally be seeing a script command to hide BIS actions such as heal and repair?

Share this post


Link to post
Share on other sites

The diag_codePerformance command allows you to specify how many loops should be tested I guess.

This behaviour should probably be documented. Ideally the command should also show an error message instead of just failing silently.

I know it's just a debug command, but silently failing commands is probably one of the worst things about SQF.

 

diag_codePerformance was not meant to be used for debug console code execution, but was used as a temporary measure until a certain bug got fixed. Now the bug is fixed and at some point you should be able to execute debug_codePerformance from debug console again.

Share this post


Link to post
Share on other sites

Is that the correct behaviour?

player getUnitTrait "fatigueCoef" //returns false
player setUnitTrait ["fatigueCoef",1]; 

player getUnitTrait "fatigueCoef"; //returns still false

I expected it to return a scalar value instead of a bool.

Share this post


Link to post
Share on other sites

This is because we have renamed the coefficient from fatigueCoef to loadCoef. The reason is because it doesn't directly impact the stamina but the load which is then, processed by the stamina system. 

 

Ps: Wiki page updated.

Share this post


Link to post
Share on other sites

This is because we have renamed the coefficient from fatigueCoef to loadCoef. The reason is because it doesn't directly impact the stamina but the load which is then, processed by the stamina system. 

 

Ps: Wiki page updated.

 

 

 

I had just copied those trades over to the wiki page, bad timing I guess

  • Like 1

Share this post


Link to post
Share on other sites

so i've checked out the new animateSource command to try and animate vehicle turrets... i couldn't get it to work with regular vehicles at all.  Only the UGV example with it's "remote turret" works for me. Is the external animation of turrets not supported? Would it be too much to ask to implement this? It would be really helpfull for a variety of things

 

(e.g. commander rotating the turret of the gunner to his exact view position on push of button, or reload animations on very large artillery pieces, etcetc)

  • Like 3

Share this post


Link to post
Share on other sites

No idea if this is the right place to ask this, but:

 

Would it be possible to add an extra parameter to find that specifies the base to search for? E.g.

 

_string find ["findme", 10]

 

would start the search at offset 10 instead of at offset 0. Would be very useful for e.g. bracket matching:

 

_bracket = _string find "(";

_endBracket = _string find [")", _bracket]

 

Just an idea.

  • Like 1

Share this post


Link to post
Share on other sites

so i've checked out the new animateSource command to try and animate vehicle turrets... i couldn't get it to work with regular vehicles at all. Only the UGV example with it's "remote turret" works for me. Is the external animation of turrets not supported? Would it be too much to ask to implement this? It would be really helpfull for a variety of things

(e.g. commander rotating the turret of the gunner to his exact view position on push of button, or reload animations on very large artillery pieces, etcetc)

You can also unhide and animate turrets on unarmed Huron, but cannot enter them physically. As a rule of thumb, if you can enter turret and control it wiith your mouse, you cannot probably control it with script as well.

Share this post


Link to post
Share on other sites

@killzone_kid May I ask why you have change the documentation for isFlatEmpty on the Wiki? The variant where the second element was used to allow the command to move a little the original point and return a suitable place is working nice, as far as I can test it; and the check-only variant is definitively not. I've spent hours testing and getting negative on tests for specific points that, to my knowledge, completely meet the criteria, until I tried setting the second element to at least 1, and it magically returned true for all the expected positives, and false for all the expected negatives. Care to retest you tests or share some info?

Share this post


Link to post
Share on other sites

@killzone_kid May I ask why you have change the documentation for isFlatEmpty on the Wiki? The variant where the second element was used to allow the command to move a little the original point and return a suitable place is working nice, as far as I can test it; and the check-only variant is definitively not. I've spent hours testing and getting negative on tests for specific points that, to my knowledge, completely meet the criteria, until I tried setting the second element to at least 1, and it magically returned true for all the expected positives, and false for all the expected negatives. Care to retest you tests or share some info?

could you please give example where second element is used and the outcome is useful and consistent? Also kinda curious to know what is definitely not working as expected when command is in check only mode? BTW this was the page before I expanded documentation https://community.bistudio.com/wiki?title=isFlatEmpty&diff=91181&oldid=71625 trying to understand what you dont like about it.

Share this post


Link to post
Share on other sites

You state in the new page, that the second parameter must be always set to -1, or the command becomes useless. It was known before that, that isFlatEmpty could search a little area to return a valid position, as it is seen in the doc before your changes (thank a lot BTW I was looking for that previos version):

 

 

position isFlatEmpty [float minDistance,float precizePos,float maxGradient,float gradientRadius,float onWater,bool onShore,object skipobj]

_isFlat = (position _preview) isflatempty [
		(sizeof typeof _preview) / 2,	//--- Minimal distance from another object
		0,				//--- If 0, just check position. If >0, select new one
		0.7,				//--- Max gradient
		(sizeof typeof _preview),	//--- Gradient area
		0,				//--- 0 for restricted water, 2 for required water,
		false,				//--- True if some water can be in 25m radius
		_preview			//--- Ignored object
	];

I'll provide a testing position as soon as I can (I know where to look, main road north-east of Neri, i just need the time).

 

 

Share this post


Link to post
Share on other sites

This position returns false (empty array actually) if the second parameter is set to -1 (check-only mode):

systemChat str ([4274.66,12113,0.00139618] isFlatEmpty [1, -1, 0.5, 1, 0, false, objNull])

But it returns the position (meaning it meets the criteria), if the second parameter is set to 1 (find-position mode):

systemChat str ([4274.66,12113,0.00139618] isFlatEmpty [1, 1, 0.5, 1, 0, false, objNull])

I'm pretty sure you won't need anything more that this ;) .

Share this post


Link to post
Share on other sites

This position returns false (empty array actually) if the second parameter is set to -1 (check-only mode):

systemChat str ([4274.66,12113,0.00139618] isFlatEmpty [1, -1, 0.5, 1, 0, false, objNull])

But it returns the position (meaning it meets the criteria), if the second parameter is set to 1 (find-position mode):

systemChat str ([4274.66,12113,0.00139618] isFlatEmpty [1, 1, 0.5, 1, 0, false, objNull])

I'm pretty sure you won't need anything more that this ;) .

 

Testing it on 135639, both examples return [] for me.

^^^ This was because I placed player at the location.

Found what was the problem with command not working as expected. In check only mode it tests the area for empty when 1st element is >0. As it happens one of the "Land_HighVoltageColumnWire_F" in 50m radius is considered closer than 1m. I know, stupid, right? But that was the reason I made new documentation for this command to make sense out of it and make usable. I'm afraid there are so many "if this then that" with this command that one would need a diploma to be able to use isFlatEmpty. Anyway, this works, only because I excluded the High Voltage Column:

systemChat str ([4274.66,12113,0.00139618] isFlatEmpty [1, -1, 0.5, 1, 0, false, nearestObject [[4274.66,12113,0.00139618], "Land_HighVoltageColumnWire_F"]])

Share this post


Link to post
Share on other sites

Hello everybody, this is my first post and im not sure if this is the right section but im looking for the script command for 20mm or 40mm grenade launcher explosions.

Thanks in advance

Share this post


Link to post
Share on other sites

Thanks! Great find about the column being the offending object. Your solution combining the two commands is also great and I'm gonna use it. Do note though, that using the second parameter of isFlatEmpty, far from making the command useless, solved the problem (at least in that case).

Share this post


Link to post
Share on other sites

Thanks! Great find about the column being the offending object. Your solution combining the two commands is also great and I'm gonna use it. Do note though, that using the second parameter of isFlatEmpty, far from making the command useless, solved the problem (at least in that case).

 

It does what findEmptyPosition does only it becomes way to complicated when it is used with the rest of params in isFlatEmpty. It is much cleaner to have it separated.

  • Like 1

Share this post


Link to post
Share on other sites

So Version 1.58 added "displayParent" which complements "ctrlParent" nicely.

 

I suggest also adding a "displayClassName" which would report the class name of a display. That is currently not possible unfortunately. There is a variant for controls though: https://community.bistudio.com/wiki/ctrlClassName

  • Like 1

Share this post


Link to post
Share on other sites

Would it be possible to add an extra parameter to find that specifies the base to search for? E.g.

 

_string find ["findme", 10]

 

would start the search at offset 10 instead of at offset 0. Would be very useful for e.g. bracket matching:

 

_bracket = _string find "(";

_endBracket = _string find [")", _bracket]

 

Just an idea.

Something like this would be neato, so + 1

 

Another thing that came to mind: insert

For inserting into an array or string at given index. Similar to set but wouldn't replace the index, and would also work for strings.

_arr = [1, 2, 3, 4]

_arr insert [2, "blah"]; //result: [1, 2, "blah", 3, 4]

 

_str = "Hello World";

_str insert [6, "Kitty "]; //result: "Hello Kitty World"

 

Or upgrade set to do this.

:shrug:

  • Like 1

Share this post


Link to post
Share on other sites

Could anyone clarify what influence the load,camouflage & audible coefficients have ? (setUnitTrait)

 

Do higher values mean the unit is easier to spot or harder and what's the usual range for those values?

Share this post


Link to post
Share on other sites

setUnitTrait :jump_clap:

 

Thanks BIS! Been waiting for something like this and it will be popular with AI tweakers and stealth mission makers.

 

@ R3vo: At least for camouflage higher value = easier and assume it the same for loudness.

 

/KC

Share this post


Link to post
Share on other sites

So Version 1.58 added "displayParent" which complements "ctrlParent" nicely.

 

I suggest also adding a "displayClassName" which would report the class name of a display. That is currently not possible unfortunately. There is a variant for controls though: https://community.bistudio.com/wiki/ctrlClassName

Would be extremely useful.

Share this post


Link to post
Share on other sites

Could anyone clarify what influence the load,camouflage & audible coefficients have ? (setUnitTrait)

 

Do higher values mean the unit is easier to spot or harder and what's the usual range for those values?

I will put some notes on the wiki page as soon as I have some time to do so.

Example: loadCoef will alter the weight of the inventory, impacting among others, the stamina threshold.

  • Like 2

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

×