Jump to content


  • Content Count

  • Joined

  • Last visited

  • Medals

Everything posted by dwringer

  1. dwringer

    AI Stance question

    The AI has been able to effectively use and shoot from cover since Arma 2, it doesn't require any special scripting; just for their behavior to be set to "Combat" (which happens automatically even when they're in "Aware" when they come under effective fire)
  2. dwringer

    Transition from swim to walk

    Oh man, freaking sweet. Finally we are starting to realize new paradigms thanks to A3 and awesome stuff like this!
  3. dwringer

    if/else not working

    Sounds to me like "ff1grp" is not defined. Check your .rpt file and see if you are getting any specific error messages. I would find the leader of your ff1grp, if its in the editor, and make sure his init says "ff1grp = group this", and then (as Na_Palm suggests) put a waituntil{time>0} or something into the above script to make sure the group has initialized before this script gets called. If this is running inside a trigger you can just make time>0 part of its condition. Forgive me if time>0 isn't the best way (or 100% correct way) to do this ... hopefully this might help
  4. I am wondering if you could use a combination of doStop, setBehaviour, and setUnitPos to get them to stay grouped and stand apart from one another (adjusting setUnitPos with a trigger for once they come into contact with an enemy)? I will check it out today if I get a chance and get back to you.
  5. dwringer

    hud help

    Then instead of defining the stuff as a dialog, it needs to be defined as a display under the RscTitles class. I have only played around a little bit with it, but I'll paste the relevant sections of my definitions below that hopefully illustrate the differences. That was how to define a display resource, such as a HUD. Below is a dialog with essentially the same elements in it: There's actually a much more detailed post on these forums about how to use #ifdef and some other things to use the same source files to define something as both a dialog and a display, but it's beyond the scope of this thread and I don't remember where it is. :) Anyway, where you pull up a dialog with: _handle = createDialog "dialogName"; and end it with closeDialog 0; you would pull up the display resource with: _handle = 0 cutRsc ["dialogName","PLAIN"]; and end it with 0 cutRsc ["Default","PLAIN"]; (assuming you created a default display as seen above)
  6. dwringer


    For sure I have voted this up, and hopefully this gets some more attention ;) TBH this would open up so many possibilities - imagine a multiplayer game mode based on the movie Predator :D But.. considering how many Sam Fisher type missions Arma games have always had, it would be nice to have at least SOME of the same equipment he has, and not just feel like I am just waiting to get lucky with the timing and my choice of Save Games ;)
  7. dwringer

    Tug'o'war style trigger

    Well, the condition to change it from green to red was, I thought, for any OPFOR at all to be present, regardless of BLUFOR, so that condition would need slightly adjusted ;) Anyway, the thing you said about making one trigger reset another is exactly why I was suggesting to check if the marker had already changed color in the trigger conditions. Basically triggers are either one-off, or infinitely repeatable (according to their standard behavior, anyway). Thus we would use infinitely repeatable triggers, but be more selective about what it takes to trigger them :) Sorry it's really late and I don't have much time to look over this but if I get a chance tomorrow I will return.
  8. dwringer

    Tug'o'war style trigger

    In general terms, the solution would be to add a second trigger. Looking at the one there, it is set to fire when there are no "resistance" troops (independent, not opfor), and at least one "west" troop (now also known as blufor for consistency, so i recommend changing that too). What you need is a trigger to fire when there are 1 or more "opfor" troops that changes the thing red. Then, another trigger, which fires when there are 0 opfor troops, to change the marker green. The trigger to turn the marker red must only do so when the marker is not already red, so I would add global variables or find a way to otherwise check the marker color for each trigger. And, of course, the green trigger should only fire when the marker IS red. In the syntax you provided, {(side _x) == resistance} count thisList == 0 AND {(side _x) == west } count thisList >= 1 represents the "conditions" of the trigger - what circumstances under which it will fire, so you want to formulate these sections based on the above constraints. format["""%1"" setMarkerColor ""ColorGreen"";",_x] defines a string of code that executes when the trigger is executed, with the _x going into the place marked %1 and being part of the "foreach" statement enclosing the whole block. (_x represents the current iteration's corresponding array element) I realize this is a lot to take on, but you will learn so much by working this out yourself that I hesitate to try and solve it myself. :cool:
  9. I'm afraid this is untrue, and the original objection is valid. _selection = _array select floor random count _array; would be the correct syntax; "random" always returns a floating point value between 0 (inclusive) and the value passed to it (non-inclusive). Thus, if an array has 4 elements, _array select random count _array would end up as _array select random 4; which then translates to something like: _array select 0; //or _array select 0.4; //or _array select 3.3; floor and ceiling commands serve to round down, or up, respectively, to the nearest integer. Thus, in the case of using "count <array>" you should use "floor", so you now get an integer 0,1,2, or 3 (assuming the above example of the array having four elements). Hopefully this helps somebody at least!
  10. dwringer

    Remove Weapon from Vehicle

    Hmm, very cool; I had a suspicion there was something like that. However I'm afraid it isn't quite the solution I was looking for. I actually want the rockets still there, and I want the hardpoints visible. Because I am still adding weapons to the helicopter, and when I fire they animate coming from those positions. I just don't want the minigun showing up in the list of weapons when i cycle through them, and afaik that still is not possible without removing the gun holders, as you said. But I appreciate the info; A3 has been out for months and I still keep finding commands from A2 I never really knew about, I am screwed when it comes to keeping up with this series :)
  11. Heh no need to credit my suggestion, I didn't plagiarize anybody but I basically copied others when figuring out how to access the configs :) Anyway, to keep this post on topic, I want to point out that my technique will actually not fill the player's inventory with magazines (if the capacity WOULD fill the player's inventory). For example, if the player has room for 9 magazines plus one in the gun, the player will only get 9 magazines. Instead, add just ONE magazine, then add the weapon, then add the remaining magazines - that way you get all 10. This is a minor issue and not really worth coding a solution IMHO. But it is an issue nonetheless ;)
  12. Gah, sorry man! Try this _units = []; _backpackarr = ["B_FieldPack_cbr","B_OutdoorPack_tan"]; _weaponarr = ["LMG_Zafir_F","arifle_Mk20_F"]; _uniformarr = ["U_IG_Guerilla3_1","U_IG_Guerilla3_2","U_IG_Guerilla1_1","U_IG_Guerilla2_1","U_IG_Guerilla2_2","U_IG_Guerilla2_3","U_IG_leader"]; _headarr = ["H_Shemag_olive","H_ShemagOpen_khk","H_ShemagOpen_tan"]; { if (typeOf _x == "C_man_1") then { _units set [count _units, _x]; }; } foreach allunits; if (isServer) then { { _backpack = _backpackarr call BIS_fnc_selectRandom; _uniform = _uniformarr call BIS_fnc_selectRandom; _head = _headarr call BIS_fnc_selectRandom; _weapon = _weaponarr call BIS_fnc_selectRandom; _muzzles = getArray(configfile >> "cfgWeapons" >> (_weapon) >> "muzzles"); _unit = _x; // _x will be superceded, below, so rename it so we can still access it clearItemCargo _x; clearWeaponCargo _x; clearMagazineCargo _x; removeallWeapons _x; removeAllHandgunItems _x; removeHeadgear _x; removeGoggles _x; removeUniform _x; removeBackpack _x; _x addBackpack _backpack; _x addHeadgear _head; _x addUniform _uniform; { if (_x=="this") then { // no longer does _x refer to the unit _mags = getArray(configfile >> "cfgWeapons" >> (_weapon) >> "magazines"); { _unit addMagazines [_x, 10]; } forEach [_mags select 0]; } else { _mags = getArray(configfile >> "cfgWeapons" >> (_weapon) >> _x >> "magazines"); { _unit addMagazines [_x, 10]; } forEach [_mags select 0]; }; } forEach _muzzles; _x addWeapon _weapon; } foreach _units; }; Haven't actually tried this but hopefully you can glean the solution if it doesn't work precisely that way. The problem is, my script only gave it to the player, and I think addMagazines only works on units (not unitArrays)
  13. Hmm, the way I have approached that one is as follows: private ["_muzzles", "_mags"]; //<...> _muzzles = getArray(configfile >> "cfgWeapons" >> (_w select 0) >> "muzzles"); { if (_x=="this") then { _mags = getArray(configfile >> "cfgWeapons" >> (_w select 0) >> "magazines"); { player addMagazines [_x, 1]; }forEach [_mags select 0]; } else { _mags = getArray(configfile >> "cfgWeapons" >> (_w select 0) >> _x >> "magazines"); { player addMagazines [_x, 1]; }forEach [_mags select 0]; }; }forEach _muzzles; In the above, "(_w select 0)" is actually just the classname of the weapon, as a string. "[_mags select 0]" actually only resolves to one magazine, so you only get one added. Just change the quantity used in the "addMagazines" call if you want to add more than 1. The reason for the "foreach" statements is that if you change "[_mags select 0]" to "_mags" it will add one of each type of usable magazine (rather than just the first one found)... although the unit needs carrying capacity or they will not all be added. Hope that's not too confusing, but I'll be glad to clarify anything if you have specific questions. Sorry about the "_w select 0" thing, as I said, just replace that with the weapon classname obtained from your random selection. So if you do _weap = <whatever code gets a random weapon classname>; then replace every instance of (_w select 0) with (_weap). That SHOULD cover it but it only takes the first magazine type found, so if the person who coded the muzzle listed supported magazines out of order, you might get tracers instead of normal rounds (or some such).
  14. I'm afraid I haven't looked over this much at all, but hopefully there is a command that might be of at least some help. If you use "setVectorUp" you can basically align an object's vertical orientation so it is upright (or not). The way to get a piece to be perfectly upright is: object setVectorUp [0,0,1]; This makes the model's "UP" vector correspond to the positive z-axis of the world's coordinates. Essential with static weapons and putting things on roofs, etc.
  15. I am only basing this on the reply that says "you shouldn't use loops that run without any delay in them", with the techniques that I myself use for this issue: if (!isServer) exitWith {}; private ["_veh","_targets","_shoot","_count"]; _veh = _this select 0; _veh setVehicleAmmo 1; _targets = [t1,t2,t3,t4,t5,t6,t7,t8,t9,t10,t11,t12,t13]; _shoot = true; _count = 0; _target = _targets select floor(random(count _targets)); sleep (0.2 + random 0.2); // Multiple scripts now much less likely to compete in the same frame while {(_shoot) and (alive _veh)} do { _count = _count + 1; if (_count == 15000) then { _shoot = false; doStop _veh;}; _veh doWatch _target; _veh action ["useWeapon", _veh, gunner _veh, 0]; sleep 0.05; // assuming the user gets at least 20fps, this almost as fast as visually perceptible. much longer sleep is usually ok. }; EDIT: sorry, i see now after actually reading the code that the firing occurs every cycle of the loop (if possible). Thus the sleep duration I put as 0.05 will give you a firing rate of 20 rounds a second, or 1200 rounds per minute - probably still much higher than the actual rate of fire. Just find what your weapon's intended firing rate is, and use the appropriate sleep value (60/rds per min). There are also commands to order a unit to fire at a target, or to use suppressive fire at a target, but I'm not familiar enough with how they work to see how they may or may not be more suitable here.
  16. Nonsense. Much better simply to extend filenames to 3-4x their original length. Ever since Win95 introduced "long filenames" a filename is like an intro paragraph to a file. That's why MS Word uses the first lines of your papers to title them by default!
  17. dwringer

    if/else problem

    The _null thing isn't really necessary anyway. It makes sense inside the editor, because the engine won't allow unbound return values from init calls or whatever else. i.e., we do it as a convention to suppress the error and name the variable _null or _nil because it is immediately discarded by the game anyway. If you're inside of a script, you are actually binding the variable _null which is treated like any other machine-local variable. This breaks another convention because we generally use underscore (_) to denote a variable local to a particular script, and declared with "private" in the scope where it is used. If you don't need the value, don't assign a variable if you don't have to :)
  18. dwringer

    Return first OR last name of a unit

    You could probably work out a call to BIS_fnc_splitString. something like: _names = [_name, " "] call BIS_fnc_splitString; _firstName = _names select 0; _lastName = _names select 1; (assuming you have only one whitespace with two names). The function is a little tricky because it doesn't use the string provided as a separator; instead it treats each character inside the quotes as a potential separator.
  19. Hi, I'm sorry if this has has already been answered above (I Have looked through but this is a MASSIVE thread), but I'm wondering if the "mirrored" buildings from TKOH can be made to work somehow with this. I have a map that works great except that all the buildings with the mirror finish are invisible except at very close range, where they are a flat unshaded sky color throughout. I forget if the Seattle map is the same. If I simply have configured something wrong, that'd be cool too, but I get a feeling this has to do with the reflective glass texture from the other game not being supported by the A3 engine?
  20. dwringer

    Everon2013 for @A3MP

    Hey man, this really looking awesome. It has come a long way since 2010 or whatever it was, haha. It's funny how tiny the island looks now, considering back in OFP it was, to me, inconceivably huge. I have found one issue; the version I got off the SIX network is giving me a texture error where it's looking for p:\hotze_schilder\data\grau_co.paa (I guess you don't see the error because you have actually got that path, hehe), but it isn't finding it in the pbo :o Thanks for this, though!
  21. dwringer

    Get direction of marker?

    I have indeed struggled with this exact issue and determined that the best solution was to use Game Logic units instead of markers. Although if anybody has further details I would be interested to know as well :)
  22. Sweet, thank you very much! I never even thought about doing it that way, hehe. Although, I should point out that your example does not work either - one problem is that you can't pass an array into a macro AT ALL from what I can tell. The error message is rather confusing: it indicates that something like: dude MACRONAME("Bar","Baz",[_var1,_var2]) expands into: dude dude setVariable [... Why it doubles the word before the macro, I have no idea, thus I am rather confused about the exact behavior (perhaps just something undefined by the devs as a result of stripping the commas from the macro declaration). But, declaring the array first: _varArray = ["An","Array","Of","Stuff"]; dude MACRONAME("Bar","Baz",_varArray) works as well as anything for my purposes. Thanks again!
  23. dwringer

    Beta Dev build or not

    Sorry but this is actually a misunderstanding of what the "Dev" branch is. BIS has stated before that it may include many regressions compared to the stable version, it is simply a build used for testing specific feature sets. It is NOT representative of the current state of the Beta by any means. Some extra features may be there, but many standard features may well be not. Sometimes features have been reverted back even to Arma 2 status.
  24. You might also, alternatively, be able to remove the radio from the AI units, so they cannot communicate with each other. That might actually serve not to propagate knowsabout information.
  25. dwringer


    You might be able to try something like: while {true} do { SPECTATOR_CAM setVectorUp [0,0,-1]; sleep 0.01; }; This may be somewhat effective, but I don't really have time to test nor have I really implemented anything like this on a tight loop so I'm not sure how smooth it will be.