-
Content Count
2494 -
Joined
-
Last visited
-
Medals
Posts posted by sarogahtyp
-
-
okay, i read another topic and it says that u cant execute a script with remoteExec. I would do a preprocessed and precompiled function for it then.
you can use this in the init.sqf:
fnc_my_function = compileFinal preprocessFile "your.sqf";
then u can use (call or spawn) it where ever u want with:return_value = [param1, param2] call fnc_my_function; or [param1, param2] call fnc_my_function; or param1 call fnc_my_function; or [] call fnc_my_function;
and u can use remote exec then. -
i d like those scripts which add some more functionality...
-
i think u forgot
intro =
before your addaction call
- 1
-
{
if((player find _x) > -1) then
{
// ur code which handles the player
}
} forEach playableUnits;
-
post that line where u get that different return values please. i m pretty sure it can be fixed with find
-
dont read the spoiler!
thinking ... sorry.I m very sorry for this senseless post, I m disliking it myself... your answer is one post down. -
Your examples are all here:
Thanks Sarogahtyp (had to look twice at the name ;) ) for the link to help converting.
Read it backwards or look at my avatar image both helps ;-)
- 1
-
i ll post here what comes in my mind with ur code in order as it came with or without relation to ur problem. i will edit this post every time i ve a new suggestion.
possibleSpies = possibleSpies + [_x];
replace that with this cause its alot faster:
possibleSpies pushBack _x;
I did not understood where the specified problem occurs but the solution should be to find a string in a string like that:
if ((_element_of_all_units find _player_Str) < 0) then { hint "player string is NOT inside of playable units"; } else { hint "player string is inside of playable units"; };
-
For deleting dead bodies only I would assume to use allDeadMen instead off allDead. (Arma 3 only).
"In Arma 3 when last unit leaves a group, the group gets auto deleted." as u can read here
P.S.: Why not using Arma 3 scripting forum for Arma 3 questions?
-
post some more code please.
-
Sorry, until now i dont know what the script is exactly for.
Could u explain what the object is which should be attached and which object it should be attached to. A real example could me help to understand what u like to do.
Another question is why u need to manipulate vectordir and vector up. Because if u have to do that every frame then I think its useless to attach the object cause the advantage of attachTo is that u dont need to worry about those vectors. if that is needed you could setpos instead.
EDIT:
The following line is definetly wrong. There must be an angle of 90 degree at every time between vector dir and vector up. In that code they r pointing in the same direction which is not allowed.
_object setVectorDirAndUp [[0,0,1],[0,0,1]];
it could be_object setVectorDirAndUp [[0,0,1],[0,1,0]];
or_object setVectorDirAndUp [[0,1,0],[0,0,1]];
What is that line for? getting worlds center position in model space? for me it seems to be without of sense.
_v = _attachToObject worldToModel [0,0,0];
-
You could look here:
but I didnt not find such anim at this page.
This tool could be handy for u, too.
-
As [FOXHOUND] Azza said u have to convert ur sqs stuff to sqf.
Read this there it is all described:
Another thing is that sqf has a different start command. You should use execVM to start it instead of exec which starts sqs files.
- 1
-
heliFuelTruck should be the name of a vehicle. i think it is not and for that your 2nd error shows up
currentAO should be a markers name but it seems to be not. thats the 3rd error.
server should be an objects name or whatever but u have no thing named server... 4th.I think medicTruck_1_1 should be the name of a vehicle,too ... 1st
just read that rpt snippets urself, its telling u the error:
Error Undefined variable in expression: helifueltruck Error position: <heliFuelTruck) then {heliFuelTruck setF>
means that heliFuelTruck is used in the script but is unknown at the time of running it
-
Ok guys I think I got it working. But it needs some more optimizing I think.
Its useless below 10 meters too but the crosshair is nearly in the center above 10 m.
I think we should forbid measuring below 50 meters to avoid strange behavior.
But there are some delays sometimes and that shoul be optimized.
Also I didnt test with other weapons but i think it should work for it.
_perfect_start = [0.12,0.57,0.52]; while{true} do { while {player isIRLaserOn currentWeapon player} do { if (cameraView == "GUNNER") then { _txtXhair = ""; _posXhair = positionCameraToWorld [0, 0, 10000]; _dir = player weaponDirection (currentWeapon player); _corr = [(_perfect_start select 0), (_perfect_start select 1), (_perfect_start select 2)]; _posLaser = AGLToASL (player modelToWorld _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)); }; _perfect_end = AGLToASL screenToWorld [0.5,0.5]; // reverse calculation of perfect start point with use of perfect end point _reverse_start = _perfect_end vectorAdd (_dir vectorMultiply -5000); _array = lineIntersectsSurfaces [_perfect_end, _reverse_start, objNull,objNull, false, 100, "GEOM","NONE"]; if (0 < (count _array)) then { { if((_x select 2) == player) then { _perfect_start = player worldToModel ASLToAGL(_x select 0); }; } forEach _array; }; _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]; }; // gunner check end sleep 0.03; }; // while IR on end sleep 5; };
Status: running with some minor bugs.
EDIT: I ve tested some other weapons now and it works. I think the laserpointer has the same position at every weapon cause i found no weapon where I noticed a different position.
-
You are using the wrong Syntax for the Event handler.
You have
addeventhandler ["STRING","STRING"];
when it should beaddEventHandler ["STRING", {CODE}];
Example:_this addeventhandler ["respawn",{nil = _this execvm 'rifle.sqf'}];
i think u r right but in the init line it shoul look:
this addeventhandler ["respawn",{nil = _this execvm 'rifle.sqf'}];_d = this addEventHandler ["respawn",{_d = _this execvm 'rifle.sqf'}];
-
as far as i know u cant have 2 conditions passed at the same time. u should think about redesigning it. maybe somone could give a hint if u tell us what u r trying.
-
Is that correct now?
yes thats better but my above posted question is not answered. where r those variables defined?
-
_perfect_start = [0.12,0.57,0.52]; _timestamp = diag_tickTime; while{true} do { while {player isIRLaserOn currentWeapon player} do { if (cameraView == "GUNNER") then { _txtXhair = ""; _posXhair = positionCameraToWorld [0, 0, 10000]; _dir = player weaponDirection (currentWeapon player); _corr = [(_perfect_start select 0), (_perfect_start select 1), ((_dir select 2) * (_perfect_start select 2))]; _posLaser = AGLToASL (player modelToWorld _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; // correction should be calculated every second _time = diag_tickTime; if((_timestamp + 1) < _time) then { _timestamp = _time; //first test if screenToWorld provides correct values and if _posXhair has a different value _perfect_end = screenToWorld [0.5,0.5]; _verify_STW = screenToWorld [0.5,0.499]; _verify = _perfect_end distance _verify_STW; _err = _perfect_end distance _posXhair; if((_verify > 0.04) and (_err > 0)) then { // reverse calculation of perfect start point with use of perfect end point _reverse_start = _perfect_end vectorAdd (_dir vectorMultiply -5000); _array = lineIntersectsSurfaces [_perfect_end, _reverse_start, objNull,objNull, false, 100, "GEOM","NONE"]; if (0 < (count _array)) then { { if(((_x select 2) == player) or ((_x select 3) == player)) then { _perfect_start = player worldToModel ASLToAGL(_x select 0); if ((_dir select 2) != 0) then { _perfect_start = [(_perfect_start select 0), (_perfect_start select 1), ((_perfect_start select 2)/(_dir select 2))]; }; }; } forEach _array; }; }; // check STW and error end }; // time check end 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]; }; // gunner check end sleep 0.03; }; // while IR on end sleep 5; };
Status: running but very buggy now.
In this version u can see the crosshair only above a distance of 250 m because auto correction is not working until now. (If it ever will?)
Main problem is that I cant get an object or its position from lineintersects return array (line 44).
It is always returning only 1 element even if their r some objects in the way.
That element is objNull and the parent object is objNull, too.
Im tired now. goin to bed.
-
I should write withs thos ''d'' or just null ?
Sweet it kinda work now :) Just question what i where i need change to get better loot in your code ? Becous in that scrip 1-3 is , 1 civilian, 2mility and 3is military. I need for 3 so have big guns :P
And when i have spawns what need , then im ready to play withs friends ? Or i need scrip somthing else for MP ?
...ewUnit,3] execVM "fnc_generate...
You can use that eventhandler in the init line of each player in multiplayer
-
I should write withs thos ''d'' or just null ?
doesnt matter
-
If that works then try this out:
d = [this,3] execVM "fnc_generate_loadout.sqf"; d = this addEventHandler ["Respawn", { _newUnit = _this select 0; _oldUnit = _this select 1; [_newUnit,1] execVM "fnc_generate_loadout.sqf"; }];
-
dont give up now.
try this to see if the event handler fires:
this addEventHandler ["Respawn", { sleep 10; systemChat " You r respawned :-)"; }];
-
Yes I thought about, but I dont know how to ungroup the helicopter by a command...
{_x join grpNull;} forEach crew yourheli;
or
heligroup = createGroup west; // or east if the heli side is east {_x join heligroup;} forEach crew yourheli;

Deleting Wrecks without ID's ?
in ARMA 3 - MISSION EDITING & SCRIPTING
Posted
i dont know if i understood but...
{ deleteVehicle _x } forEach allDead;