Jump to content

jakkob4682

Member
  • Content Count

    252
  • Joined

  • Last visited

  • Medals

Everything posted by jakkob4682

  1. Recruiting scripts rely on proximity of units to your position, and then if a unit is within distance of your position it calls a script that uses addAction. A couple of questions; 1.) are you planning on using the HC module? 2.)do you want to spawn a group or just a couple units? 3.)do you only want certain group types or units spawned if certain condition are true?
  2. i.e. I want to be able to check nearestLocations no matter where I'm at and if I move to another position I want it to update, so that if I get within distance of the location then I can perform another action.
  3. all right so I have another question then.. I have a function that auto populates an area around the town center(CityCenter) of a city when a west unit gets within certain range, basically what it does is gets the number of units and then creates _x amount of ieds in random position within a given radius, and then adds triggers to each ied position to trigger the explosions. However, I've tried using an if-loop, waitUntil{!isNull}, while loops, etc but it either only fires once or it fires indefinitely til the game crashes(stopped using the while loop because of this). So how would I use _CC = locationNull; _nCC = [_x,["CityCenter"],500]; - what kind of loop to do a continous check? and then only fire the ied function only once?
  4. I can find the city center, but the script only runs once and doesn't update. I'm trying to get it to run so that if you go to another town then it'll run the script again. i.e. I have a function made that populates the area of the city center with ied's and spawns a militia squad, but that function only runs once and when I move to another town it doesn't fire again.
  5. This is a script I'm working on, when I spawn the group they fire on each other, please help(no pre-placed enemy units). Also how would I go about finding the nearest city center for any west unit? thanks any help in advance ---------- Post added at 17:46 ---------- Previous post was at 17:35 ---------- halp!!!
  6. thank RYD i'll just make sure to include that in the readme for it. ---------- Post added at 18:37 ---------- Previous post was at 18:25 ---------- one more question RYD how would I get the nearestLocation of each west unit? Also, in its current version if I move to another location will it still work? i.e. spawn the group and ieds?
  7. get out of my thread.... ---------- Post added at 18:20 ---------- Previous post was at 18:19 ---------- RYD another problem, i set side to east, they're now considered hostile but they wont engage me now.
  8. omg i feel stupid, i copy and pasted the example from the wiki and editted it and forgot to change side lol, thank RYD
  9. so in other words I need to create a seperate function that adds units of a certain type and then execute from inside the code block?
  10. I decided just to run it in a loop using nearestLocations, works well(assuming mission isnt loaded w/ addons and/or scripts). Just trying to work out a solution to check nearestLocations for all west units now.
  11. jakkob4682

    AI, Guerrilla Tactics

    another way is using nearTargets and running a check every x amount of time on the threat level(to check when they engage)
  12. I am not sure but I am guessing this thread needs to go in the addon/config forums since it seems to be a configuration question.
  13. find the nearest to any blufor unit within 500 yards, then spawn some ied's with them. when the trigger activates to create the explosion I want to spawn a group nearby to ambush the blufor unit if he is in a group, or spawn an enemy sniper if there's less than x amount of friendly units nearby ---------- Post added at 04:07 ---------- Previous post was at 04:05 ---------- The reason I want to use CityCenter is because I'm trying to make it as generic as I can so its just a plugin script that doesnt require a user defined position. you said not to run it in a loop. so I would just eliminate the while-do loop and call it as a function to make it more efficient?
  14. while {true} do { _westUnits = []; { if (side _x==west) then { _westUnits = _westUnits + [_x]; _townCenter = nearestLocations [getPos _x,["CityCenter"],500]; }; }forEach _westunits; if (!isNull _townCenter) then {} }forEach allUnits; ?
  15. @Panther42 whats the command to find the name of a town?_name = getText(), but theres no citycenter in the config for any of the towns. They do how ever have an area defined in the configs for each town, so I guess that brings up a few more questions. 1. How do you get the name of the current map you're on 2. How do you get the name of a city 3. How do you get the area (I'm not very experienced reading from the configs or getting info from the configs which all 3 of those relate too) 4. Find the center of a circle with the given area
  16. jakkob4682

    Function question

    so if I had a function to find the nearest town and I wanted to get the town so if I had a function to find the nearest town and I wanted to use this function in a different script _nTown = [group] call nearestTown; if (_nTown) then {}?
  17. If I run a function from a different script how do I get the return value from the function? Or do I make the return value global? i.e. instead of _retValue use retValue?
  18. jakkob4682

    Function question

    yes, thank you
  19. how do i get the actual center of the town though? I guess the actual question is how to get the area of the town from config files dynamically
  20. The first one is what I'm looking for, I could set _pos = position player and just run in it from the init.sqf right?
  21. jakkob4682

    Few Questions

    might want to ammend your original post to indicate this is a multi-player issue.
  22. jakkob4682

    Function question

    i get who to call the function passing variable to it... what i mean is for an example like _obj = _this select 0; retValue = False; if (argument) then { //what ever code; retValue = True; }; retValue then in another script can I just use if (retValue == True) then { do something };
  23. /facepalm - such an easy solution thanks again cuel
  24. jakkob4682

    random carbomb script

    ah gotcha, I haven't even started looking at MP scripting yet
×