Kregano Posted April 14, 2016 Share Posted April 14, 2016 I've been working on a mod to add new GTS abilities and I've stumbled onto a few things:1. Extending the DefaultFacilities.uc file with a copy of the GTS template with new skills added into it adds the skills to the GTS list.2. Sometimes the localization text for a skill unlock will not show up unless you put the ability localization text before it (no idea why it does this).3. Template.ConcealmentRule = eConceal_KillShot; does not work if you want to retain concealment after an attack; research indicates that eConceal_KillShot should allow that.4. Somewhere in these sections of code lifted from Phantom is something that controls whether or not the soldier can overwatch while concealed: Template.AbilityToHitCalc = default.DeadEye; Template.AbilityTargetStyle = default.SelfTarget; Template.AbilityTriggers.AddItem (default.UnitPostBeginPlayTrigger); Effect = new class'X2Effect_StayConcealed'; Effect.BuildPersistentEffect(1, true, false); Effect.SetDisplayInfo(ePerkBuff_Passive, Template.LocFriendlyName, Template.GetMyLongDescription(), Template.IconImage,,,Template.AbilitySourceName); Template.AddTargetEffect(Effect); Effect.bRemoveWhenTargetConcealmentBroken = true; 5. There is no way to separate the disoriented/panicked/stunned effects from mind control - they all count as mental damage (Firaxis should really separate them in the next game). Naturally, I'm going to look for a way to get around the whole "overwatched units don't fire" thing, because that gets in the way of what the ability is supposed to do (maintain concealment if the soldier successfully kills an enemy while concealed). I'll try to use to Effect.ConcealmentRule = eConceal_KillShot; and see if that allows concealment to continue. I'm also curious about how to reverse engineer some of the XCOM:EU/EW skills, like Tactical Sense and Aggression, since they have bonuses that depend on detecting enemies within a certain range, which isn't something any of the XCOM 2 skills do, at least to my knowledge. Link to comment Share on other sites More sharing options...
Kregano Posted April 15, 2016 Author Share Posted April 15, 2016 Did a little testing and managed to add Overwatch to the ability, but only after the concealment broke. I might be able to make it work before concealment breaks by moving it up before Effect.bRemoveWhenTargetConcealmentBroken = true. Link to comment Share on other sites More sharing options...
Kregano Posted April 15, 2016 Author Share Posted April 15, 2016 Moving overwatch before the Effect.bRemoveWhenTargetConcealmentBroken = true line doesn't work, but again, it's not clear why. Effect.ConcealmentRule = eConceal_KillShot also doesn't work, but it's not clear how that works either, because I when I test it in the debug game, every kill shot breaks concealment. Link to comment Share on other sites More sharing options...
swinka6666 Posted April 15, 2016 Share Posted April 15, 2016 (edited) You must enter a post. Edited April 27, 2016 by swinka6666 Link to comment Share on other sites More sharing options...
Kregano Posted April 15, 2016 Author Share Posted April 15, 2016 Changing eHostility did nothing, as far as I can tell, and the StayConcealed effect is super simple (it's a Boolean saying that an individual unit stays concealed), so it shouldn't be the problem. Maybe I should just build a persistent effect and make an event listener to pick up when concealment breaks. Link to comment Share on other sites More sharing options...
Kregano Posted April 15, 2016 Author Share Posted April 15, 2016 (edited) Alright, I'm going to test this code here, which probably won't work, but who knows: static function X2AbilityTemplate Shadowman() { local X2AbilityTemplate Template; local X2Effect_Persistent ShadowmanEffect; `CREATE_X2ABILITY_TEMPLATE(Template, 'Shadowman'); Template.AbilitySourceName = 'eAbilitySource_Perk'; Template.eAbilityIconBehaviorHUD = eAbilityIconBehavior_NeverShow; Template.Hostility = eHostility_Neutral; Template.IconImage = "img:///UILibrary_PerkIcons.UIPerk_phantom"; Template.AbilityToHitCalc = default.DeadEye; Template.AbilityTargetStyle = default.SelfTarget; Template.AbilityTriggers.AddItem(default.UnitPostBeginPlayTrigger); ShadowmanEffect = new class'X2Effect_Persistent'; ShadowmanEffect.BuildPersistentEffect(1, false, true, true); ShadowmanEffect.EffectName = 'Shadowman'; ShadowmanEffect.SetDisplayInfo(ePerkBuff_Passive, Template.LocFriendlyName, Template.GetMyLongDescription(), Template.IconImage,,,Template.AbilitySourceName); ShadowmanEffect.ConcealmentRule = eConceal_KillShot; ShadowmanEffect.bApplyOnMiss = false; Template.AddTargetEffect(ShadowmanEffect); Template.BuildNewGameStateFn = TypicalAbility_BuildGameState; // NOTE: No visualization on purpose! return Template; } Edited April 15, 2016 by Kregano Link to comment Share on other sites More sharing options...
Kregano Posted April 15, 2016 Author Share Posted April 15, 2016 Looks like I found a bugged function: switch( ConcealmentRule ) { case eConceal_NonOffensive: // Always retain Concealment if the Hostility != Offensive (default behavior) bRetainConcealment = AbilityTemplate.Hostility != eHostility_Offensive; break; case eConceal_Always: // Always retain Concealment, period bRetainConcealment = true; break; case eConceal_Never: // Never retain Concealment, period bRetainConcealment = false; break; case eConceal_KillShot: // Retain concealment when killing a single (primary) target bRetainConcealment = false; break; case eConceal_Miss: // Retain concealment when the ability misses bRetainConcealment = false; break; case eConceal_MissOrKillShot: // Retain concealment when the ability misses or when killing a single (primary) target bRetainConcealment = false; Pretty sure those last three bRetainConcealment entries should be "true" instead of "false". I guess no one ever bothered building an ability that used them, so no one noticed the problem. Link to comment Share on other sites More sharing options...
swinka6666 Posted April 15, 2016 Share Posted April 15, 2016 (edited) You must enter a post. Edited April 27, 2016 by swinka6666 Link to comment Share on other sites More sharing options...
Kregano Posted April 18, 2016 Author Share Posted April 18, 2016 Fun little discovery: if you add tech requirements to a GTS ability, the game doesn't know how to display that on the UI, so you have to put it in the localization text. Link to comment Share on other sites More sharing options...
zingfharn Posted April 19, 2016 Share Posted April 19, 2016 Yup, I found that with tech requirements too - you need to put "Needs Laboratory" in the desc, if you want to require a lab, and also show it despite requirements. Link to comment Share on other sites More sharing options...
Recommended Posts