Jump to content

sabot10.5mm

Member
  • Content Count

    124
  • Joined

  • Last visited

  • Medals

Everything posted by sabot10.5mm

  1. sabot10.5mm

    navigating config files

    looking at the cfg files for helicopter show no reference to the weapons they carry, how can i find them? i want to filter transport helicopters and attack helis, but i see no nothing that could help in that way. anyone know where those weapons are stated (cannon,missles,rockets)?
  2. sabot10.5mm

    navigating config files

    getting time to completion of 138 ms. i will post here all revisions until i get tired of it 0.1
  3. sabot10.5mm

    Enemy occupation system (eos)

    thanks for the advice
  4. sabot10.5mm

    Enemy occupation system (eos)

    i already made a thread about what i got wrong. post it there. thank you though
  5. sabot10.5mm

    Respawn player in SP

    onPlayerKilled.sqf Executed when player is killed in singleplayer or in multiplayer mission.
  6. sabot10.5mm

    Enemy occupation system (eos)

    decided to make a script that fills infpool based on cfgfactionclass. it works by saving units to a variable named exactly the same as written in editor with the addition of _ in front. example say you want the new faction spetsnaz added to the infpool inside the UnitPools.sqf file, write (missionNamespace getVariable "man_spetsnaz") + (missionNamespace getVariable "man_CSAT") missionNamespace getVariable "tank_CSAT" missionNamespace getVariable "arty_CSAT" missionNamespace getVariable "apc_CSAT" missionNamespace getVariable "car_CSAT" missionNamespace getVariable "boat_CSAT" missionNamespace getVariable "plane_CSAT" missionNamespace getVariable "crewman_CSAT" missionNamespace getVariable "sforce_CSAT" missionNamespace getVariable "boat_CSAT" missionNamespace getVariable "tranheli_CSAT" missionNamespace getVariable "attackheli_CSAT" should work with all mods, and support modules init.sqf UnitPools.sqf
  7. This is just a concept i had in my head. What i had in mind is say you want to run a script foreach unit, and only want a limited amount of scrips to run at any given time; would it be a good idea to queue 5 to run and finish before the next 5 can run? This script probably wont work, since i cant debug from my phone missionNamespace setVariable ["queue", 0]; allunits apply { while {alive _x} do { _queue = missionNamespace getVariable "queue"; if (_queue >= 10) exitWith {}; missionNamespace setVariable ["queue", (missionNamespace getVariable "queue")+1]; while {what ever is true} do {what ever is here does not matter. its just a concept}; missionNamespace setVariable ["queue", (missionNamespace getVariable "queue")-1]; }; };
  8. I was thinking more of a queue for repeating scripts, most notably would be applying a loop script to every unit. ive did some tinkering and made each script (+ 1 to a queue variable) it does not matter to me how this looks, missionNamespace setVariable ["queue", 0]; allunits apply { while {alive _x} do { _queue = missionNamespace getVariable "queue"; if (_queue >= 10) exitWith {}; missionNamespace setVariable ["queue", (missionNamespace getVariable "queue")+1]; while {what ever is true} do {what ever is here does not matter. its just a concept}; missionNamespace setVariable ["queue", (missionNamespace getVariable "queue")-1]; }; };
  9. When i wrote that, i didnt know if i wanted to return an array of all empty or just one. Sorry for confusion. To answer that i just want one returned. 5 mins after writing the thread, i did away with apply. !alive gunner _staticWp Easier to read. There are many different ways of writing code. then there are better ways
  10. _weaps = nearestObjects [(getPos player),["StaticWeapon", "StaticATWeapon","StaticCannon"],50]; _crew = fullCrew [_weaps select 0, "gunner", true]; _crew apply {if (isNull (_x select 0)) exitWith {true}; if !(alive (_x select 0)) exitwith {true}; false; }; I made this with the intention to find static weapons. it works but I was wondering, when returning false it returns false as an array like [false]. im sure I am missing something here, but why is it returning an array with false in it? also 1 side note. why does fullcrew return dead crew members?
  11. why not benchmark the scripts using the performance button in the console. its the speedometer looking icon. Just set the skill and get/setloadout when creating the unit. No need to loop set skill. Waituntil {sleep 5; count (allunits) >= 8}; {_x setskill 0.5;}foreach allunits select {side _x == east /* != playerside !=player */}; or just setskill when each unit is created. allunits select {side _x != player} apply {_x addEventHandler ["---", { params ["---", "---"]; _unit setskill 0.5;}];};
  12. better yet _eh = nearestObjects [player, ["house"], 200]; {{arrow = "Sign_Arrow_F" createVehicle [0,0,0]; arrow setPos _x}foreach (_x buildingPos -1); _he = _x buildingExit 0; arrow = "Sign_Arrow_F" createVehicle _he; } foreach _eh;
  13. you could use buildingexit to find all the door to breach. _eh = nearestObjects [player, ["house"], 20]; _he = _eh select 0 buildingExit 0; arrow = "Sign_Arrow_F" createVehicle _he; use this in the debug console to find the doors
  14. used _unit variables to store time between stance changes and firednear EH timeouts to avoid adding and removing EHs.. this one finds objects close to unit and changes stance
  15. if (player getVariable ["FIREDLOCKOUT",[true,-1]] select 0) exitWith {hint "hi";}; if (player getVariable ["FIREDLOCKOUT",[true,-1]] select 0) exitWith {hint "hi";}; 1st one was written in sublime text editor using the sqf syntax, 2nd using notepad++ why does it do this
  16. scripted the statement on a mac then switched to windows to test. clicking EOL conversion> Macintosh (cr) in notepad++ fixed the problem.
  17. put ctrlSetText in a loop
  18. sabot10.5mm

    GUI on top

    https://translate.google.com/translate?hl=en&sl=fr&tl=en&u=https%3A%2F%2Farma409626711.wordpress.com%2F2018%2F01%2F24%2Fscripting-tutorials-gui-part-2%2F
  19. I like this script and I'm tying to implement a reveal increment number, but I get the weirdest error code I have ever seen Error Type Number,Not a Number, expected Number fired1 = true; _1=0; while {true} do { sleep 5; _1=_1+0.1; if (fired1) then {//hint "hi"; fired1 = false; player addEventHandler ["fired",{ params ["_firer"]; { _x reveal [_firer,(0.2)+_1]; } forEach (allUnits select {_x distance2D _firer < 200}); _firer removeEventHandler ["Fired",_thisEventHandler]; fired1 = true; }]; }; }; is there a better way of doing this
  20. sabot10.5mm

    Enemy occupation system (eos)

    modified eos to save vehicle type and vehicle damage eos_launch eos_core eos_spawnvehicle
  21. According to larrow, you can't whitelist arsenal without first spawning arsenal with no gear and adding gear back into it.
  22. sabot10.5mm

    Enemy occupation system (eos)

    edited the eos_core.sqf to save vehicle damage and then set the damage on spawn. Works for armored vehicles only atm. Since the script spawns random vehicle types, damage array may be different type from last. Wheeled damage array vs tracked. I will try to save vehicle type before cache. thanks for the help @Grumpy Old Man
  23. I'm trying to get the hitpoint damage when caching every vehicle, then set the damage when vehicle spawned. script comes up with error _hitpnt=getHitPointDamage ;_x; is it not possible to put 2 magic variables in a foreach? _dgroup select 0 is the vehicle spawned if (isnil "_dGrp") then {_dGrp=[];_vehdmgrp=[];_vehdam = [];}; _newpos=[_mkr,50] call EOS_fnc_findSafePos; if (surfaceiswater _newpos) then {_vehType=8;}else{_vehType=2;}; _dGroup=[_newpos,_side,_faction,_vehType]call EOS_fnc_spawnvehicle; 0=[(_dGroup select 2),"ARMskill"] call eos_fnc_grouphandlers; 0 = [(_dGroup select 2),_mkr] call EOS_fnc_taskpatrol; _dGrp set [count _dGrp,_dGroup]; if !(isnil "_vehdam") then {(_dGroup select 0) setHitPointDamage (_vehdam deleteat 0);}; "_vehdam select 0" should have all the damage to set for the command {_vehicle = _x select 0;_crew = _x select 1;_grp = _x select 2; if (!alive _vehicle || {!alive _x} foreach _crew) then {_dGrps= _dGrps - 1;}; {deleteVehicle _x} forEach (_crew); if (!(vehicle player == _vehicle)) then {{deleteVehicle _x; _hitpnt=getHitPointDamage _x; _vehdam=set[count _vehdmgrp,_hitpnt];} forEach[_vehicle];}; {deleteVehicle _x} foreach units _grp;deleteGroup _grp; }foreach _dGrp;
  24. sabot10.5mm

    help with foreach

    yeah but 90% of the code is from EOS . just wanted to getdamage of vehicles before they are cached and set the damage when they are spawned. these vehicles have nothing to do with player they are spawned via EOS. this is all still learning experience for me
  25. sabot10.5mm

    Enemy occupation system (eos)

    made an EH that activates if player fires a shot. all groups around player that are atleast 200 meters away will converge around the player based on relative dir. the rest of the groups will carry on with their patrol fired1 = true; while {true} do { sleep 5; if (fired1) then {hint "hi"; player setvariable ["MyFiringEH",99]; fired1 = false; eventHandlerID2 = player addEventHandler ["fired", { hint "shot"; [] spawn{ _wp0 = ""; {if (side _x isEqualTo EAST && (((units _x) select 0) distance player) < 200 ) then {_dir = ((units _x) select 0) getRelDir player; _start = position player; _dist = 20; _pos = [(_start select 0) + cos _dir * _dist, (_start select 1) - sin _dir * _dist, 0]; {deleteWaypoint _x} foreach waypoints _x; sleep 0.3; if ((count (waypoints _x)) < 1) then{ _wp0 = _x addwaypoint [_pos,5]; _wp0 setwaypointtype "Move"; _x setBehaviour "combat"; };}; } foreach allgroups; };player removeAllEventHandlers "fired"; fired1 = true;}]; }; }; had to edit it, since it created waypoints == to the amount of all groups counted I don't know if "move" is better for this? fired1 = true; while {true} do { sleep 5; if (fired1) then {hint "hi"; player setvariable ["MyFiringEH",99]; fired1 = false; eventHandlerID2 = player addEventHandler ["fired", { hint "shot"; [] spawn{ _wp0 = ""; {if (side _x isEqualTo EAST && (((units _x) select 0) distance player) < 200 ) then {_dir = ((units _x) select 0) getRelDir player; _start = position player; _dist = 20; _pos = [(_start select 0) + cos _dir * _dist, (_start select 1) - sin _dir * _dist, 0]; //{deleteWaypoint _x} foreach waypoints _x; sleep 0.3; //if ((count (waypoints _x)) <= 1) then{ /*_wp0 = _x addwaypoint [_pos,5]; _wp0 setwaypointtype "Move";*/ _x move _pos; _x setBehaviour "combat";}; } foreach allgroups; };player removeAllEventHandlers "fired"; fired1 = true;}]; }; };
×