Jump to content

Recommended Posts

Hm what a shame.... would have been really useful

Could you maybe, instead of outcommenting it, check if a value in the missionConfigFile is true?

This would allow mission designers to use this functionality for coop or private events where they trust their players.

Like:

if (((getNumber (missionConfigFile >> "allowDisplayScriptedEH")) == 1) then
{
//Do EH stuff
};

I have another question:

Is it possible that findDisplay isn't working for IDD 133? IDD 133 is RscMiniMap (the gps).

I would like to attach a draw EH on it but I can't get the display :confused:

Edited by trnapster

Share this post


Link to post
Share on other sites

I wonder if we will ever see a getHit command added into the engine one day.

I know how you can track hit values using HandleDamage and setVariable, but it's laughable at best compared to a proper command. I don't see how hard it could be, since setHit is already there. A getter can't be more complicated than a setter, right?

Moricky, pretty please?

Share this post


Link to post
Share on other sites
I wonder if we will ever see a getHit command added into the engine one day.

I know how you can track hit values using HandleDamage and setVariable, but it's laughable at best compared to a proper command. I don't see how hard it could be, since setHit is already there. A getter can't be more complicated than a setter, right?

Moricky, pretty please?

getHitPointDamage - has been in arma 3 since the start. is this not what you're looking for? https://community.bistudio.com/wiki/getHitPointDamage

Share this post


Link to post
Share on other sites
getHitPointDamage - has been in arma 3 since the start. is this not what you're looking for? https://community.bistudio.com/wiki/getHitPointDamage

No no no... I'm talking about a getHit to work with selection names, getHitPointDamage doesn't cut it since it only works with hitpoints, which themselves are linked to selections, but are impractical when it comes to finding the damage of a precise selection by name.

Edited by AgentRev

Share this post


Link to post
Share on other sites

Hi, not trying to be a pest, but I'm wondering if there has been any progress on getting this fixed please? It's starting to really become a pest when setting up various training ranges and tasks. The target which is supposed to stay down when it's hit, doesn't move when it's hit and because "nopop" is a global command (!) if you set nopop to true, it effects every target on the map - making every target completely rigid, or completely passive. Help me Obi DarkDruid, you're my only hope.

Share this post


Link to post
Share on other sites

Has anyone had drama with units group <name of group> and named units? I had a quick squizz through this post, but may have missed it

I just tried using this in the latest dev version on steam (as of 4-4-2014) with a group full of named units (Flight1_1, Flight1_2,Flight1_3, Flight1_4) and the array comes back with an extra "d" on each name, which renders the result both useless and annoying.

Previously when called with nul=[Flight1_1] execvm "script.sqf", this code:

_kites =[];
_grp = group (_this select 0);
_kites = units _grp;

would give me an array _kites that was: [Flight1_1, Flight1_2,Flight1_3, Flight1_4]

now it gives me _kites as: [Flight1_1d, Flight1_2d,Flight1_3d, Flight1_4d], which means the array can't be used to point to the planes.

The workaround is to use the code below to remove the "d" and rebuild the array:

_kites =[];
_grp = group (_this select 0);
_bites = units _grp;
{ _bite = [(str _x),0,-1] call BIS_fnc_trimString;
_kite = call compile format [_bite];
_kites set [count _kites, _kite]; 
} forEach _bites;

But it's a convoluted annoyance, and I can't really see the point of the "units" array messing with the names in the first place. I'm guessing it's a budvar related typo. Please fix!

Edited by -dead-

Share this post


Link to post
Share on other sites

That is returning the crew of the vehicle.

flight_1d = driver

if it had more crew

flight_1g = gunner

flight_1c = commander

To return the plane use

vehicle flight_1d

to make an array of vehicles

_kites =[];
_grp = group (_this select 0);
{if (driver vehicle _x == _x) then {
 _kites=_kites+[_x];
 };
} foreach units _grp;
hint str _kites;

There is probably a better way but it works ok for me.

this may be of use as it works for units both in and out of vehicle

_grp = group (_this select 0);
_kites = []; 
{
if !(assignedVehicle _x in _kites) then {
	_kites = _kites +[ assignedVehicle _x];
	};
} foreach units _grp ; 
hint str _kites;

Edited by F2k Sel

Share this post


Link to post
Share on other sites

Ahhhh! That's where I was going wrong! I had a sneaking suspicion I was being a total retard, but I couldn't figure out how or where and there's quite a few changes from A2!

So the code I really want is:

_kites =[];
_grp = group (_this select 0);
_blokes = units _grp;
{
_kite = vehicle _x;
_kites set [count _kites, _kite]; 
} forEach _blokes;

Tested - does what I want! Sorted!

Thank you, F2k Sel for putting me on the right track! You're a star! Off to remedial arma scripting for me... FPDR

Edited by -dead-

Share this post


Link to post
Share on other sites
Off to remedial arma scripting for me...

You can join me there - I've done some right howlers recently! :)

Share this post


Link to post
Share on other sites

i want to draw everyone's attention to these tickets

http://feedback.arma3.com/view.php?id=5878

http://feedback.arma3.com/view.php?id=4063

these are two crucial things to actually be able to use some of the few new things in the engine. the first one is proper non hacky (relatively...) PIP scopes waiting to happen and the second one is just sad that it's not in at this point. are you guys (BI) living under a rock? are you just not aware of what people need?

these are ofc just two examples but what is so hard about giving us commands to get some accurate camera vectors. the data is there, just let us access it already ffs. just because you don't need it for whatever you can come up with doesn't mean it isn't one of these hundreds of show stoppers for people that probably have many better ideas. i'm sure there are many better ideas besides the scopes (ignoring that it's something people have been asking for a lot).

how can it be that you implement ragdoll and pushing people over but no command to trigger that? do you just not care at all about stuff that is outside your own scope? do you realise that for many people what this game comes down to these days is making their own shit? i wonder why?

there's still so many inventory handling commands missing, you can't even put a specific scope on a gun and then put it in a box via scripting without doing stupid shit to achieve it. give us better tools to make cool shit for this dull game. i mean releasing TB this buggy this far into the contest? nicely done. nice move.

there better be some bipods or something super useful soon that justifies you being oblivious about these OBVIOUSLY needed things. how about a save to visitor/terrain builder/sqm function in zeus? then it wouldn't be this "almost 3d editor" dangeling infront of us.

wtf?

i know there are bugs to fix...bla bla...but you always take ages to get your games into actual release state anyways. so who gives a fuck? at least give us what we need to pass time until then....

Share this post


Link to post
Share on other sites

I believe we need the attachchild script command as found here: [AKA Vehicle and Trailer Towing Function]

http://resources.bisimulations.com/wiki/attachChild [^]

Ticket: http://feedback.arma3.com/view.php?id=17718

I quote from myself:

The "Attach to, setDir/setpos loops" scripts are not sufficient in creating an accurate towing simulation for multi-player as it is too jerky and does not have the smooth transitions as in VBS's tow function."

And

I am pleading to the BI developers to finally place in the proper function of towing, just like VBS (attachchild script command). I know the ARMA engine can support it, we just need the function to be added.

Share this post


Link to post
Share on other sites

is there any way to make the laser pointer, the actual point on objects and the terrain, visible without NVGs? i could swear it was visible in arma 1 or 2 (laser designator). now we can finally have laser pointer attachments but now we can't make them visible?

if someone knows how, please share. if it's not possible then please make it possible. i know it might not be realistic or something but there are mods that have a different scope. and since there is a "day = 0" parameter, why not make it functional for lasers too and not only lights. again please correct me if i'm wrong and provide the info. thanks!

it would also insanly useful to retrieve the position of that laser point. i have yet to test it but i'm guessing it is not.

Edited by Bad Benson

Share this post


Link to post
Share on other sites

Couldn't we, the community come up with PiP scopes? As I'm not a coder I don't know how this could happen BUT if we had an invisible camera at a fixed distance away from the player (to show zoom) (and in line with the gun axis) we could broadcast that picture onto an overlay infront of the scope. Would that work?

@mattaustt - totally agree with attachChild ... would be a lovely command. We want artics !

Share this post


Link to post
Share on other sites

From what I understand PiP is generally a much lower quality image and without particle effects (correct me if I am wrong). Which of course would mean, anyone using a scope would simply see through the smoke.

From what I have read (can't recall from where), it would be better to do it the other way around. PiP the view around the scope (so the unzoomed view) and use the normal rendering for the scope view. But I am uncertain of the feasibility of having render textures with holes in them or if the trade off would be worth it.

Share this post


Link to post
Share on other sites
From what I have read (can't recall from where), it would be better to do it the other way around. PiP the view around the scope (so the unzoomed view) and use the normal rendering for the scope view. But I am uncertain of the feasibility of having render textures with holes in them or if the trade off would be worth it.

that's true but you still need a meaningful weapondirection (which is in general very useful) to do that AND you can't use masks on basic UI elements aka cutting a round whole in a PIP screen. this is not about PIP scopes. it's just an example. just read the ticket. it's about commands being broken...

Couldn't we, the community come up with PiP scopes? As I'm not a coder I don't know how this could happen BUT if we had an invisible camera at a fixed distance away from the player (to show zoom) (and in line with the gun axis) we could broadcast that picture onto an overlay infront of the scope.

uhm yea. that's the point. that's why the ticket exists because you can't get the exact aiming axis.

EDIT:

without particle effects (correct me if I am wrong). Which of course would mean, anyone using a scope would simply see through the smoke.

not really: http://i.cubeupload.com/3HTgR2.jpg

http://i.cubeupload.com/mG0g6r.jpg

Edited by Bad Benson

Share this post


Link to post
Share on other sites

While i was creating a mod, i had some troubles using the setVectorDirAndUp command. Once understood i tought, why can't we do it more userfriendly? I saw in several forums, that i'm not the onlyone who's thinking like this. I asked my brother and showed him the sqf basics. He wrote now 3 diffrent ways to rotate an object. By simply giving the function an object and the rotation angle in degrees around the axis you want. Basically the function just fill in the vector dir and up in the setVectorDirAndUp command. Probably its possible to add it to the BIS functions or even rewrite them in a command. This functions are free to use by anyone (including BI as template for a command or function), as long as you give credit (to "bapedibupa").

I think they're pretty useful!

rotateObject

/*
Rotate an object around each axis
By bapedibupa

Parameters: [object, [x,y,z]]
Returns: nothing

Rotates an object, giving it the specified rotation angle around each axis, in degrees.

The rotation is about the world coordinates. When the object you want to rotate is attached to another object, it rotates relative to this coordinates (it doesent rotates around the axis from the rotating object).

A positive number rotates the object in positive axis rotation. Negative numbers in the other direction.
Positive axis rotation means when you take your right hand, make a fist and spread out your thumb, make sure that the thumb is heading in positive axis direction: Your other fingers show you now the positive rotation around this axis.

Default value [0,0,0] make the object face straight north.
If you want to face it straight west so you want it to turn 90° in positive axis rotation around Z. Your array parameters should look like this [0,0,90].
If you want to face it straight east so you want it to turn 90° in negative axis rotation around Z. Your array parameters should look like this [0,0,-90].
All axis work in the same way. Sure you can do this with the setDir command, but not in 3D.

You also can combine a rotation around X, Y and Z. But then you need a good visual thinkimg or the trial and error methode ;) Note, that the object rotates first around X, then Y and in the end Z.

This function is useful when you want to place an object on the map or on a attached object in the direction you want. If you use it in combination with attachTo use first the attachTo command an then this function.

If you want to use this function just to look which parameters you should fill in the setVectorDirAndUp command (whenever you use it), just uncomment the hintSilent in the end and you can see the parameters in the game.

Example: [object[45,0,-90]] call rotateObject; // rotates 45° back and 90° right (east).
*/

rotateObject = {
_object = _this select 0;
_rotations = _this select 1;

_aroundX = _rotations select 0;
_aroundY = _rotations select 1;
_aroundZ = _rotations select 2;

// set default values
_dirX = 0;
_dirY = 1;
_dirZ = 0;

_upX = 0;
_upY = 0;
_upZ = 1;

// rotate around X
if (_aroundX != 0) then {
	_dirY = cos _aroundX;
	_dirZ = sin _aroundX;

	_upY = -sin _aroundX;
	_upZ = cos _aroundX;
};

// rotate around Y
if (_aroundY != 0) then {
	_dirX = _dirZ * sin _aroundY;
	_dirZ = _dirZ * cos _aroundY;

	_upX = _upZ * sin _aroundY;
	_upZ = _upZ * cos _aroundY;
};

// rotate around Z
if (_aroundZ != 0) then {
	_dirXTemp = _dirX;
	_dirX = (_dirY * -sin _aroundZ) + (_dirXTemp* cos _aroundZ);
	_dirY = (_dirY * cos _aroundZ) + (_dirXTemp * sin _aroundZ);

	_upXTemp = _upX;
	_upX = (_upY * -sin _aroundZ) + (_upXTemp * cos _aroundZ);
	_upY = (_upY * cos _aroundZ) + (_upXTemp * sin _aroundZ);
};

// round
_dirX = [_dirX,3] call BIS_fnc_cutDecimals;
_dirY = [_dirY,3] call BIS_fnc_cutDecimals;
_dirZ = [_dirZ,3] call BIS_fnc_cutDecimals;

_upX = [_upX,3] call BIS_fnc_cutDecimals;
_upY = [_upY,3] call BIS_fnc_cutDecimals;
_upZ = [_upZ,3] call BIS_fnc_cutDecimals;

// set vector dir and up
_dir = [_dirX,_dirY,_dirZ];
_up = [_upX,_upY,_upZ];

//hintSilent format ["dir: %1 up: %2",_dir,_up];

_object setVectorDirAndUp [_dir,_up];
};

rotateObjectX

rotateObjectY

rotateObjectZ

/*
Rotate object in x,y,z
By bapedibupa

Parameters: [object,angle]
Returns: nothing

Rotates an object, giving it the specified rotation angle around a choosen axis, in degrees.

The rotation is about the world coordinates. When the object you want to rotate is attached to another object, it rotates relative to this coordinates (it doesent rotates around the axis from the rotating object).

A positive number rotates the object in positive axis rotation. Negative numbers in the other direction.
Positive axis rotation means when you take your right hand, make a fist and spread out your thumb, make sure that the thumb is heading in positive axis direction: Your other fingers show you now the positive rotation around this axis.

All 3 functions rotate the object relative to its previous direction. You also can combine all 3 functions togheter by calling one funtion after the other. You even can use the same function twice whenever needed.

If you use the functions in combination with attachTo use first the attachTo command an then this functions.

Never Use setDir after one of this funtions, it resets previous direction.

Example:	[object, 45] call rotateObjectX;	// the object turn 45° back
		[object, -90] call rotateObjectZ;	// the object turn 90° right (east), but still hanging 45°back


*/


rotateObjectX = {
// find object and rotation angle
_object = _this select 0;
_angle = _this select 1;

// get current vector dir and up
_dir = vectorDir _object;
_up = vectorUp _object;

// split into x,y,z
_dirX = _dir select 0;
_dirY = _dir select 1;
_dirZ = _dir select 2;

_upX = _up select 0;
_upY = _up select 1;
_upZ = _up select 2;

// calculate new values
_dirYTemp = _dirY;
_dirY = (_dirZ * -sin _angle) + (_dirYTemp * cos _angle);
_dirZ = (_dirZ * cos _angle) + (_dirYTemp * sin _angle);

_upYTemp = _upY;
_upY = (_upZ * -sin _angle) + (_upYTemp * cos _angle);
_upZ = (_upZ * cos _angle) + (_upYTemp * -sin _angle);

// set vetor dir and up
_object setVectorDirAndUp [[_dirX,_dirY,_dirZ],[_upX,_upY,_upZ]];
};


rotateObjectY = {
// find object and rotation angle
_object = _this select 0;
_angle = _this select 1;

// get current vector dir and up
_dir = vectorDir _object;
_up = vectorUp _object;

// split into x,y,z
_dirX = _dir select 0;
_dirY = _dir select 1;
_dirZ = _dir select 2;

_upX = _up select 0;
_upY = _up select 1;
_upZ = _up select 2;

// calculate new values
_dirXTemp = _dirX;
_dirX = (_dirZ * sin _angle) + (_dirXTemp * cos _angle);
_dirZ = (_dirZ * cos _angle) + (_dirXTemp * -sin _angle);

_upXTemp = _upX;
_upX = (_upZ * sin _angle) + (_upXTemp * cos _angle);
_upZ = (_upZ * cos _angle) + (_upXTemp * -sin _angle);

// set vetor dir and up
_object setVectorDirAndUp [[_dirX,_dirY,_dirZ],[_upX,_upY,_upZ]];
};


rotateObjectZ = {
// find object and rotation angle
_object = _this select 0;
_angle = _this select 1;

// get current vector dir and up
_dir = vectorDir _object;
_up = vectorUp _object;

// split into x,y,z
_dirX = _dir select 0;
_dirY = _dir select 1;
_dirZ = _dir select 2;

_upX = _up select 0;
_upY = _up select 1;
_upZ = _up select 2;

// calculate new values
_dirXTemp = _dirX;
_dirX = (_dirY * -sin _angle) + (_dirXTemp * cos _angle);
_dirY = (_dirY * cos _angle) + (_dirXTemp * sin _angle);

_upXTemp = _upX;
_upX = (_upY * -sin _angle) + (_upXTemp * cos _angle);
_upY = (_upY * cos _angle) + (_upXTemp * sin _angle);

// set vetor dir and up
_object setVectorDirAndUp [[_dirX,_dirY,_dirZ],[_upX,_upY,_upZ]];
};


/*
// Problem with rotateObject is, you can't just type in x as axis. for now is x=1,y=2,z=3. you can type in "x" but then you need to change the cases to "x", "y", "z" ....
rotateObject = {
// find object, axis and rotation angle
_object = _this select 0;
_axis = _this select 1;
_angle = _this select 2;

// get current vector dir and up
_dir = vectorDir _object;
_up = vectorUp _object;

// split into x,y,z
_dirX = _dir select 0;
_dirY = _dir select 1;
_dirZ = _dir select 2;

_upX = _up select 0;
_upY = _up select 1;
_upZ = _up select 2;

// set temporary variables
_dirXTemp = _dirX;
_dirYTemp = _dirY;

_upXTemp = _upX;
_upYTemp = _upY;

// calculate new values
switch (_axis) do {
    case 1: {
   		_dirY = (_dirZ * -sin _angle) + (_dirYTemp * cos _angle);
		_dirZ = (_dirZ * cos _angle) + (_dirYTemp * sin _angle);

		_upY = (_upZ * -sin _angle) + (_upYTemp * cos _angle);
		_upZ = (_upZ * cos _angle) + (_upYTemp * -sin _angle);
    };
    case 2: {
		_dirX = (_dirZ * sin _angle) + (_dirXTemp * cos _angle);
		_dirZ = (_dirZ * cos _angle) + (_dirXTemp * -sin _angle);

		_upX = (_upZ * sin _angle) + (_upXTemp * cos _angle);
		_upZ = (_upZ * cos _angle) + (_upXTemp * -sin _angle);
    };
    case 3: {
		_dirX = (_dirY * -sin _angle) + (_dirXTemp * cos _angle);
		_dirY = (_dirY * cos _angle) + (_dirXTemp * sin _angle);

		_upX = (_upY * -sin _angle) + (_upXTemp * cos _angle);
		_upY = (_upY * cos _angle) + (_upXTemp * sin _angle);
    };

    default {
     	hintSilent "this is not a axis";
    };
};



// set vetor dir and up
_object setVectorDirAndUp [[_dirX,_dirY,_dirZ],[_upX,_upY,_upZ]];
};
*/

rotateAroundOwnAxisX

rotateAroundOwnAxisY

rotateAroundOwnAxisZ

/*
Rotate object around own x,y,z axis
By bapedibupa

Parameters: [object,angle]
Returns: nothing

Rotates an object, giving it the specified rotation angle around his own axis, in degrees.

The rotation is about the coordinates from the object.

A positive number rotates the object in positive axis rotation. Negative numbers in the other direction.
Positive axis rotation means when you take your right hand, make a fist and spread out your thumb, make sure that the thumb is heading in positive axis direction: Your other fingers show you now the positive rotation around this axis.

All 3 functions rotate the object relative to its previous direction. You also can combine all 3 functions togheter by calling one funtion after the other. You even can use the same function twice whenever needed.

If you use the functions in combination with attachTo use first the attachTo command an then this functions.

Never Use setDir after one of this funtions, it resets previous direction.

Example:	[object, 45] call rotateAroundOwnAxisX;		// the object turn 45° back
		[object, -90] call rotateAroundOwnAxisZ;	// the object turn 90° clockwise, but still looking north and 45° back


*/

rotateAroundOwnAxisX = {
// find object and rotation angle
_object = _this select 0;
_angle = _this select 1;

// get current vector dir and up
_dir = vectorDir _object;
_up = vectorUp _object;

// find x-axis
_axis = [_dir,_up] call BIS_fnc_crossProduct;

// split into x,y,z
_dirXTemp = _dir select 0;
_dirYTemp = _dir select 1;
_dirZTemp = _dir select 2;

_upXTemp = _up select 0;
_upYTemp = _up select 1;
_upZTemp = _up select 2;

_axisX = _axis select 0;
_axisY = _axis select 1;
_axisZ = _axis select 2;

// set cos and sin
_cos = cos _angle;
_sin = sin _angle;

// calculate new vector dir
_dirX = _dirXTemp*(_axisX*_axisX*(1-_cos)+_cos) + _dirYTemp*(_axisX*_axisY*(1-_cos)-_axisZ*_sin) + _dirZTemp*(_axisX*_axisZ*(1-_cos)+_axisY*_sin);
_dirY = _dirXTemp*(_axisY*_axisX*(1-_cos)+_axisZ*_sin) + _dirYTemp*(_axisY*_axisY*(1-_cos)+_cos) + _dirZTemp*(_axisY*_axisZ*(1-_cos)-_axisX*_sin);
_dirZ = _dirXTemp*(_axisY*_axisX*(1-_cos)-_axisY*_sin) + _dirYTemp*(_axisZ*_axisY*(1-_cos)+_axisX*_sin) + _dirZTemp*(_axisZ*_axisZ*(1-_cos)+_cos);

// calculate new vector up
_upX = _upXTemp*(_axisX*_axisX*(1-_cos)+_cos) + _upYTemp*(_axisX*_axisY*(1-_cos)-_axisZ*_sin) + _upZTemp*(_axisX*_axisZ*(1-_cos)+_axisY*_sin);
_upY = _upXTemp*(_axisY*_axisX*(1-_cos)+_axisZ*_sin) + _upYTemp*(_axisY*_axisY*(1-_cos)+_cos) + _upZTemp*(_axisY*_axisZ*(1-_cos)-_axisX*_sin);
_upZ = _upXTemp*(_axisZ*_axisX*(1-_cos)-_axisY*_sin) + _upYTemp*(_axisZ*_axisY*(1-_cos)+_axisX*_sin) + _upZTemp*(_axisZ*_axisZ*(1-_cos)+_cos);

// set vetor dir and up
_object setVectorDirAndUp [[_dirX,_dirY,_dirZ],[_upX,_upY,_upZ]];
};

rotateAroundOwnAxisY = {
// find object and rotation angle
_object = _this select 0;
_angle = _this select 1;

// get current vector dir and up
_dir = vectorDir _object;
_up = vectorUp _object;

// split into x,y,z
_dirX = _dir select 0;
_dirY = _dir select 1;
_dirZ = _dir select 2;

_upXTemp = _up select 0;
_upYTemp = _up select 1;
_upZTemp = _up select 2;

// set cos and sin
_cos = cos _angle;
_sin = sin _angle;


// calculate new vector up
_upX = _upXTemp*(_dirX*_dirX*(1-_cos)+_cos) + _upYTemp*(_dirX*_dirY*(1-_cos)-_dirZ*_sin) + _upZTemp*(_dirX*_dirZ*(1-_cos)+_dirY*_sin);
_upY = _upXTemp*(_dirY*_dirX*(1-_cos)+_dirZ*_sin) + _upYTemp*(_dirY*_dirY*(1-_cos)+_cos) + _upZTemp*(_dirY*_dirZ*(1-_cos)-_dirX*_sin);
_upZ = _upXTemp*(_dirZ*_dirX*(1-_cos)-_dirY*_sin) + _upYTemp*(_dirZ*_dirY*(1-_cos)+_dirX*_sin) + _upZTemp*(_dirZ*_dirZ*(1-_cos)+_cos);

// set vetor dir and up
_object setVectorDirAndUp [_dir,[_upX,_upY,_upZ]];
};

rotateAroundOwnAxisZ = {
// find object and rotation angle
_object = _this select 0;
_angle = _this select 1;

// get current vector dir and up
_dir = vectorDir _object;
_up = vectorUp _object;

// split into x,y,z
_dirXTemp = _dir select 0;
_dirYTemp = _dir select 1;
_dirZTemp = _dir select 2;

_upX = _up select 0;
_upY = _up select 1;
_upZ = _up select 2;

// set cos and sin
_cos = cos _angle;
_sin = sin _angle;


// calculate new vector dir
_dirX = _dirXTemp*(_upX*_upX*(1-_cos)+_cos) + _dirYTemp*(_upX*_upY*(1-_cos)-_upZ*_sin) + _dirZTemp*(_upX*_upZ*(1-_cos)+_upY*_sin);
_dirY = _dirXTemp*(_upY*_upX*(1-_cos)+_upZ*_sin) + _dirYTemp*(_upY*_upY*(1-_cos)+_cos) + _dirZTemp*(_upY*_upZ*(1-_cos)-_upX*_sin);
_dirZ = _dirXTemp*(_upZ*_upX*(1-_cos)-_upY*_sin) + _dirYTemp*(_upZ*_upY*(1-_cos)+_upX*_sin) + _dirZTemp*(_upZ*_upZ*(1-_cos)+_cos);

// set vetor dir and up
_object setVectorDirAndUp [[_dirX,_dirY,_dirZ],_up];
};

best regards

Lappihuan, bapedibupa

  • Like 2
  • Thanks 1

Share this post


Link to post
Share on other sites

Looks to me unit allowFleeing 1 (see: https://community.bistudio.com/wiki/allowFleeing) does not force a unit fleeing anymore.

Tested with latest Steam DEV build.

Repro code, for some unit init field into editor:

 handle = this spawn {_this allowfleeing 1; sleep .1; hintc format["%1 fleeing=%2", _this, fleeing _this]; }; 

Hint is returning fleeing=false all the way for me, while it should return true.

Edited by fabrizio_T

Share this post


Link to post
Share on other sites

A unit won't flee unless it's in combat (knows about enemies in its area).

Share this post


Link to post
Share on other sites

hey devs. i need a quick info on th following animation class properties:

soundEdge

soundenabled

soundOverride

do those still work? because i can't get them to work for some reason. the sound has to be a CfgSounds class, right?

Share this post


Link to post
Share on other sites

Hello, I have a question regarding the use of remoteControl and PiP.

I am basically hoping to use remoteControl along with an independent camera visible via PiP (currently using BIS_fnc_PNP).

I am testing this in the editor with a man and a manned helicopter (heli1) and the following code:

cam1 = "camera" camCreate (position player);

cam1 attachTo [heli1, [0,1,0.5]];

livefeed = ["rendertarget0", cam1, player] call BIS_fnc_PIP;

player remoteControl driver heli1;

This gives a small window with a view from inside the cockpit, and in some situations it is possible to partly control the helicopter. This appears to largely work when the player is close to heli1, resulting in control being lost when the helicopter gets some distance away from the player. Some actions (such as Collective lower) appear to work more consistently even when the other controls stop working.

What I am essentially wondering about is if this is something that should be working. As it almost works now it would be very nice if it was only a (fixable) bug that prevents it from working fully.

With switchCamera, controlling heli1 works, but I ideally want to avoid using this function in order to have more control of the camera.

Share this post


Link to post
Share on other sites

I've been searching for an answer to this question for a while and can't find a single example of it in action.

Does anyone know how to add submenus when using the Comms Menu system.

example

class CfgCommunicationMenu

{

class whatever

{

text = "my things"; // Text displayed in the menu and in a notification

submenu = ""; // Submenu opened upon activation (expression is ignored when submenu is not empty.)

rest of code ect.

I can get most other things working but I've no Idea about the submenu.

Thanks.

Share this post


Link to post
Share on other sites

Hi mate,

This is just a guess but is it a class defined somewhere else (description.ext/modfile etc)?

So you make your subMenu like:

class mySubMenu
{
   // stuff
};

Then you put it in the string:

submenu = "mySubMenu";

Just a wild stab in the dark though...

Share this post


Link to post
Share on other sites

Oh I see it's worth a shot and does make sense.

I'll give it a whirl tonight thanks.

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

×