Spriterfight
-
Content Count
171 -
Joined
-
Last visited
-
Medals
Posts posted by Spriterfight
-
-
I put the function in the init.sqf is it bad practice?
-
I have a while loop and i created a function that updates a certain position, the problem is it dosent execute everytime it is called in the while loop only once, so the object that i want to move only moves towards the first position thaht the function has created
-
So can someone help me to make ai pilots fire accurately or use the plane properly it is so frustrating seeing ww 2 fighters geting shot by biplanes and the problem is that the fighters are fleeing from the bipalnes and they arent using the full potential of their speed also everytime they let the biplanes in their backs so they can shot them.I know arma isnt made for flight sim but want to make a ai vs ai dogfight that is random and dont wanna chees it with scripts,maybe if i can make them more accurate would be better since these planes dont have heat missiles
-
34 minutes ago, opusfmspol said:unitReady page doesn't reflect its locality, but be aware it should be run where the unit being checked is local.
My own testing in the past showed the unitReady command only gave an accurate return on the machine where the unit was local. When the command was run on a machine where the unit was not local, it always returned true, regardless whether the unit was ready or not ready. And that caused scripts and fsm's which were relying on it to jump the gun, advancing instead of waiting.
When does ready fires actually?When a unit is at his position?
-
i want a script that checks if the unit is in formation ,when a unit is is ready they say ready to fire,is there a way to check this when they say that?
-
So i have a waypoint and i want to set a timer for if a certain time passes the waypoint deletes itself so i thoguht the setWaypointTimeout is for this .Any ide?The reason for this is simple,I want a dynamic ai co op exeprience and if certain waypoint dosent seems to fit the role i want to cahnge it thats why i would set a timer for it so if the ai didnt comepletes the waypoint then the waypoint will delete itself and will be replaced with another one with different role, like move---> sek and destroy
-
I have 3 sector and want to select the nearest to a sepcific group how can i achieve this beside using BIS_fnc_nearestPosition
-
How can i detect if a sector has no side?Are there any index like west,east etc to identify sideunknown?i have this for east and west "sectorname getVariable "owner" == east" Thnx in advance!
-
_bomberplane = createVehicle [_planetype, _posspawn, [], 0, 'FLY']; [_bomberplane, 600, _posspawn, "ASL"] call BIS_fnc_setHeight; _dir = _bomberplane getDir _caller; _bomberplane setDir _dir; _crewbomber = createVehicleCrew _bomberplane; _wp1 = _crewbomber addWaypoint [_targetpos,1]; _wp1 setWaypointType "MOVE"; _wp1 setWaypointSpeed "Full"; _wp1 setWaypointBehaviour "Aware"; _wp1 setWaypointStatements ["true", "deleteVehicle this"];
It is sabs secret weapon planes i want the plane to face the direction of caller
-
I have this code
Quote_dir = _bomberplane getDir _caller;
_bomberplane setDir _dir;What i want is to set the direction of the plane to face the caller but everytime i run the script the plane is facing the right direction but it is upside down
-
2 hours ago, pierremgi said:or :
{leader _x inArea thisTrigger} count [grp1,grp2,grp3,grp4,grp5] == 5
or :
[grp1,grp2,grp3,grp4,grp5] findIf {!(leader _x inArea thisTrigger)} == -1 // faster
Thanks!
-
11 hours ago, Joe98 said:Place 3 triggers on the map covering the area required. The three triggers need to be nearly the same size, not exactly the same size, so you can edit the triggers easily.
Name your 3 leaders:
lead01
lead02
lead03Now place 3 boxes on the map. On the side in an out of the way place. Name the boxes
box01
box02
box03For trigger 1, you write a command so that when lead01 enters the trigger area, box01 is deleted: deletevehicle box01
For trigger 2, you write a command so that when lead02 enters the trigger area, box02 is deleted: deletevehicle box02
For trigger 3, you write a command so that when lead03 enters the trigger area, box03 is deleted: deletevehicle box03
Now place a 4th trigger on the map. Somewhere in an out of the way place. This trigger will fire when all 3 boxes are deleted:
(!alive box01) && (!alive box02) && (!alive box03)
The exclamation mark, just means - not alive.So, the three leaders enter the area, the 3 boxes are deleted and this causes your trigger to fire.
.
I solved it with
leader grp1 inArea thisTrigger && leader grp2 inArea thisTrigger && leader grp3 inArea thisTrigger && leader grp4 inArea thisTrigger && leader grp5 inArea thisTrigger
-
So i have three group and i want the trigger to be activated when each leader of the group is in the trigger area.How can i do this?Thanks in advance
-
2 minutes ago, bong oh said:Thank you
-
32 minutes ago, bong oh said:umm. I don't know how to show repo...for instance, announce sqf in mission folder?
init.sqf
YOU_fnc_account = { params [["_caller", objNull, [objNull]], ["_amount", 0, [0]]]; private _account = _caller getvariable "YOU_account"; _caller setvariable ["YOU_account", _account + _amount]; if (_amount < 0) then { systemChat format ["%1 POINT 사용!", _amount] } else { if (_amount > 0) then { systemChat format ["%1 POINT 획득!", _amount] }; }; systemChat format ["Balance $%1", _account+ _amount]; }; _unit = _this select 0; [_unit, [_unit, "SavedInventory"]] call BIS_fnc_saveInventory; //all trait unlock player setUnitTrait ["engineer",true]; player setUnitTrait ["medic",true];
initPlayerLocal.sqf
["InitializePlayer",[player,true]]call BIS_fnc_dynamicGroups; // When killed, bring _unit,_killer to Server { _x addEventHandler["Killed", { _unit = (_this select 0); _killer = (_this select 1); pKilled = [_unit, _killer]; publicVariableServer "pKilled"; }]; }forEach allUnits;
initServer.sqf
//calculate Distance bonus and increase _killer's account ["Initialize"] call BIS_fnc_dynamicGroups; "pKilled" addPublicVariableEventhandler { private ["_data"]; private _bonus =0; _data = (_this select 1); _unit = (_data select 0); _killer = (_data select 1); _cID = owner _killer; _distance = _unit distance _killer; if(side _killer == side _unit) then{ [_killer,-100] call You_fnc_account; }; // hint str _distance; if(_distance<100) then { _bonus=0; }; // each kill range over 100m bouns will increase 10 if(_distance>=100) then{ _bonus=(_distance/100)*10; _bonus=[_bonus,0] call BIS_fnc_cutDecimals; hint format ["+거리 보너스 : %1", _bonus]; }; _bonus=_bonus+100; [_killer,_bonus] call You_fnc_account; // pClient = bonus; // _cID publicVariableClient "pClient"; };
onPlayerRespawn.sqf
_unit = _this select 0; [_unit, [_unit, "SavedInventory"]] call BIS_fnc_loadInventory;
onPlayerOut.sqf
_unit = _this select 0; [_unit, [_unit, "assignedItem"]] call BIS_fnc_saveInventory;
umm that is all sqf in my mission folder
You pack the mission in a zip and upload to a drive.This will help us reproduce the error
Do you use any mod?
Thank you!
-
I think you can place the first script in the intPlayerServer.sqf where each player will have this action.Though and maybe if player not present in trigger area then your code.The problem is you implemented a complex system in your mission and we need the repo to understand what is your intention
-
How can i set "B_Parachute_02_F" ,to not open until certain hegiht?I thought i could disable the parachute opening animation.
-
1 minute ago, bong oh said:yup without error . I don't know about red dot in code that copy from here.. but actually work without error
You can copy paste it then and do it with naother vehicle.
-
5 minutes ago, bong oh said:Now.. this is work.. I can't understand this code is same above that but work.. I found red dot in code when I put here.
then I remove that dot and copy, that code work correctly . wtf is that... any way yup... work
this addAction ["Buy truck", "if (((_this select 1) getVariable ""YOU_account"")>1500) then {systemChat ""you bought truck!""; [_this select 1, -1500] call YOU_fnc_account,; _spawnedvehicle = createVehicle[""rhsusf_m1078A1P2_B_D_fmtv_usarmy"",getMarkerPos ""Truck"",[], 0, ""NONE""]; clearWeaponCargoGlobal _spawnedvehicle; clearMagazineCargoGlobal _spawnedvehicle; clearItemCargoGlobal _spawnedvehicle; } else {systemChat ""Not Enough Money""};"];
Without error?Any unnecsesary element in syntax can cause error.
-
1 minute ago, bong oh said:I know that.. but i "" needed when call name in addAction. and that makes error.
let me check this in my game
-
_spawnedvehicle = createVehicle["rhsusf_m1078A1P2_B_D_fmtv_usarmy",getMarkerPos""Truck"",[], 0, ""NONE""];try this you should have two ",between the truck name
-
6 hours ago, arma_max said:Hi,
Is there a way to retrieve the information where the head's position of a unit is and maybe even how big that object is on the screen? I want to retrieve that information to be able to draw a box around the head.
Max
Try this https://community.bistudio.com/wiki/selectionPosition.Best regards!
-
43 minutes ago, bong oh said:3rd problem solved. just respawn to 'respawn_west' marker not respawn module.
I am glad to hear that.
-
2 minutes ago, wingtip said:do you have a discord where i can chat with you faster so i dont take up all your time on the forums here ?
Yes i have spriterfighter#0678
Called function wont execute multiple times in while loop
in ARMA 3 - MISSION EDITING & SCRIPTING
Posted
func_PredictIntrecept = { _target = _this select 0; _aircraft = _this select 1; _targetPos = getPos _target; // Get the velocity of the target _targetVel = velocity _target; // Get the current position of the aircraft _aircraftPos = getPos _aircraft; // Calculate the time it will take to reach the target _timeToTarget = (_aircraftPos distance _targetPos) / (speed _aircraft / 3.6); // Calculate the future position of the target _futureTargetPos = _targetPos vectorAdd (_targetVel vectorMultiply _timeToTarget); // Calculate the direction to the future target position _directionToFutureTarget = _aircraftPos vectorFromTo _futureTargetPos; // Calculate the interception point _intersectionPoint = _futureTargetPos vectorAdd (_directionToFutureTarget vectorMultiply _timeToTarget); // Create a marker at the interception point (for debugging purposes) _markerStr = createMarker ["markername", _intersectionPoint]; _markerStr setMarkerShape "RECTANGLE"; _markerStr setMarkerSize [100, 100]; // Display a hint for debugging hint "OK"; _intersectionPoint; };
This is my code which predicts intrecept position of a target, i fixed it by simplifying the formula(it has an object attached to it and wanted a relase position where the plane relases it to hit target, nevermind it is complicated and arma has strange physics).The problem was it seemed to be a delay and the plane moved behind the target.It needs to be updated every second.It seems to be work, but i want to be sure that it executes instantly and there are no delay since accurate position is crucial