Jump to content

Harzach

Member
  • Content Count

    4933
  • Joined

  • Last visited

  • Medals

  • Medals

Everything posted by Harzach

  1. That said, maybe something like _list = allUnits - (list trigger);
  2. As it should - list will only return units in the trigger that meet the trigger conditions. In the case of "not present", you will get the same results as with "present".
  3. Alrighty. //get marker info _center = getMarkerPos "center"; _radius = (getMarkerSize "center") select 0; //get random entry/exit points on perimeter of circle _r1 = round (random 359); _rand = round (random 90) - 45; _r2 = (_r1 - 180) + _rand; _pos1a = _center getPos [_radius, _r1]; _pos1b = _center getPos [_radius, _r2]; //get start/end points outside circle _dir1 = _pos1a getDir _pos1b; _dir2 = _dir1 - 180; _pos2a = _pos1a getPos [2000, _dir2]; //change "2000" to whatever value works for you _pos2b = _pos1b getPos [2000, _dir1]; //same //get random drop point inside circle with 10% radius buffer to prevent drop too close to perimeter _dropRange = _pos1a distance2D _pos1b; _buffer = _radius/10; _dropRange = _dropRange - _buffer; _distDrop = round (random _dropRange); _posDrop = _pos1a getPos [_distDrop, _dir1]; As with all code I share here, it's a hamfisted approach, but it works: _pos2a is the start (spawn) point, _pos2b is the end (despawn) point, and _dropPos is the drop position. _pos1a and _pos1b (the markers on the circle perimeter) are only used in determining the other positions. You could use isFlatEmpty or BIS_fnc_findSafePos to check if the drop position is over water, and then make the script iterate until it isn't, but that still won't guarantee that the drop won't float with the wind out over water anyway. There is probably a way to force the drop to ignore wind, but I've never looked into such a thing. I'm going to sleep now. Have fun!
  4. It's not perfect by any means, and in fact must be fixed for when the circle gets smaller than a few thousand meters in radius, else the plane could end up outside the circle entirely. Redo!
  5. We're kind of reinventing the wheel here, but... I assume there will be a visible circular marker on the map that resizes during gameplay to show the play area. Let's call this marker "center". Now that it exists and has a name, you can move it around and resize it as needed using setMarkerPos and setMarkerSize. When you want to spawn a supply drop plane, try something like this: //get position of marker _center = getMarkerPos "center"; //get radius of marker _radius = (getMarkerSize "center") select 0; //arbitrary distance outside marker to prevent "pop-in" of plane when spawned _dist = (_radius + 2000); //random start and end positions _r1 = round (random 359); _rand = round (random 90) - 45; _r2 = (_r1 - 180) + _rand; _pos1 = _center getPos [_dist, _r1]; _pos2 = _center getPos [_dist, _r2]; So, _pos1 is a random position somewhere 2000 meters outside the circle, while _pos2 is a position +/-45 degrees from its antipode. A line segment connecting the two will cross a fair portion of the circle without necessarily crossing the center point, introducing some unpredictability. Now you just need to spawn your plane at _pos1 and give it a waypoint at _pos2. You can delete your plane when it completes that waypoint or whatever. Also, you might want to setDir your plane on spawn so that it is pointing the right way: _dir = _plane getDir _pos2; _plane setDir _dir; Dynamic systems like this are fun to work with, and once you get it figured out you can do a lot with them.
  6. It was the only relevant solution I could find. Perhaps it is not possible.
  7. Harzach

    Swivel Target

    Ah, yeah. I guess there's a locality issue with moving target types. I can't get it to work on dedi, trying a few different methods/localities.
  8. Harzach

    Swivel Target

    Works fine for me, how are you spawning it? Share your code.
  9. OK, I had to add "sideEmpty" to the spawn line, which is fine. This is sort of a TDM tank battle I have put together for my group as a warm-up before operations and for teamwork/communication training. Each side gets four tanks with unlimited respawns, so there's no endgame. The "sideEmpty" will be necessary as players tend to bail upon receiving critical damage as a matter of reflex. I guess this issue is sorted, but there may be another. I have a modded version of this mission using ACE/RHS (the actual reason I came looking this scripted respawn solution), and my first test exhibited multiple problems. Again, likely things on my end, so I'll have to build a repro version. Thanks again!
  10. I'm getting inconsistent results now, and I know my methodology is at least a part of the problem. I need to create a proper repro mission.
  11. Getting an error now, line 62: undefined variable in expression: _cont My spawn line is pretty simple: 0 = [[EAST,WEST],["start","start"],5,false,false] spawn MGI_fnc_VehicleRespawn; Works with previous version (minus the original heading). This version respawns the vehicle at death position and then won't respawn the vehicle again.
  12. Harzach

    Hide and reveal markers

    Let's start with sharing how you are accomplishing this, then move forward from there.
  13. Harzach

    Hide and reveal markers

    Instead of removing the marker, you could just change its alpha. https://community.bistudio.com/wiki/setMarkerAlpha
  14. Harzach

    Magazine Names

    Also, if you want to limit the reported magazines for each vehicle to just the type and not the number, for example: [" ||| ","Ifrit GMG","SmokeLauncherMag","96Rnd_40mm_G_belt"," ||| ","Ifrit HMG","SmokeLauncherMag","200Rnd_127x99_mag_Tracer_Green"," ||| ","Qilin (Armed)","500Rnd_65x39_Belt_Tracer_Green_Splash"] you can replace "pushBack" in line 8 with "pushBackUnique": _allMags = []; _sep = " ||| "; {_magsArray = magazinesAllTurrets _x; _name = getText (configFile >> "cfgVehicles" >> typeOf _x >> "displayName"); _allMags pushBack _sep; _allMags pushBack _name; {_mag = _x select 0; _allMags pushBackUnique _mag; } forEach _magsArray; } forEach (allMissionObjects "LandVehicle"); copyToClipboard str _allMags;
  15. And now that I have thought about it for a second, it might be a more complex issue than it first seemed.
  16. Hey Pierre! I'm trying out your script as a solution to the loss of customizations when respawning vehicles and it seems to work perfectly. A feature request: Vanilla vehicle respawn will place a vehicle at its start position and facing its original direction. This is fairly important for missions where a motor pool might be placed in and around vehicle sheds/other structures/objects. Your script seems to only run getDir on the destroyed vehicle, so when respawning at "start" pos, it is facing the direction it was facing when destroyed. I could probably hack a fix in for myself (give me a few days :D), but this is a functionality that I think others might also appreciate in your fine script. Thanks again, you're a treasure!
  17. Harzach

    Noob Question

    Arma is a sandbox. You can play singleplayer missions by yourself against AI, you can have AI fighting with you under your command (or not), and there are full story-driven campaigns to play. Multiplayer can, again, be pretty much any combination of players and AI fighting with or against each other. You have probably seen videos of popular gamemodes like Life/Exile/Wasteland/King of the Hill, but that is really only a glimpse into the possibilities of MP. The only limits are one's imagination, editing/scripting skill, and the game engine.
  18. Harzach

    Editor and mission question.

    https://forums.bohemia.net/forums/forum/154-arma-3-mission-editing-scripting/
  19. Harzach

    Magazine Names

    And of course, this is just the kooky and convoluted method I arrived at. I'm sure there is a far more elegant way to do this.
  20. Harzach

    Magazine Names

    _allMags = []; _sep = " ||| "; {_magsArray = magazinesAllTurrets _x; _name = getText (configFile >> "cfgVehicles" >> typeOf _x >> "displayName"); _allMags pushback _sep; _allMags pushback _name; {_mag = _x select 0; _allMags pushback _mag; } forEach _magsArray; } forEach (allMissionObjects "LandVehicle"); copyToClipboard str _allMags; I placed an Ifrit GMG, Ifrit HMG and Qilin (Armed) on the map. Output was: [" ||| ","Ifrit GMG","SmokeLauncherMag","96Rnd_40mm_G_belt"," ||| ","Ifrit HMG","SmokeLauncherMag","200Rnd_127x99_mag_Tracer_Green","200Rnd_127x99_mag_Tracer_Green"," ||| ","Qilin (Armed)","500Rnd_65x39_Belt_Tracer_Green_Splash","500Rnd_65x39_Belt_Tracer_Green_Splash","500Rnd_65x39_Belt_Tracer_Green_Splash"] For readability (maybe?) I added a separator before each new vehicle displayName. This version does not exclude duplicates in favor of showing exactly which magazines each vehicle holds.
  21. Harzach

    Magazine Names

    Then the method I posted will be what you want.
  22. Harzach

    addAction

    Is this in reference to logged position? That method is WYSIWYG (less azimuth, but then we can always setDir as well), so if you place a unit standing on a platform, that's where they will appear when setPos'd.
  23. Harzach

    addAction

    Also, what HazJ said.
×