-
Content Count
2494 -
Joined
-
Last visited
-
Medals
Posts posted by sarogahtyp
-
-
Could this be a group problem? If the heli is in same group as the dropped troops then the group leader could command the heli what to do, not ur waypoints.
-
I have to enter that code in "Condition" ?No, try to add it in your init.sqfFor u the better solution should be to place a trigger in editor with:
Condition field: player in thisList
On activation field: player allowDamage false
On deactivation field: player allowDamage true
- 1
-
So here I proudly present a snippet which should do the job. _perfect_start should be the best start point in players model space for our problem.
_perfect_end = screenToWorld [0.5,0.5]; _err = vectorDiff _perfect_end - _posXhair; _dir = player weaponDirection (currentWeapon player); _reverse_start = _perfect_end vectorAdd (_dir vectorMultiply -5000); _array = lineIntersectsSurfaces [_perfect_end, _reverse_start, objNull,objNull, false, 10, "GEOM","NONE"]; _array_count = count _array; if (0 < _array_count) then { { if((_x select 2) == player) { _perfect_start = player worldToModel(_x select 0); } } forEach _array; };
I ve calculated _err which is the error vector between actual crosshair and the perfect crosshair position. But I m not using it. It can be used to test if we have a precise crosshair position when the snippet is implemented to code.
Upto now there are some problems with that snippet.
1. yesterday I tested to use screenToWorld [0.5,0.5]; all the time to draw the crosshair but the command is to slow. crosshair was blinking.
I suggest this correction could be run one time per second.
2. screenToWorld [0.5,0.5]; is working with the surface only. that means you get very wrong values if aiming to heaven.
3. screenToWorld [0.5,0.5]; is not working with objects (surface only) that means that the 10 I used at lineintersect command could be to low.
4. the snippet has to be implemented as auto correction in the code and yes of cause it has to be tested :-)
-
Some questions:
Is it a multiplayer problem?
You said a script should target those player. Do u only need the script to know who the player is or is that script controlling AI which should taget at the player?
If it is a multiplayer problem then I need some info where the script is running, at client or at server and how is that script started? Is it started by trigger, eventhandler or is it always running and tracking the player if it reaches those box?
If u answer some of those questions then u could get some more help. Posting ur script will us help to help u, too.
EDIT: I wrote that before I read the previous post...
-
on my way to work now and i m thinking about the hard coded correction values.
now i think its possible to implement an auto correction algorithm which should work with every weapon and would find better values as we are able to. i will work on it.
-
Now I substituted this line of my code:
_corr = ([0.12,0.57,0.52] vectorAdd [0,0,1.5*(_dir select 2)]);
with that one:
_corr = [0.12,0.57,0.52 * (_dir select 2)];
and now it is as precise as your solution:
crosshair reached inner x-axis marker at a distance of 9 m
crosshair reached inner y-axis marker at a distance of 10 m
I prefer my code now for the much better performance.
-
okay, i tested both solutions a bit and it turns out they both have advantiges and disadvantages.
I tested with a scope where I now define the horizontal line as x-axis and the vertical line as y-axis to let u know what i found out.
I used this scope: this addPrimaryWeaponItem "optic_SOS";
and that weapon: this addWeapon "arifle_MXM_F";
there are markers at these lines which I used to get a distance when the crosshair reaches em. I used the inner markers for that.
Your solution:
crosshair reached inner x-axis marker at a distance of 7 m
crosshair reached inner y-axis marker at a distance of 10 m
My solution:
crosshair reached inner x-axis marker at a distance of 130 m
crosshair reached inner y-axis marker at a distance of 9 m
So ur solution is much more precise but I ve the problem with your code that it seems to be slow. The crosshair is blinking very much at my slow PC. I tried to compensate that by retracing the crosshair between calculations and it gets a bit better but it is still blinking.
EDIT: i did not test leaning, kneeling and crouching. i assume that my code should cover it cause i use eye position. i dont know if yours do. -
the answer is there. if u use BIS_fnc_addRespawnPosition after the first spawn is done then it should work.
-
as u can read in your rpt snippets these are all undefined variable errors. the question is where u r defining them? in these files they are all undefined.
-
-
I dont know, I m to tired to test it but here is my solution.
while{true} do { while {player isIRLaserOn currentWeapon player} do { if (cameraView == "GUNNER") then { _txtXhair = ""; _posXhair = positionCameraToWorld [0, 0, 10000]; _dir = player weaponDirection (currentWeapon player); //EDIT: substituted following line as it is a better solution then // _corr = ([0.12,0.57,0.52] vectorAdd [0,0,1.5*(_dir select 2)]); _corr = [0.12,0.57,0.52 * (_dir select 2)]; _temppos = player selectionPosition "pilot"; _posLaser = AGLToASL (player modelToWorld (_temppos vectorAdd _corr)); _posXhair = _posLaser vectorAdd (_dir vectorMultiply 4999); _hitLaser = lineIntersectsSurfaces [_posLaser, _posXhair, player,objNull, true, 1, "GEOM","NONE"]; if (0 < count _hitLaser) then { _posXhair = (_hitLaser select 0) select 0; _txtXhair = str(round(_posLaser distance _posXhair)); }; _posXhair = ASLToAGL _posXhair; drawIcon3D ["\a3\ui_f\data\IGUI\Cfg\Cursors\weapon_ca.paa", [0,0.2,0,1], _posXhair, 1, 1, 0, _txtXhair, 0, 0.02, "TahomaB", "center", false]; }; sleep 0.03; }; sleep 5; };
-
ok, i think now i have the solution. the key is not the start but the end position. we should use
end = screenToWorld [0.5, 0.5];
position format is AGL
but that only is useful if u forbid range finding when player is not aiming
-
that eventhandler seems to be never activated. i have to think about it some time. maybe we should use another eventhandler but I never used those eventhandlers... im learning while helping. give me some minutes and we try another thing.
could u do another clean vanilla mission in virtual reality meanwhile? with one player only and the same script and init line. just to reduce the problem. and use the 2d editor for it cause eden is buggy.
-
latest one and check the part after u started the game the last time.
-
open your windows explorer file manager an click into its adress line.
substitute the content of it with:
%userprofile%\AppData\Local\Arma 3
press enter and look for arma3.rpt
but before looking for that file run arma please and respawn. i want to know which chat lines u get
-
-
ok, add some sytemchats in line 12 17 23 25 and one before line 1 plz.
like
systemChat "0"; systemChat "12"; systemChat "17"; systemChat "23"; systemChat "25";
and look at you .rpt file for errors.
-
did u test what happens on the 2nd and 3rd time u respawn?
-
As u can read here:
http://vybormilitarycommand.com/arma-3-exile-helicopters/
The only vehicle which cant be transported by Taru is the Tempest.
-
I never used that but:
If the command setSlingLoad can be used from init line and if the Taru is generaly able to transport the Tempest then you dont need this:_slingable = heli1 canSlingLoad c1;
-
Can you give me the code example of what I need to do the hint trick please?
hint "until here its running";
or
systemchat "it runs until here";
-
Upto now i did not read ur script but i suggest to try this in ur init line:
null = [this,3] execVM "fnc_generate_loadout.sqf"; this addEventHandler ["Respawn",{[(_this select 0),3] execVM "fnc_generate_loadout.sqf"}];
-
what about
getPosASL nearestObject [player, "acc_pointer_IR"];
did you guys already try that?
-
I never tried it but google told me that this could be your wanted tool:
- 1
Respawn loadout script problem
in ARMA 3 - MISSION EDITING & SCRIPTING
Posted
If u have tried that code in the init line of the player then use
this
instead of
_x