Jump to content


  • Content Count

  • Joined

  • Last visited

  • Medals

Community Reputation

1 Neutral

About HereIsJones

  1. HereIsJones

    Positioning Roadside Elements

    I'll check Antistasi out. I originally came up with this for Ravage, but I think it will work with a lot of sandbox mods in general.
  2. I've written a script that spawns random enemy groups around the map (currently testing Altis) and I use BIS_fnc_taskDefend to get them to defend their spawn position. Simply put, my last test went like this - 1 Random enemy group spawned about 6km from my base using BIS_fnc_taskDefend 2 At base, a different random enemy engaged my base guard, a "machine gunner" - my guard won 3 when I went back to check the random group, they had fallen into formation and were running in the exact direction of my base 6km away, with the leader shouting "Engage that machine gunner!". They were already 1km away from their spawn point and clearly ignoring their task of defending their original position. Does anyone know how these two enemy groups "combined" like this? Do they communicate via radio? Is there a way to avoid this, so the first group maintains its defense position? Thanks in advance for any info. EDIT - I thought it might be possible that they were chasing someone else, so I set time to 4x and watched. They ran the 6km and engaged with the machine gunner at my base.
  3. I'm working on some scripts that spawn random encounters (remote insurgent camps, roadblocks, town takeovers etc.). I just finished roadblocks, and now have them positioned center and perpendicular across the road, like: Roadblock Image I mention this, because now I'm trying to generate small "insurgent black markets" on the side of roads, and I'm assuming I'll need to use some of the same functions. The rule I've set is that I need an empty, relatively flat spot just off a road that the market will fit in (about the size of a CH-67 Huron). I'm assuming I can use the following in some order: BIS_fnc_randomPos - find a starting random pos selectBestPlaces - find relatively flat, treeless areas (meadows) BIS_fnc_findSafePos - find a relatively flat grade near the starting pos BIS_fnc_nearestRoad - find a nearby road roadsConnectedTo - find the direction of the road to align the market to it findEmptyPosition - find an empty spot the size of a CH-67 I've been trying for two days, and I can't get it. Has anyone done anything like this? It doesn't help that some of these return an object, some an array and some locations. Thanks in advance for any light you can shine on this. This is the code I've been playing with (doesn't seem to work) - _thisPosList = selectBestPlaces [_thisPos, 800, "(1 + meadow + houses) * (1 - sea)", 15, 1]; _thisPosSelect = _thisPosList select (floor random (count _thisPosList)); //choose a pos and use it to find a road segment _thisPos = _thisPosSelect select 0; _thisPos = [_thisPos, 5, 500, 20, 0, .16, 0, [], []] call BIS_fnc_findSafePos; _thisRoad = [_thisPos, 500, []] call BIS_fnc_nearestRoad; //_thisPos = getPos _thisRoad; //get direction of road segment _roadConnectedTo = roadsConnectedTo _thisRoad; _thisDirection = _thisRoad getDir (_roadConnectedTo select 0); //then maybe something along the lines of - _thispos = _thisPos findEmptyPosition [0, 250, "B_Heli_Transport_03_F"]; EDIT - Actually, I think the real question may be, is it possible to generate a collection of pos that are on road segments, then look at each of those pos to find a segment that has a flat empty spot next to it? EDIT - Ok I think this is it. Procedurally generated roadside market This still needs a lot of error and exception handling added to it, but here it is in all its clunky glory. //find a decent random spot _thisPos = [] call BIS_fnc_randomPos; _thisPosList = selectBestPlaces [_thisPos, 1000, "(1 + meadow) + (1 + houses) * (1 - sea) * (1 - hills)", 15, 1]; _thisPosSelect = _thisPosList select (floor random (count _thisPosList)); _thisPos = _thisPosSelect select 0; //narrow in on road, get road direction _thisRoad = [_thisPos, 300] call BIS_fnc_nearestRoad; _roadConnectedTo = roadsConnectedTo _thisRoad; _thisDirection = _thisRoad getDir (_roadConnectedTo select 0); _marketFacing = _thisDirection; //insert code to look 90 degrees from _thispos _thisPos = _thisRoad getRelPos [15, _thisDirection]; _thisPos isFlatEmpty [5, -1, .15, 10, 0];
  4. HereIsJones

    Not spawning in water

    Ah, thank you for noting how to test, it didn't occur to me. I'll write something that loops markers onto the map. I've been testing one run at a time. 😛 I had to put in nearestBuilding because (on Tanoa at least) the official village pos can be well outside of the village, and the DEFEND group just marches around in a circle without garrisoning because there are no houses. I noticed it's much better in Altis, but I'll look into other options.
  5. HereIsJones

    Scripts Discussion

    Is there a way to programmatically spawn a ZedBlacklist zone via script? I found init_zedBlackList, but I don't know the method to call it, or params it might need. Right now I'm spawning bandit groups at roadblocks/camps that are dynamically generated, and I'd like a zedBlacklist around them, even if it's using the default params like 350m etc. Thanks for your help!
  6. I'm new to scripting, and decided to put together a script to spawn random teams of guerillas in different situations (village incursions, roadblocks, etc.). I've got village incursions working using the CBA Defend module, except I've spawned into coastal waters (off Tanoa) twice now, even though I'm using BIS_fnc_findSafePos. Not sure if this is too contrived, but I only want to spawn in villages, so I'm getting a random pos on the map, then finding a village near it, then converting the village location back to a pos, then finding a safe place to spawn in or around the village location using BIS_fnc_findSafePos. _thisPos = [] call BIS_fnc_randomPos; _thisVillage = nearestLocation [_thisPos, "NameVillage"]; _thisPos = locationPosition _thisVillage; [_thisPos, 10, 50, 5, 0, .25, 0, [], []] call BIS_fnc_findSafePos; Even though I've set waterMode to 0 (can not be in water), my guerillas occasionally end up spawning in the water. Can anyone see what I'm doing wrong? Thx ahead of time. EDIT: Perhaps there is a way to determine the rough center of a village, and spawn there? As long as it doesn't overlap a building. ANOTHER EDIT: Ok, I wasn't assigning _thisPos to the function in the last line. Using this code actually returns good results, but as a new Arma scripter I'm happy to learn a better way. _thisPos = [] call BIS_fnc_randomPos; _thisVillage = (nearestLocations [_thisPos, ["NameVillage", "NameCity", "Airport"], 4000] select 0); _thisPos = locationPosition _thisVillage; _thisPos = nearestBuilding _thisPos; _thisPos = [_thisPos, 10, 100, 2, 0, .5, 0, [], []] call BIS_fnc_findSafePos;
  7. This looks like fun, but your code references "AttachementsStore.sqf" twice, and I can't find it anywhere. Can you point me to it? Sorry if it's obvious, I'm new to this game. Thanks!