1. We have added the ability to collapse/expand forum categories and widgets on forum home.
    Dismiss Notice
  2. All Civ avatars are brought back and available for selection in the Avatar Gallery! There are 945 avatars total.
    Dismiss Notice
  3. To make the site more secure, we have installed SSL certificates and enabled HTTPS for both the main site and forums.
    Dismiss Notice
  4. Civ6 is released! Order now! (Amazon US | Amazon UK | Amazon CA | Amazon DE | Amazon FR)
    Dismiss Notice
  5. Dismiss Notice
  6. Forum account upgrades are available for ad-free browsing.
    Dismiss Notice

Is there a modifier that would allow units to regenerate health in every turn without fortification?

Discussion in 'Mod Creation Help' started by Narvana, Nov 12, 2017.

  1. Narvana

    Narvana Chieftain

    Joined:
    Nov 20, 2016
    Messages:
    43
    Gender:
    Female
    So they would move, attack or pick promotions and still get like +5 health every turn?
     
  2. LeeS

    LeeS Imperator

    Joined:
    Jul 23, 2013
    Messages:
    5,612
    Location:
    Illinois, USA
    There's this
    Code:
    		<Row>
    			<ModifierType>MODIFIER_PLAYER_UNIT_GRANT_HEAL_AFTER_ACTION</ModifierType>
    			<CollectionType>COLLECTION_OWNER</CollectionType>
    			<EffectType>EFFECT_GRANT_HEAL_AFTER_ACTION</EffectType>
    		</Row>
    
    But it is used by Firaxis as part of the effect of a promotion, so you'd have to figure out how to add it to all of a player's units as part of a trait or something similar.

    And I don't know whether it would allow you to pick a promotion and heal on the same turn. And I can't remember whether it needs you to click on "heal" or "sleep" or whatever in the unit's actions box after attacking, moving, etc.
     
    Narvana likes this.
  3. Aldollin

    Aldollin Chieftain

    Joined:
    Mar 7, 2017
    Messages:
    86
    Gender:
    Male
    The mamluk from arabia has that exact ability
    Cant check the name of the modifier right now, but i have used it for a unit as well and it does pretty much what you want (heal at the start of every turn no matter what it did last turn)
     
    Narvana likes this.
  4. Narvana

    Narvana Chieftain

    Joined:
    Nov 20, 2016
    Messages:
    43
    Gender:
    Female
    Ah, unfortunatelly it's used as an effect, so I can't really use it as trait working passively on all my units. :(
     
  5. Aldollin

    Aldollin Chieftain

    Joined:
    Mar 7, 2017
    Messages:
    86
    Gender:
    Male
    You want a civ trait that gives the mamluk regeneration to all units?
    Should be possible using MODIFIER_PLAYER_UNITS_ATTACH_MODIFIER (this is from memory, check if there is no typo)
    With arguments:
    ModifierId = the modifier from the mamluk ability
     
  6. luei333

    luei333 Chieftain

    Joined:
    May 25, 2014
    Messages:
    180
    You can probably just create a dynamic modifier with the effect of EFFECT_GRANT_HEAL_AFTER_ACTION and collection of COLLECTION_PLAYER_UNITS or whatever that collection is. I imagine that would work 100% fine, assuming it's a civ or leader ability. And as far as I think it works, your unit(s) heals every turn, as if they didn't move or take an action on their turn, no matter what they actually do on their turn, or if they're set to fortify until healed, or whatever. Haven't tested, but that's how it worked in Civ 5 I'm pretty sure.
     
  7. criZp

    criZp Chieftain

    Joined:
    Jul 19, 2013
    Messages:
    707
    Location:
    Nidaros, Norway
    Norways leader has ability that give coastal raid promotion to all melee ships

    Now you just gotta find the code, switch the raid promotion to the mamluk promotion, and switch the melee ships class to all military units class (if possible, alternatively copy-paste the melee ship code and replace the melee ship class with other unit classes in each copy)
     
  8. luei333

    luei333 Chieftain

    Joined:
    May 25, 2014
    Messages:
    180
    In response to criZp's posts, not quite. Now that I've learned more about it, here's a more in-depth explanation.

    Units do not have Modifiers attached to them directly. They are either given Abilities or Promotions. The Mamluk, for example, is given its healing after everything as an Ability, but the Ground Crews Promotion for Air Fighters is, well, a Promotion. The difference is that Promotions are what you get when you gain a level, no more, no less. Abilities are given for just about any situation where you need to attach a modifier to a unit. So, the way to properly do it, I think, is to make a civilization trait with the ModifierType of something like PLAYER_UNITS_GRANT_ABILITY, set that ability to have the Modifier of a Type 'MODIFIER_PLAYER_UNIT_GRANT_HEAL_AFTER_ACTION', and then set that ability (in the TypeTags table) to be part of the classes which you want to give it to, so CLASS_MELEE, CLASS_RECON, etc. It won't effect anything of a class other than what you define in that table.
     

Share This Page

Ebates: Get Paid to Shop