Doe anyone know how to assign and change artifact rewards?

Galgus

Emperor
Joined
Aug 22, 2012
Messages
1,705
I'm trying to learn how to mod artifact rewards beyond the basic modification of their buildings, playerperks, and promotions.

So if I, say, wanted to either change Projected Chasis Construction to a playerperk benefit or add a playerperk benefit to it, how would I go about that without directly editing game files?
__________________________________________________________

To create new artifact rewards, would I just use this style, with the names obviously changed?

Code:
<ArtifactRewards>
    <!-- Old Earth (Building) Rewards -->
    <Row>
      <ID>0</ID>
      <Type>ARTIFACT_REWARD_FRONTIER_STADIUM</Type>
      <Description>TXT_KEY_ARTIFACT_REWARD_FRONTIER_STADIUM_DESCRIPTION</Description>
      <Explanation>TXT_KEY_ARTIFACT_REWARD_FRONTIER_STADIUM_EXPLANATION</Explanation>
      <EffectsSummary>TXT_KEY_ARTIFACT_REWARD_FRONTIER_STADIUM_EFFECTS_SUMMARY</EffectsSummary>
      <BuildingReward>BUILDING_FRONTIER_STADIUM</BuildingReward>
      <Category>ARTIFACT_CATEGORY_OLD_EARTH</Category>
    </Row>

</ArtifactRewards>
_______________________________________________

What determines which artifact reward is associated with what, and is there a way to modify that for adding new rewards?
_____________________________________________

For a simpler question, is this the correct way to replace a playerperk's bonus?

It did not seem to work when I tried it, though it could have easily been something else.

Code:
<PlayerPerks>
		<Update>
			<Where Type="PLAYERPERK_ZYGOTIC_ENGINEERING" />
			<Set GrowthCarryover="30" />
		</Update>
	</PlayerPerks>

<PlayerPerks>
		<Update>
			<Where Type="PLAYERPERK_MACHINE_ASSISTED_FREE_WILL" />
			<Set GlobalTechCostModifier="0"
				 FreeTech="true" />
		</Update>
	</PlayerPerks>
 
Firstly, if you are still modding by editing the game files directly, please see these resources:

While the Modder's Guide refers to Civ5, the basics have not changed. This guide will get you started using the ModBuddy so you can load your changes via the Mod system, keeping the original game data intact.

----

I've just recently been playing around with the artifacts, although primarily on the UI side.

Regarding what determines which reward from what:

In CivBEArtifacts.xml, each artifact has a Category field
  • ARTIFACT_CATEGORY_OLD_EARTH
  • ARTIFACT_CATEGORY_ALIEN
  • ARTIFACT_CATEGORY_PROGENITOR
and each artifact has a RewardPreference field
  • ARTIFACT_REWARD_TESSELATION_FOUNDRY
  • ARTIFACT_REWARD_MACHINE_ASSISTED_FREE_WILL
  • ARTIFACT_REWARD_WARP_SPIRE
  • ...etc.

In CivBEArtifactRewards.xml, each reward also has a Category field
  • ARTIFACT_CATEOGRY_OLD_EARTH
  • ARTIFACT_CATEOGRY_ALIEN (note the difference, probably just human error)
  • ARTIFACT_PROGENITOR
and each reward will have one of the following three fields:
  • BuildingReward
  • PromotionReward
  • PlayerPerkReward
Now the important thing to note is that there are a group of artifact rewards that don't have the Category field. This group is what we call the hybrid rewards, or in the code, called "mixed rewards".

When determining which reward comes out of any 3 artifacts, the game calls ArtifactUtilities.GetArtifactReward() function, which does this:
  1. Start with an empty rewardIDs[] table.
  2. Check if all 3 artifacts come from the same Category. If no, then add all mixed rewards into rewardIDs[], less those we already have received, then continue to add the reward indicated by each artifact's RewardPreference into rewardIDs[], less those we already have received.
  3. If rewardIDs[] is still empty, then add the rewards indicated by each artifact's RewardPreference into rewardIDs[], less those we already have received.
  4. If rewardIDs[] is still empty, then add the rewards that has the same Category tag as any of the 3 artifacts we are researching, into rewardIDs[]. Note that for the purposes of this operation, ARTIFACT_CATEGORY_ALIEN is treated to be equivalent to ARTIFACT_CATEOGRY_ALIEN_WORLD.
  5. If rewardIDs[] is still empty, then add whatever rewards we still haven't got yet, into rewardIDs[].
  6. Get a random reward from rewardIDs[] and call it a day.

What this means, is that to add a new reward, the easiest is to add it without the Category field, making it belong to the hybrid group of rewards. If your new reward has a Category field, then you must add artifacts (or change existing artifacts) to list your new reward as its RewardPreference, otherwise your reward will become rare (it can only be obtained if the player combines 3 artifacts whose RewardPreference are all things the player has already received).
 
I've made several mods in modbuddy, I was editing directly because I did not know how to otherwise in this instance.
___________________________

Is the method I listed earlier correct then for adding new rewards?

How do you change existing artifacts to prefer a new reward?

How do you change existing rewards?
 
I'm not actually sure. Have you read the Civ 5 Modder's Guide? Most of my activities are focused on modifying the UI and Lua, so I haven't tried changing the database before.

If it didn't work, perhaps you didn't set the file attributes correctly?
 
Top Bottom