Need help

dave11980

Chieftain
Joined
Feb 5, 2011
Messages
3
Ok, I'm a little new to the xml modding system having jumped straight from Civ 3 to 5. I've got a pretty basic mod started just trying to tweak some values and settings to set things up the way I want. Right now (and for the last 24 hours) I'm trying to increase the strategic resources in the game as I think it's pretty unrealistic to run out of coal after just a couple factories or only be able to build 3 nukes and a singe nuclear power plant. My thought was to take the modifier on Facism "<StrategicResourceMod>200</StrategicResourceMod>" and add it to something everyone has early in the game. Ideally it would be added to an early tech or something. No matter how I've tried to do it whenever I start with it the entire mod doesn't load. I've even tried just using an update statement on a different policy to give it to me without taking on the autocracy tree and that doesn't work either. Anyone know how I would go about doing this?
 
You can't take an entry in one table (Policies) and attach it to any other table (Technologies, Buildings, etc.) It just doesn't work that way. If it's not in the table definitions at the top of that particular file, you can't use it, period.

If you think there should be more strategic resources, then when you're setting up a new game, just set the resources to Abundant instead of Standard. This ups the amounts by ~50%, through a mix of increasing the sizes of each deposit and increasing the number of small deposits.

Beyond that, you'd need to edit AssignStartingPlots.lua, and I would NOT recommend this for someone new to modding.


Also, if you're trying to figure out why a block of code you've made doesn't work, we need to actually see the code in question to be able to tell you what you did wrong. So do one of the following:
1> Attach the file to your post. (Only do this if it's huge.)
2> Insert it into your post using either the (CODE) or (SPOILER) tags (but use brackets instead of parentheses). (SPOILER) screws up the spacing but allows the thing to be hidden, useful if it's a large amount of text; (CODE) is the best if it's a small excerpt, like an XML update.
 
2> Insert it into your post using either the (CODE) or (SPOILER) tags (but use brackets instead of parentheses). (SPOILER) screws up the spacing but allows the thing to be hidden, useful if it's a large amount of text; (CODE) is the best if it's a small excerpt, like an XML update.
You can do (CODE) inside (SPOILER), can't you?

Spoiler :
Code:
Like so.

Also, dave, remember to add the (/code) or (/spoiler) tag (again, using brackets instead of parentheses) at the end of the section you want in a spoiler block or code block. ;)
 
When trying to add the property to another policy this was the code I used.

Code:
	<Policies>
		<Update>
			<Where Type="POLICY_LIBERTY" />
			<Set StrategicResourceMod="200" />
		</Update>
				
	</Policies>


When I was trying to add it to the technology I was trying to redefine the whole table exactly as I pulled from CIV5Technologies and adding the StrategicResourceMod column to the table as well as an early technology however I'm not sure if this even should work. Ultimately my goal is to have each resource tile have a higher total number of resources so that the strategic value of that tile is still there but you aren't so limited on number of units/improvements you can make. Fundamentally the mechanics are perfect, just the numbers too low.
 
When trying to add the property to another policy this was the code I used.

That looks okay. Are you sure it wasn't working?

And also, do any other mods to that file work? (If not, then it's possible you've just got the OnModActivated set up incorrectly and it's just not loading that file.)

When I was trying to add it to the technology I was trying to redefine the whole table exactly as I pulled from CIV5Technologies and adding the StrategicResourceMod column to the table as well as an early technology however I'm not sure if this even should work.

No, it won't work. That's what I was trying to say before; you can put whatever tables you want in the XML file, but if the engine isn't looking for specific values in those tables when it's trying to run, then it won't do anything. Since you don't have access to the game engine, the closest you can come is to add a new table and create your own Lua code to parse it.
Just because there's a StrategicResourcesMod value in one table doesn't in any way imply that any other table would recognize it; the engine just doesn't work that way.
 
That looks okay. Are you sure it wasn't working?

And also, do any other mods to that file work? (If not, then it's possible you've just got the OnModActivated set up incorrectly and it's just not loading that file.)


Exactly what was happening. I had a working mod, added the code above, and when reloading none of it worked. Took the Policies section out and rebuilt and it's fine again.
 
Back
Top Bottom