Zybertryx Posted June 13, 2013 Share Posted June 13, 2013 (edited) I'm curious about the progress made on this front. Is it possible to give aliens new perks that the AI will actually use? And if so, is it possible to give Cryssalids perma Run N Gun so that they're not completely gimped and immersion breaking anymore? I'd like to be scared. Also, I'd love Terror Missions to only spawn Cryssalids. Aliens™ style missions would be really cool. [EDIT] Bah, does Long War 1.8 include Cryssies with Run N Claw already? It's hard to tell if it's simply due to their high imobility (ie: a long distance 'blue move') or if they do indeed possess this perk; Long War Terror Missions are great. [EDIT 2] Further testing indicates that both the Cryssies and the Zombies don't possess it. I would LOVE to give it to them. Edited June 13, 2013 by Zybertryx Link to comment Share on other sites More sharing options...
Amineri Posted June 13, 2013 Share Posted June 13, 2013 I think that what you are asking for is a major undertaking, at least in a technical sense. The process of adding an "active" ability to an alien means adding in new AI code to allow the AI to properly "understand" how the ability works, it's limitations, as well as code to attempt to activate it in appropriate conditions. For the most part that means modifying the AIBehavior class that is specific to that alien. For example, XGAIBehavior_Cyberdisc is an extension of XGAIBehavior that adds/modifies the behavior code for Cyberdiscs specifically. It has functions such as "CanDeathBlossom" "AddPriorityFlightDestinations" that help the Cyberdisc AI utilize some of its specialized abilities. The Run N Gun ability is not one that is currently used by any alien, has to be activated, and has a long-ish cooldown, so figuring out when to activate it would require some significant new code, and there really isn't a place to put it, since we aren't able to add new functions or classes. --------------------- However, there might be a way to achieve a similar effect without actually granting the Run N Gun ability. Sort of giving the Chryssalid a "permanant on" Run N Gun. Generally units have 2 points of movement and 1 point of fire action. A unit's turn ends when it has used either both points of movement or its one fire action point. Bullet Swarm and Double Tap work by making firing actions consume a movement point instead of the fire action point under certain circumstances (for Bullet Swarm it's only if the action was the standard fire action, for Double Tap it must have not used any movement points, and the ability has to come from a restricted list). This all happens in XGAbility.ApplyCost. This is the same place that I juiced up the Smoke Grenade perk (since I've added smoke grenades as an equippable item it needed a bit). This allows smoke grenade throwing to use only a move action if the unit has the Smoke Grenade perk. It work like Bullet Swarm but for smoke grenades (e.g. can throw smoke then move, shoot, hunker, reload, etc). Run N Gun is also implemented here. If the Run N Gun perk is active and the unit dashed, then it causes the unit to only use 1 point of movement instead of 2. If the unit moves once, then moves again, it forces the number of movement points used to be 1. However, it also sets a flag m_bRunAndGunUsedMove = true, and calls XGUnit.BuildAbilities. This is how the set of abilities usable after Run N Gun is restricted, and how a further movement is restricted (the move ability is no longer allowed). -------------------------- So, how to get this type of behavior on Chyrssalids? My basic thought would be to give the Chryssalids only 1 movement point instead of 2 each turn. Then, their movement stat would be tuned appropriately (probably not doubled, but increased). Then, the Chyssalid would always have the ability to take a fire action (using it's melee claw attack) after moving, emulating the ability of Run N Gun. No longer would the Chryssalid be able to double move next to an enemy and not be able to attack. The issue with this is ending the Chyssalids turn. If it's not next to an enemy then it can't use a fire action, and since it only has 1 move action, it can never have used 2 movement points, so the regular unit-end-turn-check wouldn't ever return true. I'm thinking that some specific code for any units with this ability (potentially Chryssalid, Zombie, Muton Berserker). Something along the lines of : if( m_kUnit.m_iMovesActionsPerformed == 1 && m_kUnit.IsMeleeOnly()) { ++ m_kUnit.m_iMovesActionsPerformed; } would limit the unit to only taking one move action, after which, if the unit is a melee unit, it would end its turn. Would have to play around with it a bit to see if it worked, and how the AI behavior changed with only a single, larger move action available. Link to comment Share on other sites More sharing options...
johnnylump Posted June 16, 2013 Share Posted June 16, 2013 Bah, does Long War 1.8 include Cryssies with Run N Claw already? It's hard to tell if it's simply due to their high imobility (ie: a long distance 'blue move') or if they do indeed possess this perk; Long War Terror Missions are great. No -- but Amineri's solution would probably be the way to go. Link to comment Share on other sites More sharing options...
Recommended Posts