Trade goods modding

From Europa Universalis 4 Wiki
Jump to navigation Jump to search

Trade goods are defined in /Europa Universalis IV/common/tradegoods/.

Adding a trade good[edit]

All trade goods must be named uniquely. A trade good follows this format:

<TradeGood> = {
     #Color that the province have on trade good map mode.
     color = { 0.96 0.93 0.58 }

     #Modifier that the country gets if they have trading in.
     modifier = {
	land_forcelimit_modifier = 0.20
     }

     #Modifier that the province gets if they have <TradeGood>.
     province = {
	land_forcelimit = 0.5
     }

     #How likely it will appear in empty provinces on colonization.
     chance = {
	factor = 35
        #You can specify it by adding modifiers so it's 32*1.5 = <Chance> if has_terrain = desert
	 modifier = {
                #factor = 0 is never 
		factor = 0 
		area = newfoundland_area #Triggers
	 }
	 modifier = {     
		factor = 1.5
		OR = {
			has_terrain = desert #Triggers
			has_terrain = glacier #Triggers
		}
	 }
     }
}

Price[edit]

The Prices for trade goods are defined in /Europa Universalis IV/common/prices/.

<TradeGood> = {
        #Base Price
	base_price = 2.5 
        #This resource works like 'gold' if yes, using prices from mine-value in province instead of supply/demand and baseprice. Also creates gold-inflation
        goldtype = yes/no #Optional 
}

Manufactory[edit]

This is optional if you want a manufactory for your trade good. The manufactories are defined in /Europa Universalis IV/common/buildings/.

<manufactory> = {
        # Add your trade good in manufactory = {}
	manufactory = {
		copper
		iron
                <TradeGood> 
	}
	onmap = yes	
	
	ai_will_do = {
		factor = 1
	}
}

Adding a picture for the trade good[edit]

You need two images for your trade good one of size 28x28 and the other one 64x64. 28x28 images are in /Europa Universalis IV/gfx/interface/. in file called "resources_small" and 64x64 images are in /Europa Universalis IV/gfx/interface/. in file called "resources"

You need to make the images 28/64 pixels width bigger and add your images.

When you are done you need to put this files in your mod mod_file/gfx/interface/. Files need to be in dds/tga format

Register the picture in interface[edit]

You need to go to the /Europa Universalis IV/interface/ and copy file called "provinceview.gfx" in to your interface folder in your mod and change the numbers in "noOfFrames"

spriteType = {
	name = "GFX_resource_icon"
	texturefile = "gfx//interface//resources.tga"
	noOfFrames = 33 #Amount of 64x64 images in "resources"
	loadType = "INGAME"
}
	
spriteType = {
	name = "GFX_resource_icon_small"
	texturefile = "gfx//interface//resources_small.dds"
	noOfFrames = 33 #Amount of 28x28 images in "resources_small"
	loadType = "INGAME"
}

spriteType = {
	name = "GFX_resource_icon_transparent"
	texturefile = "gfx//interface//resources.tga"
	noOfFrames = 33 #Amount of 64x64 images in "resources"
	loadType = "INGAME"
		
	allwaystransparent = yes
}

Localisation[edit]

You need to go to the /Europa Universalis IV/localisation/ and copy file called "text_I_english" or whatever language you are working in into to your localization folder in your mod and add a section in the trade good section for your new trade good.

 <TradeGood>: "" #Name
 <TradeGood>DESC: "" #Description
Documentation EffectsTriggersModifiersScopesVariablesLocalisationCustomizable localizationRun files
Scripting Scripted functionAdvisorsAgesBookmarksBuildingsCasus belliColonial regionsCountriesCultureDecisionsDefinesDiplomatic actionsDisastersEstatesEventsFactionsGovernmentGreat projectsHistoryIdea groupsInstitutionsMercenariesMissionsModifiersNation designerHoly Roman EmpirePoliciesReligionRebel typesSubject typesTechnologyTrade companiesTrade goodsUnits
Map MapNation designerRandom New WorldTrade nodes
Graphics 3D ModelsInterfaceGraphical AssetsFontsParticlesShadersUnit models
Audio MusicSound
Other Console commandsChecksumJoroDox mod making toolMod structureTroubleshootingThe ValidatorRun files
Guides Adding a provinceSave-game editing