Jump to content

alarm9k

Member
  • Content Count

    69
  • Joined

  • Last visited

  • Medals

Everything posted by alarm9k

  1. Download: v.1.8 From Dropbox v.1.8 From Armaholic Description: Have you ever been irritated by stupid far from optimal AI controlling the tank and being destroyed by one RPG shot in the rear? Only because it didn't bother to rotate the hull to that AT soldier? Or because it was firing at a harmless rifleman instead of taking care of enemy APC? Well, this script is for you. Features: Vehicles assess the threat/value of the targets and fire at the most dangerous/valueable target it range. It will prefer AT rifleman over autorifleman, tank over MRAP etc. Threat and value calculations use the type of target, distance and ammo types available (for tanks only). For example: AT rifleman 700m away is a more valuable target for the tank than MRAP-HMG at the same distance, but only if the tank has HE rounds. Otherwise it will prefer to fire AP round at MRAP, as the infantry unit is unreachable with current weapons. But AT rifleman still remains more dangerous than MRAP. Tanks will use appropriate rounds (if available) for different types of targets: HE for infantry and static weapons, HEAT for lightly armored targets (MRAPs, trucks), AP for heavily armored (tanks, APCs etc). Tanks will identify groups of infantry and use HE rounds agains them. A group is 3+ men in 15m radius. By default the tanks will not spend HE rounds on a single infantry unit (unless it's a high-threat AT soldier). If the vehicle is a tracked vehicle (tank, tracked APC etc), it rotates the hull to face the most dangerous target. If the threat is too high (for example an AT soldier at a close range), the moving vehicle will stop immediately, rotate the hull and fire. When the immediate threat is eliminated, it will proceed with the previous move order. This will presumably save the vehicle in situations when a hit is inevitable and the best decision is to stop and take the hit to the frontal armor rather than continue moving and take the hit to the side/rear. Notes: It does not cheat and it uses line of sight calculations and perceived position of the targets. So the tanks will not fire at and rotate to the targets they don't know about. Only tracked vehicles rotate the hull. Target assignment works best with MBTs (Slammer, Varsuk) as they switch targets immediately. With APCs and MRAPs there can be a delay before they leave that poor rifleman alone and target an AT soldier. Real Armor Mod or a similar one is highly recommended. I haven't found a way so far to override default behaviour in ATTACK (Engaging) mode, so when Engaging the vehicle will not stop, rotate etc. Currently 'smart' behaviour covers all ground vehicles that have weapons, from all factions, found in game. There is no separate config file to include/exclude particular vehicles/types/factions for now. It will be implemented later though. The vehicles list is hardcoded for now, which means that addon doesn't cover modded vehicles that have non-standard types and names. Installation: Unzip the archive Put the @smarter_tanks folder into your Arma3 folder (usually C:\Program Files (x86)\Steam\steamapps\common\Arma 3\) Usage: Some of the use cases below assume that the vehicle is in the player's group and the player can issue direct commands to the vehicle's crew, which is not always the case. If it's not then some of the options won't be available: for example, changing default round type. Smart behaviour is activated automatically if the vehicle has an AI crew. This includes the vehicles created with the crew inside, or empty vehicles occupied after the mission start etc. Smart behaviour is activated for all factions and all groups: AI groups, vehicles in the player's group and High Command. If either gunner, driver or commander is a human player, the smart behaviour is suspended and manual control is assumed. If the human player is replaced by AI at any moment, the smart behaviour is re-enabled. Vehicle commander's behaviour must be either Stealth, Aware or Combat. To disable 'smart' behaviour set the commander to Relaxed. This is just a sort of 'switch' for dynamically enabling or disabling the smart behaviour during the mission, until I implement a separate action menu. To disable hull rotation but keep picking priority targets issue a Stop order (Action menu 1-6). The vehicle will go into Waiting state. To resume full 'smart' behaviour, including hull rotation, issue a Move order at the vehicle's current location: the vehicle will not actually move but will go into Ready state. If you don't want the tank to halt after encountering an immediate threat, set the commander's behaviour to Stealth. It will continue to execute its move order regardless. For tanks there is such thing as 'default round type'. Tanks start with AP as the default. Tanks will have default round loaded unless they fire at a different type of target. If you manually give the tank commander to 'Reload HE-T`, the HE round will become default. Having HE as default makes the tanks fire HE rounds at single infantry units (not only groups). So if you expect armored targets around, its a good idea to have AP as default, as the tanks will have AP loaded and won't waste time reloading the round. If, however, you want the tanks to use cannon against every soldier they see, make HE default. Manually ordering the tank to target an infantry unit (action menu 2-x) will make him use HE round against assigned target, even if it's not a group of infantry. Changelog: v.1.8 -Fixed: commander stuck watching the same direction forever after has been given doTarget order. -Fixed: 'lazy' target switching. Will now immediately switch to more valueable target. -Fixed: setup.sqf non starting for vehicles with non-standard names (modded). Should now work for any vehicle that has weapons (list of weapons is still hardcoded though). -Fixed: small fixes here and there. -Added: vehicle commander (or gunner, if no commander) will 'scan the horizon' for targets when idle. Commander will use his optics independently of gunner's main turret. v.1.7.1 -Added public key to archive (forgot to do that) v.1.7 -Hardcoded unit classes replaced with dynamic threat assessment based on available weapons: both target and our vehicle (a 'sniper' infantry class that has aquired AT launcher will be given threat value as an AT rifleman). Should now work with modded vehicles with non-standard names, as long as they belong to standard base classes (Man, Car, Tank etc) and use standard weapons names. -Tanks will fire HE rounds at helicopters. -Added signature. v.1.6 -Fixed multiplayer bugs (locality shifts). Now works properly in multiplayer and on dedicated server. -Small bugfixes v.1.5 -Improvements to targeting algorithm. -Tanks load appropriate rounds for different target types. -Tanks identify groups of infantry and use HE against them. v.1.4 Distributed in a form of addon now. v.1.3 Smart behaviour is now determined by the commander's combat mode, not driver's. This way tank's driver can be set to RELAXED (to stick to roads while moving) without disabling hull rotatation and target aquisition. v.1.2 -Fixed: doesn't require human player in faction any more for the script to work. v.1.1 -Added compatibility with High Command. -Small fixes v.1.0 -Initial release. License: Do whatever you want with this script. Even claim it your own if you really need to. Credits and thanks: This script could not be made without the help of my wife Natalie. She kindly didn't interfere in exchange for my promise to mention her in the credits :)
  2. I have a simple script that moves units from human player's group to High Command. It selects all units from team WHITE and moves them to a new group: _selected join _newGroup; and then does HC stuff which is irrelevant here. Before the latest patch (1.34) it all worked fine: AI units that were spawned outside the vehicle and ordered to enter it (commander, gunner, driver) remained at their positions after being moved to a new group. After the patch they exit the vehicle! This is only true for the AI what were initially spawned outside. If I spawn a vehicle with the crew inside that belongs to player's group, they stay inside after being moved to another group. I cannot understand what causes their different behaviour. Does anyone know?
  3. The HC groups stop following me after the respawn in MP :(
  4. alarm9k

    Linux 1.54 no 5.1 sound

    Basically the subject says it all. After updating to 1.54 the sound became a stereo downmix. Rear sounds are played in the front speakers :( Anyone else?
  5. I am looking for a way/hack to override the vehicle's behaviour triggered by manually assigning a target and giving an "Engage" or "Engage at will" order. When engaging a target the unit will usually move around. I need to make the vehicle stop, while still being able to fire, target and obey move commands given via scripting. I performed all my tests using a Slammer tank. What I have tried so far: doMove and moveTo commands have only temporary effects, the tank does move into position but then resumes engaging immediately, its state remains "Engaging"; doStop command has no effect on a vehicle that has "Engaging" state; setCombatMode "GREEN" has no effect, currentCommand still returns "ATTACK"; doTarget objNull, doFire objNull etc have no effect either; Any ideas?
  6. alarm9k

    Linux 1.54 no 5.1 sound

    Oh yeah, clicking static sounds here as well with Xonar DX.
  7. I'm trying to load CBA 2.2 on Linux client, which is 1.42 at the moment. I'm getting a lot of syntax errors in RPT, like: params ["_unit","_item"]; if (typeName _unit !=> 8:51:31 Error position: <["_unit","_item"]; if (typeName _unit !=> 8:51:31 Error Missing ; 8:51:31 File x\cba\addons\common\fnc_addMagazine.sqf, line 11 8:51:31 Error in expression < 'cba\common\addMagazine'; I looked up fnc_addMagazine.sqf and the code there seems absolutely fine. What can be the problem? Thanks.
  8. Before the latest patch to turn left in the ground vehicle I had to: move the mouse left to turn the steering wheel left move the mouse right to return the wheels to the neutral position when the turn is complete Now I have to constantly move the mouse left to keep the wheels turned left. The same moment I stop moving the mouse, the wheels return to the initial position. Is it a bug or intended behaviour? And if the latter then what on Earth was the reason to do that?
  9. If you ever wanted to demonstrate to someone the importance of regression testing, then Arma is a perfect example. :D
  10. alarm9k

    Smarter tanks script

    The script currently does not affect vehicles with human crew members.
  11. I don't think I will get back to Arma any soon, so let someone else create a bug report. Got very tired of these little annoyances the game introduces with almost every update and the amount of dirty hacks you have to invent to script something decent. I am afraid of getting used to the terrible coding style that Arma is trying to impose on me. Gone to play chess! The game doesn't receive many updates, but it doesn't have regressions either :D
  12. Not HC. They misbehave either with or without HC, just upon entering new group. Well... why not.
  13. I did, I did.... Don't remember why I did this. I might have had a reason... probably :)
  14. What you suggest may be faster but... it won't have the same functionality. I use my script to move units to and from High Command in single player missions. Just to... make it easier for myself to command the AI around. I occasionally add it to 3rd party SP missions and play them that way. The whole script is just 18 lines of code: add_to_hc = { private ["_newGroup", "_selected"]; _newGroup = createGroup playerSide; _selected = []; { if (assignedTeam _x == "MAIN" and _x != player) then { _selected = _selected + [_x]; }; } forEach units group player; _selected join _newGroup; // <-- Here they exit the vehicle! player hcSetGroup [_newGroup]; }; hcRemoveAllGroups player; player addAction ["Add Team White to HC", add_to_hc, [], 0.02]; player addAction ["Remove Team from HC", "hc\del.sqf", [], 0.01]; As you can see, it's simple, it does not alter or replace units and it gets (well, it did before) the job done. Deleting units and spawning them again inside the vehicle... would require a lot more code, if we wanted to keep the same functionality. I mean, if I order a sniper team to enter a Hunter, make them a separate HC group and order them to move 5km into position, I want them to be exactly the same sniper and spotter with the same rifles, ammo, radios, grenades and mines -- not some general crewmen.
  15. Yes, sure... but every dirty hack like this one adds too much overhead: need to save units' loadout, health values etc to spawn exactly the same unit as a crew member. Anyone looking at the resulting code would be terrified (facepalm)
  16. Well, that was the question itself: what command sets this value (if it does exist) and how to read it. I have tried all reasonable comibinations of "assignAs", "addVehicle" etc to _assign_ this mysterious property, and all kinds of "assignedVehicle", "assignedVehicleRole" etc to find the difference between two groups behaving differently. To no avail. And yes, I move units from my group to a newly created empty group.
  17. alarm9k

    Smarter tanks script

    BTW just did a quick and simple performance testing (quick because of lack of free time, haven't done before because of messy development style). Those of you who were concerned about the mod being performance friendly (including myself), rest assured -- seems like it is... mostly. Test: -created in Editor, run in Preview -standing in the middle of Altis big dry lake -40 tanks with AI crews standing far beyond the view distance -no enemy targets Result with addon enabled: 65 fps. Result with addon disabled: 67 fps. Of course with multiple targets know to each of the tank the result would be different, but not drasticly because the idle loop includes most of the checks anyway. Run on i7 3770K@4.5, measured with Fraps.
  18. alarm9k

    Smarter tanks script

    I don't know much about Iron Front. Is it Arma2 Iron Front? Anyway, since version 1.8 the only hardcoded things remaining are: Whether the vehicle is a tracked vehicle is determined by its parent "Tank" class. Weapon turret paths: [0], [0,0], [-1]. Weapon names, to calculate threat from the particular weapon General target classes (CAManBase, Car, Tank etc), to determine what can be damaged by particular weapon to prevent firing MG at tanks. That's it... I think. If the things above are not modified in your mod then it will work. If not, then you'll have to make adjustments to the script code. Oh... and if Iron Front is an Arma2 mod, then... it may not work due to using the scripting commands available only in Arma3.
  19. alarm9k

    Smarter tanks script

    New version 1.8 is available. v.1.8 -Fixed: commander stuck watching the same direction forever after has been given doTarget order. -Fixed: 'lazy' target switching. Will now immediately switch to more valueable target. -Fixed: setup.sqf non starting for vehicles with non-standard names (modded). Should now work for any vehicle that has weapons (list of weapons is still hardcoded though). -Fixed: small fixes here and there. -Added: vehicle commander (or gunner, if no commander) will 'scan the horizon' for targets when idle. Commander will use his optics independently of gunner's main turret. P.S. There is a trade-off though: commander's automatic 'scan the horizon' feature will reset gunner's 'Watch direction' orders (if any) from time to time.
  20. alarm9k

    Smarter tanks script

    Sure, I know what causes that. Will fix that in a couple of days.
  21. Hey. Was just browsing around and saw your discussion about: Here's my two cents. moveTo only works when executing doMove command, at least for vehicles. First you have to issue doMove, and then you can set a new destination using moveTo. Strange behaviour, but... what did we expect? It's Arma scripting *facepalm*
  22. alarm9k

    Smarter tanks script

    Silly me, I thought my public key was included in the signature file. Version 1.7.1 includes public key.
  23. alarm9k

    Smarter tanks script

    New version available here. v.1.7: Hardcoded unit classes replaced with dynamic threat assessment based on available weapons: both target and our vehicle (a 'sniper' infantry class that has aquired AT launcher will be given threat value as an AT rifleman). Should now work with modded vehicles with non-standard names, as long as they belong to standard base classes (Man, Car, Tank etc) and use standard weapons names. Tanks will fire HE rounds at helicopters. Added signature.
  24. Mouse is analog and by definition is more smooth than jerking the vehicle left and right with key presses. It lets (well, it did before the update) to steer just like in real life.
  25. alarm9k

    Smarter tanks script

    I guess you mean "...noT what we're..." Well.. that's not as obvious as it seems. Current behaviour makes the AI tanks too underpowered compared to human players, who can use ARMA's (doubtful) thermal view and spot infantry from 1500 meters. BTW, spotting is one thing. There is also 'aiming'. The tank may know about the target and see it but may not be able to reliably target it. Sometimes it takes the tank gunner quite a while before he actually fires at the target, even though he has his cannon aimed at it. And I didn't even try to tinker with that either.
×