Jump to content

jakkob4682

Member
  • Content Count

    252
  • Joined

  • Last visited

  • Medals

Everything posted by jakkob4682

  1. It's just to add suspense to a mission I'm working on lol, and possibly some frustration with rng. Thought I saw somewhere a function to find the nearest enterable building will have to do some more looking into it. Originally I was going to make a secondary explosion nearby the original, so that when the support group/unit gets within range it detonates(IRA style bombing), and then spawn the group nearby to do the ambush. Might have to give up on spawning the group using nearestBuilding. I know how to spawn a group, but how would I reference the trigger that activated to spawn the group?
  2. jakkob4682

    random carbomb script

    what does the RE stand for?
  3. @Horner omg that comment just makes me want to pull my hair... so frustrating when I do that.
  4. another good option for creating an ambush(a little more advanced but more dynamic),look up BIS_fnc_spawnGroup and use that to create group, then in the activation of the trigger, or somewhere in a script waitUntil {sleep5;triggerActivated _trigger};//_trigger = the trigger you created in game(give it a name in the editor) group = [getPos(nearestBuilding _unit), east, character details, relative positions, list of ranks, skill range, ammo count range, randomization controls, azimuth] call BIS_fnc_spawnGroup; group setBehaviour "COMBAT"; group setCombatMode "YELLOW"; the above is scripted, in a trigger it would just be group = [] call BIS_fnc_spawnGroup and you'd use a defined position or another function to create the position in which they're spawned also you need to have the function module on the map(thanks for reminding me horner lol) atleast I believe thats how a little snippet could be used someone could probably make it more dynamic/efficient.
  5. GL4 is also a good AI mod, but it doesnt have the option for creating ambushes.
  6. Cuel I'm using you're little snippett and it works fine, but how would I go about spawning a group nearby the ied after its detonated? As for the nearestBuilding question couldn't I just use nearestBuilding _ied? And thank you for the help, I'm trying to learn by doing, but the extent of what I can learn is limited to my understanding lol.
  7. Without using the artillery module, is there a way to make the ai fire artillery using commandWatch/commandTarget/commandFire combinations? I've tried but can't seem to get it to work. Also can't get the artillery to work using a spawned module with something like _art1 = createSide sideLogic; _arty = _art1 createUnit [type, position, markers, placement, specia] ; _art1 synchronizeObjectsAdd [_arty]; _FM = ["Immediate","HE",1,_roundCount]; [_art1,getPosATL _tgtPos,_FM] call BIS_ARTY_F_executeFireMission;
  8. thank you so much, going to give it a test and see what happens
  9. I know how to create a generic trigger in a script the question was more about how to I create a trigger for each of the ied's created in the original for-from loop? i.e. what variable name do I use to represent each ied? ---------- Post added at 13:50 ---------- Previous post was at 13:42 ---------- The concept of this script is multi-layered, and I'm playing around with different idea's, but at the moment I'm trying to figure out how to: Create dynamic IED's(I've tried reezo's module and it doesn't function 100% of the time, sometimes it doesn't work it all) Create a trigger on those IED's(west present only activation) Spawn a group at the nearest building of the ied location and have them ambush. More to come... as I add more idea's. Only wish I was a well versed scripter :(
  10. ok so another question.... how then would I create a trigger on each of those ied's in a script?
  11. @BlackMamb - As far as I can tell the actual class name is "LAND_IED_V1_PMC" when I use the empty IED's in the editor and use typeOf it returns that. @Galv - I like that snippet, but I'm trying not to have to create a seperate script for it, although I might have to anyways because I'm using the createTrigger from CBA to script the explosions @Ceeeb - Thats exactly what I was looking for thank you.
  12. I have two arrays lets say iedList = nearestObjects [player,["Land_IED_v1_PMC"],500]; and then I want to check the distance between any unit and _x(where _x is any element inside the iedList) how would I do that? Or do I need to write two seperate functions for this?
  13. ok so I have a question about what the topic is about. I've tried using the method in the wiki for spawning the module, the problem is that I am using the dynamic objects compositions for US1_FireBase, and the M119s are empty, however I have a couple preplaced group which call BIS_fnc_taskDefend within the radius of the composition. When I try to debug it using count synchronizedObjects _battery, it returns zero even if I use waitUntil {!isNull gunner _x} for an array that uses [_obj,["M119"],1000]. I don't know if its a problem using dynamic objects or not.
  14. the mlrs has a HUGE range limitation, the best map to experiment on is chernarus from the corners of the map,
  15. this is the code I use to spawn, add magazines and synchronize the M119's in the composition with arty logic private ["_magCount","_grp"]; _grp = _this select 0; pos = _this select 1; waitUntil {!isNil "BIS_Fnc_Init"}; artyGuns = nearestObjects [pos,["M119","M252"],500]; pos = [getPos leader _grp,random 50,random 360] call BIS_fnc_relPos; artyGrp = createCenter sideLogic; artyGrp = createGroup sideLogic; artyVeh = artyGrp createUnit ["BIS_ARTY_LOGIC",getPos leader _grp,[],0,"NONE"]; artyPos = [getPosATL leader _grp,50,random 360] call BIS_fnc_relPos; FireBase = [(pos), (getDir leader _grp), "FireBase1_US"] call (compile (preprocessFileLineNumbers "ca\modules\dyno\data\scripts\objectMapper.sqf")); { if (typeOf _x == "M119") then { _magCount = count Magazines _x; }; }forEach artyGuns; for [{_magCount = 0},{_magCount < 2},{_magCount = _magCount + 1}] do { {artyVeh synchronizeObjectsAdd [_x]}forEach artyGuns; }; nul = [_grp,FireBase] call BIS_fnc_taskDefend; player sideChat "Arty Ready"; I am using this little script for AI arty while {alive player} do { _tgt = objNull; _tgts = player nearTargets 500; { _pos = []; _type = _x select 1; _side = _x select 2; if (_side == east) then { _tgt = _x select 4; _pos = getPosATL _tgt; }; }forEach _tgts; if (!isNull _tgt) then { [artyVeh,getPosATL _tgt,["Immediate","HE",1,2]] call BIS_ARTY_F_executeTemplateMission; waitUntil {artyVeh getVariable "ARTY_ONMISSION"}; player sideChat format ["%1 FFE at:%2",artyVeh,getPosATL _tgt]; player sideChat format ["%1",count synchronizedObjects artyVeh]; player sideChat "Impact incoming"; sleep 5; }; }; when i use the debug message for count synchronizedObjects it returns 0 though
  16. I've gone over the wiki several times trying to figure out how use them to do simple things such as get the type of a certain group, display locations on a map, etc. I am a complete noob when it comes to using the commands that deal with configs though. So if someone would kind enough to give me an example(not out of the wiki) and explain its function such as getText, getArray, configName, I'd be very appreciative. Even if you know of a better guide other than the wiki that'd be awesome if you don't feel like going into detail.
  17. yes but using typeOf _x for a group doesnt work, so I'm guessing using isArray the way to go? ---------- Post added at 03:44 ---------- Previous post was at 03:35 ---------- checking for certain weapons sounds good but dont regular fire teams and machine gun teams both have a machine gunner? or am i mistaken, not sure if the reg fire team has a MG or an AR tbh ---------- Post added at 03:46 ---------- Previous post was at 03:44 ---------- sorry for asking so many question but i'm trying to sponge up as much knowledge I can, and not being an experienced scripter when I look at a complicated script that uses a ton of variables and loops and etc i get lost.
  18. what about if the group is unknown and it enter into a trigger/array area and I want to find out if its a USMC_FireTeam_MG or USMC_FireTeam_Support?
  19. so how would I check if group _x isArray()? ---------- Post added at 03:08 ---------- Previous post was at 03:07 ---------- or should I use isClass instead?
  20. if I use something like _infantry = configName(configFile>>"CfgGroups">>"West">>"USMC">>"INFANTRY">>"FireTeam") _FireTeam = []; //how then would I use this to get either number of USMC_FireTeam groups or to check if a certain is of defined type? { [indent][/indent]if (_x = getArray _infantry) then { [indent][/indent] [indent][/indent]_FireTeam = _FireTeam + [_x] [indent][/indent] }forEach allGroups?
  21. As long as the code is commented I can usually decypher some of the scripts, but some of those commands get pretty complicated for a begginer noob scripter like me. This is great idea.
  22. Basically what the title says. I've tried _airports = nearestLocation [getPos player,["Airport"],20000]; and then I try to select one using _airports select 0 but it says type number expected string in the rpt log
  23. its also giving me this error rror in expression < apmarker = createMarker ["ap",position airport]; "ap" setMarkerType "Ellipse"; > Error position: <airport]; "ap" setMarkerType "Ellipse"; > Error Undefined variable in expression: airport ---------- Post added at 14:30 ---------- Previous post was at 14:28 ---------- ah so I can't use the name _x command on the locations array, thanks was hoping I wouldn't have to get into the configFile thing but looks that way. Thanks for the help
×