1. We have added a Gift Upgrades feature that allows you to gift an account upgrade to another member, just in time for the holiday season. You can see the gift option when going to the Account Upgrades screen, or on any user profile screen.
    Dismiss Notice

Free XP or promotion level from barracks possible?

Discussion in 'Civ6 - Creation & Customization' started by Tomice, Feb 22, 2019.

  1. Tomice

    Tomice Passionate Smart-Ass

    Joined:
    Oct 5, 2009
    Messages:
    2,313
    Location:
    Austria, EU, no kangaroos ;)
    As in headline:
    Is it possible to recreate the civ5 system of free XP/promotions from barracks and other encampment buildings?
     
  2. Serp

    Serp Prince

    Joined:
    Apr 1, 2015
    Messages:
    579
    It is, but units do not gain any experience while a promotion is available, so in the end olny one promotion is easy possible, regardless if you add 30 or 50 or 100 xp after training.
    What do you want to achieve? There is a natural wonder that provides free xp/promotion to units... not sure if it is from the mod Terra Mirabilis...
     
    Tomice likes this.
  3. Tomice

    Tomice Passionate Smart-Ass

    Joined:
    Oct 5, 2009
    Messages:
    2,313
    Location:
    Austria, EU, no kangaroos ;)
    I described what I want to achieve in the general forum:

    In more practical terms, I want to add free XP or promotions to encampment buildings.
     
  4. Cosmic Fox

    Cosmic Fox Civ 6 Addict - TB Mod Collaborator

    Joined:
    Mar 14, 2009
    Messages:
    453
    Gender:
    Male
    Location:
    Las Vegas
    This is Civ6 a new generation of civ, why do you want to go backwards when Civ6 is far superior to civ5? Civ6 is more like civ4 a really good version that supported modding better. No idea why everyone is so gun ho over civ5. It simply was not that good for long time players at least. I put in 600-800 hours and just did not enjoy it. Civ6 brings fresh experience to the series yet people want to make it like civ5. Hey good luck with your journey. ;) :thumbsup:
     
  5. Serp

    Serp Prince

    Joined:
    Apr 1, 2015
    Messages:
    579
    I asked about what you want to achieve, because of the limitation I told you.
    You can easily make it that way, that every unit gains 1 promotion after construction. But getting more than 1 promotion might be very tricky, since units gain no new XP until you promoted them.
     
  6. CyberChrist

    CyberChrist You caught my attention

    Joined:
    Dec 6, 2001
    Messages:
    1,424
    Location:
    The Matrix
    And here I thought that this part of the forum was about "How to do stuff" and not so much about engaging in 'version crusades', but on the point of Civ6 being more moddable than ever before then that is simply not true. Civ6 is worse than Civ5 when it comes to what you can do from LUA and worse than both Civ5 and Civ4 when it comes to DLL modding - since it is currently not even an option(despite Civ6 having a lot of really stupid hardcoded behaviours that is in dire need of DLL modding). Civ6 do shine when it comes to XML/SQL modding though, so if they ever get around to releasing DLL code then you may end up being right (I certainly hope that you do, but at the same time I won't be holding my breath until it happens).

    What is so wrong about liking certain features from previous versions of the game and wanting to figure out how to implement them in the current game anyway? Isn't that a part of what modding is all about?


    On the point of free promotions then it shouldn't be too hard to rework the method used for Moksha's ability to grant an extra promotion to Apostles and Warrior monks and apply it to a building for the unittypes of your choice. However, please note that Moksha's ability only grant the free promotion after the units levels up normally for the first time (in essence it grants lvl2 promotion for free after you gained lvl1 promotion).

    EDIT: Just took a quick look at Moksha's modifiers and it would appear that it is only possible to apply the free promotion ability to religious units ... yet another example of stupid hardcoding.
     
    Last edited: Feb 23, 2019
    Elhoim and Tomice like this.
  7. Tomice

    Tomice Passionate Smart-Ass

    Joined:
    Oct 5, 2009
    Messages:
    2,313
    Location:
    Austria, EU, no kangaroos ;)
    I do prefer Civ6, especially after RnF and GS, that's why I'm here asking about some tweaks regarding minor details (instead of playing Civ5).
    Regarding my reasons for this specific change, see my last post.

    But there's no example of a building giving a promotion level, right?
    Most of my modding so far has been copy-pasting, I doubt I could create the effect from scratch.

    But nevermind, I doubt only making 1 building give free promotions would fullfill what I wanted to achieve.
     
  8. CyberChrist

    CyberChrist You caught my attention

    Joined:
    Dec 6, 2001
    Messages:
    1,424
    Location:
    The Matrix
    Terracotta Army gives all units enough XP for next level, but it is ALL units and I don't see any immediate way to restrict that to a single city, buildingtype or unittype/-class.
     
  9. Cacophony

    Cacophony Chieftain

    Joined:
    Mar 10, 2019
    Messages:
    1
    I suppose if you could make it so that barracks checked every military land unit for a level and, if it was below level 1, it could add exp to it similar to how Terracotta Army just adds enough XP to each unit to level them.

    You could repeat this with stables/armories/etc.
     
  10. The googles do nothing

    The googles do nothing Prince

    Joined:
    Feb 5, 2017
    Messages:
    318
    Gender:
    Male
    Location:
    Minneapolis, MN
    You might be able to copy the modifier "CITY_DEFENDER_FREE_PROMOTIONS" from GovenorModifers and add it to BuildingModifers
     
  11. isau

    isau Deity

    Joined:
    Jan 15, 2007
    Messages:
    3,052
    I think presumably MODIFIER_CITY_TRAINED_UNITS_ADJUST_GRANT_EXPERIENCE will do this.

    option 1: (doing it for all civs) In BuildingModifiers add a Modifier that uses MODIFIER_CITY_TRAINED_UNITS_ADJUST_GRANT_EXPERIENCE

    option 2: (doing it for just 1 civ) Broadcast it to all your cities using MODIFIER_PLAYER_CITIES_ATTACH_MODIFIER and check with a requirementset if the city has the district/building.
     
  12. Tomice

    Tomice Passionate Smart-Ass

    Joined:
    Oct 5, 2009
    Messages:
    2,313
    Location:
    Austria, EU, no kangaroos ;)
    Thank you for your help! I will see what I can do with the suggestions, but I believe they are above my skill level...
     
  13. Hoo the fool

    Hoo the fool Chieftain

    Joined:
    Feb 14, 2018
    Messages:
    18
    Hello, I finally found this thread! I'm a modding beginner and what I want to make is very similar with this; Giving a free promotion for a specific unit type (Warrior Monk) trained a specific city where a building (Kotoku-in) has been built. Is it possible? On the current Implementation in the vanilla, there is no exactly same thing as far as I know. A Governor, Victor, has similar one, aka. Embrasure, but this doesn't restrict unit type. Any advice would really be helpful for me. Thanks in advance!
     
  14. LeeS

    LeeS Imperator

    Joined:
    Jul 23, 2013
    Messages:
    6,290
    Location:
    Illinois, USA
    Terracotta Army uses the special "-1" usage to "grant experience" to the next level:
    Code:
    	<DynamicModifiers>
    		<Row>
    			<ModifierType>MODIFIER_PLAYER_UNITS_ADJUST_GRANT_EXPERIENCE</ModifierType>
    			<CollectionType>COLLECTION_PLAYER_UNITS</CollectionType>
    			<EffectType>EFFECT_ADJUST_UNIT_GRANT_EXPERIENCE</EffectType>
    		</Row>
    	</DynamicModifiers>
    	<Modifiers>
    		<Row>
    			<ModifierId>TERRACOTTA_ARMY_LEVEL_UP_UNITS</ModifierId>
    			<ModifierType>MODIFIER_PLAYER_UNITS_ADJUST_GRANT_EXPERIENCE</ModifierType>
    			<Permanent>true</Permanent>
    			<RunOnce>true</RunOnce>
    		</Row>
    	</Modifiers>
    	<ModifierArguments>
    		<Row>
    			<ModifierId>TERRACOTTA_ARMY_LEVEL_UP_UNITS</ModifierId>
    			<Name>Amount</Name>
    			<Value>-1</Value>
    		</Row>
    	<ModifierArguments>
    	<BuildingModifiers>
    		<Row BuildingType="BUILDING_TERRACOTTA_ARMY">
    			<ModifierId>TERRACOTTA_ARMY_LEVEL_UP_UNITS</ModifierId>
    		</Row>
    	</BuildingModifiers>
    So @isau 's method #1 (MODIFIER_CITY_TRAINED_UNITS_ADJUST_GRANT_EXPERIENCE ) would ought to work when attached to a Barracks or Stable, for example. Whether the same modifier attached to all of Barracks, Stable, Armory, and Military Academy will work properly to give multiple promotion-choices (and the attendant XP) is the question that would need testing. "RunOnce" would probably not be desired, but is part of TerraCotta Army's modifier because it adjusts experience of all existing units on completion of the Wonder, and it is not wanted to have all units created by that player to forever-afterwards get one free promotion.

    But it appears that COLLECTION_PLAYER_UNITS or EFFECT_ADJUST_UNIT_GRANT_EXPERIENCE or both ignore religious units.
     

Share This Page