Making resources as a yield?

gabe_oz

Chieftain
Joined
Feb 10, 2015
Messages
21
I am making a mod that certain buildings will give the XenoMass resource as a yield (like making energy as a yield). But I have no idea how make it give xenomass as a yield, because I have tried everything. Any suggestions?
 
Easy, there's a table for that - it's not used by any of the buildings currently in the game, but it works:

<Building_ResourceQuantity>
<Row>
<BuildingType>BUILDING_YOUR_BUILDING_NAME</BuildingType>
<ResourceType>RESOURCE_XENOMASS</ResourceType>
<Quantity>2</Quantity>
</Row>
</Building_ResourceQuantity>
 
Sure, post both the building itself as well as the Resource-Quantity-Part.

The code itself definitely works though, I'm using it in my [Awesome Sponsors - Overhaul]-Mod, as part of the Slavic bonus if you want to take a look.

The code is a bit of a mess, but if you use the Quick Find for BUILDING_ORBITAL_CONTROLS in the buildings.xml it should be easy to find.
 
It seems anything that isnt part of the main building block doesn't work, not even the production yield change. Also tell me if you want me to post the building class part.



<?xml version="1.0" encoding="utf-8"?>
<!-- Created by ModBuddy on 11/25/2014 5:55:14 PM -->
<GameData>
<Buildings>
<Row>
<Type>BUILDING_XENOMASS_REACTOR</Type>
<BuildingClass>BUILDINGCLASS_XENOMASS_REACTOR</BuildingClass>
<Cost>200</Cost>
<ConquestProbability>42</ConquestProbability>
<EnergyMaintenance>2</EnergyMaintenance>
<PrereqTech>TECH_ORGANICS</PrereqTech>
<Description>TXT_KEY_BUILDING_XENOMASS_REACTOR_DES C</Description>
<Civilopedia>TXT_KEY_BUILDING_XENOMASS_REACTOR_PED IA</Civilopedia>
<ArtDefineTag>ART_DEF_BUILDING_THORIUM_REACTOR</ArtDefineTag>
<IconAtlas>BW_ATLAS_1</IconAtlas>
<PortraitIndex>13</PortraitIndex>
<Health>3</Health>
</Row>
</Buildings>

<Building_YieldChanges>
<Row>
<BuildingType>BUILDING_XENOMASS_REACTOR</BuildingType>
<YieldType>YIELD_PRODUCTION</YieldType>
<Yield>3</Yield>
</Row>
</Building_YieldChanges>

<Building_ResourceQuantity>
<Row>
<BuildingType>BUILDING_XENOMASS_REACTOR</BuildingType>
<ResourceType>RESOURCE_XENOMASS</ResourceType>
<Quantity>4</Quantity>
</Row>
</Building_ResourceQuantity>


</GameData>
 
As long as the building itself works the buildingclass should be fine. I created a quick test mod and the building actually works - so I assume you probably looked at the tooltip and because it doesn't show the xenomass concluded that the code doesn't do anything - but it just doesn't show up in the tooltip. Try placing the building (The Ingame Editor AddOn is a great tool to test things like that quick and easy), it should add +4 Xenomass.

You can then add the Information into the tooltip by adding it into the help-text of the building.
 
Awesome! I am working on the text help now (I went through your code to see how you did the helpt hing), and it did work when I went into the game. Also, if you would like. I could help on writing the civilpedia sections for your buildings(In awesome sponsors, and your other mods if youd like)
.
 
If you'd have fun doing that, sure. ^^ Add me on steam if you like: http://steamcommunity.com/id/ryika/ I think most people don't even realize that there are prebuilt-buildings though, I mostly use them as an easy way to introduce more complex perks into the game.
 
Top Bottom