<GameData>
<Building_YieldChanges>
<Update>
<Where BuildingType="BUILDING_STABLE" YieldType="YIELD_CULTURE" />
<Set YieldType="YIELD_PRODUCTION" />
</Update>
</Building_YieldChanges>
</GameData>
<GameData>
<Building_YieldChanges>
<Update>
<Where YieldType="YIELD_CULTURE" />
<Set YieldType="YIELD_PRODUCTION" />
</Update>
</Building_YieldChanges>
</GameData>
i don't, but I wonder if the modifer would work in updated vanilla if there is one?If you have Gaul and Byzantum Pack, yo may try to look how their buff is handled, as they recieve CS per adjacent unit. It's possible there will be somewhere where whether it's enemy or not can be changed.
As I said, that modifies units adjacent to the subject unit, rather than modifying the subject unit itself when it is adjacent to other units, so wouldn't work unless I gave it to every other unit and set it to only buff a specific player's units, which I do not know how to do.Search database for VARU_NEGATIVE_COMBAT.
Oathkeeper Oblivion said:Is there a way to apply a modifier to a unit if they are adjacent to an enemy unit?
i don't, but I wonder if the modifer would work in updated vanilla if there is one?
As I said, that modifies units adjacent to the subject unit, rather than modifying the subject unit itself when it is adjacent to other units, so wouldn't work unless I gave it to every other unit and set it to only buff a specific player's units, which I do not know how to do.
well that's exciting. Let me know if any of it proves true, I'll be testing it myself.I think this should be possible, yes. You're on the right lines regarding the REQUIREMENT_PLOT_ADJACENT_TO_OWNER_AT_WAR - but we'll need to pair it with an appropriate Modifier that impacts the unit in question. I don't think there's an existing base-game ability that has the exact pair of Modifier and Requirements we want.
I am going to have a proper scan later this morning - time permitting - to try and give you a fuller reply. But I would expect that the ModifierType we'll want to use may be MODIFIER_PLAYER_UNIT_ADJUST_MOVEMENT. This, along with a variation of the AOE_ENEMY_REQUIREMENTS SubjectRequirementSetId from the Gran Colombia/Maya DLC should work. Even though they are in DLCs, the RequirementType that they use is from the base-game (Vanilla), which is REQUIREMENT_PLOT_ADJACENT_TO_OWNER_AT_WAR.
Again, don't quote me on this 100% - but I am pretty sure it should be possible to configure.
Oh, so it is supposed to work this way. I tried to do this to change one unit prereqtech to another, so that every unit unlocking on one tech would move to the other. That should not give any such non-unique row problems, and actually it didn't. It just didn't work.But you have to be careful with this sort of update to ensure you do not create rows with duplicated info. Table Building_YieldChanges for example will not allow two rows that both have BuildingType="BUILDING_STABLE" and YieldType="YIELD_PRODUCTION". I did not check whether or not the Stable building already has a row with "YIELD_CULTURE", but it does already have a row with YieldType="YIELD_PRODUCTION" so if the update were to otherwise succeed (ie, find a row in the table where the BuildingType is BUILDING_STABLE and the YieldType is YIELD_CULTURE), attempting to alter this row to use YIELD_PRODUCTION instead would cause a unique constraint error and the Update would not be accepted by the game and anything further within the same XML file would be ignored as well.Code:<GameData> <Building_YieldChanges> <Update> <Where BuildingType="BUILDING_STABLE" YieldType="YIELD_CULTURE" /> <Set YieldType="YIELD_PRODUCTION" /> </Update> </Building_YieldChanges> </GameData>
You can also do a "global" update to a table like thisBut this will certainly fail in this particular example and no changes would be made because the entire update (whether done in XML or SQL) must succeed and pass the unique constraint and all other "syntax" requirements before any part of it is implemented. And in this particular example of how global updates can be made, the game would reject the entire thing because there would almost certainly be rows in the table that already have YIELD_PRODUCTION and YIELD_CULTURE for a given building: BUILDING_PALACE for instance.Code:<GameData> <Building_YieldChanges> <Update> <Where YieldType="YIELD_CULTURE" /> <Set YieldType="YIELD_PRODUCTION" /> </Update> </Building_YieldChanges> </GameData>
Using SQL will not get around these issues unless a more complex UPDATE is coded wherein the update first checks for Distinct rows and the like before asking the game to update a given row within the table to use new data.
I looked into it, and that modifier presents the same problem. The Mamluk and the Great Person José Félix Ribas both use the modifier REQUIREMENT_PLOT_ADJACENT_TO_OWNER_AT_WAR to affect enemy units adjacent to them.I think this should be possible, yes. You're on the right lines regarding the REQUIREMENT_PLOT_ADJACENT_TO_OWNER_AT_WAR - but we'll need to pair it with an appropriate Modifier that impacts the unit in question. I don't think there's an existing base-game ability that has the exact pair of Modifier and Requirements we want.
I am going to have a proper scan later this morning - time permitting - to try and give you a fuller reply. But I would expect that the ModifierType we'll want to use may be MODIFIER_PLAYER_UNIT_ADJUST_MOVEMENT. This, along with a variation of the AOE_ENEMY_REQUIREMENTS SubjectRequirementSetId from the Gran Colombia/Maya DLC should work. Even though they are in DLCs, the RequirementType that they use is from the base-game (Vanilla), which is REQUIREMENT_PLOT_ADJACENT_TO_OWNER_AT_WAR.
Again, don't quote me on this 100% - but I am pretty sure it should be possible to configure.
I looked into it, and that modifier presents the same problem. The Mamluk and the Great Person José Félix Ribas both use the modifier REQUIREMENT_PLOT_ADJACENT_TO_OWNER_AT_WAR to affect enemy units adjacent to them.
What I am trying to do is affect a unit given the requirement that enemy units are are adjacent to them. I haven't found a way to establish that requirement.
I appreciate it. I've tried for an embarrassing amount of hours to get it to work at this pointI understand where you are coming from - however, I think you may be mixing up the Requirements and the Modifier functions.
The Requirement is about establishing the conditions under which the Modifier will apply (and therefore apply some game-changing effect). I am not suggesting the existing in-game Modifiers do what we want. They use the same Requirement we want, but we need to code them alongside a different Modifier in order to achieve our goal. The Requirement is just establishing when the use of the Modifier will be 'true'. The Modifier itself is responsible for affecting the entities we want - as long as we use the right one, that has the right contextual Collection/Effect, it should be fine.
Apologies - I have had a really busy week at work so haven't had a chance to look at this specifically for you. I will return to this thread and provide some sample code as soon as I have a chance to do so.
I appreciate it. I've tried for an embarrassing amount of hours to get it to work at this point
Hey guys. How much effort would it take for a beginner to make a modded Sweden with combined bonuses of Norway and its leader.
Thanks
INSERT INTO CivilizationTraits
(CivilizationType, TraitType)
VALUES ('CIVILIZATION_SWEDEN', 'TRAIT_CIVILIZATION_EARLY_OCEAN_NAVIGATION');
INSERT INTO LeaderTraits
(LeaderType, TraitType)
VALUES ('LEADER_KRISTINA', 'TRAIT_LEADER_MELEE_COASTAL_RAIDS');
Hey, the load order was 1000. I just manually moved every unit instead with individual updates, works ok as long as other people don't add other units in their mods.What is your LoadOrder setting for your UpdateDatabase action? If you are running either of the expansions, and you have no LoadOrder setting or a LoadOrder of 0 (which is the same thing) Updates tend to fail because (a) there's nothing in the database as yet related to Expac code, and (b) the expacs are loading after the Updates made in the mod and are wiping the effect of the update from the Database,
Hello. How do I mod Lady Six Sky's leader ability to change the range of the Ix Mutal Ajaw? Thanks in advance!!!
The requirement is called REQUIRES_OBJECT_6_TILES_FROM_CAPITAL_NOT_CAPITAL, that's all I can say. I've not worked with these much, so I don't know details, but safest would be to try to create new requirement based on this and change MaxDistance attribute. REQUIREMENT_PLOT_NEAR_CAPITAL seems to be the base requirement from which you can create requirement with adjusted value. Then just change which requirement is attached to OBJECT_IS_6_TILES_FROM_CAPITAL_NOT_CAPITAL_REQUIREMENTS. It's confusing but there's basically two values with similar name attached like so.
Events.OptionChangeRequiresResolutionAck.Add(OnOptionChangeRequiresResolutionAck);
LuaEvents.PBCNotifyRemind_ShowOptions.Add(OnPBCNotifyRemind_ShowOptions);