Advertisement
Civilization Fanatics' Center  

Welcome to Civilization Fanatics' Center.

You are currently viewing our site as a guest which gives you limited access to our site features. By joining our free community, you will be able to participate in the discussions, search the forum, send private messages, vote in polls, upload your own screenshots to the gallery, and access many other special features. Registration is fast, simple and absolutely free, so sign up today! If you have any problems with the registration process or your account login, please contact support.

Go Back   Civilization Fanatics' Forums > CIVILIZATION V > Civ5 - Creation & Customization

Notices

Reply
 
Thread Tools
Old Feb 12, 2011, 03:37 AM   #1
Riker13
Prince
 
Riker13's Avatar
 
Join Date: Nov 2001
Location: UK
Posts: 398
Change resource - Help

I want to change the resource IVORY to ELEPHANT so that all nations can use them as "War-Phants"

Is it an <Update> issue?

Any help or guidance will be great.

Regards

Riker13
Riker13 is offline   Reply With Quote
Old Feb 12, 2011, 03:49 AM   #2
Spatzimaus
Mad Scientist
 
Spatzimaus's Avatar
 
Join Date: Sep 2005
Location: Los Angeles, CA
Posts: 3,062
You need more detail about what you're trying to do, but the short answer is no, you can't just do it in XML. Here are a few issues you'll have to keep in mind:

1> If you want to have a resource be used as a strategic, then you'll have to change its Resource Class from Luxury to either Rush or Modern as an XML change.

2> You'll also need to adjust the quantities, and that means Lua editing, because the XML fields for this aren't used. (Specifically, AssignStartingPlots will need to be HEAVILY modified in at least six places that I can think of.) Luxuries and Strategics are handled almost entirely separately, so changing something from one category to the other would require a large amount of editing to the spawn tables.

3> The UI (specifically TopPanel.lua) will treat any resource that has a <Happiness> value as a luxury and not a strategic, regardless of what Resource Class you set. It's easy enough to fix this (I did so for my own mod), but this means that if you want elephants to still act as a luxury then you'll have issues. And removing its happiness has all kinds of other balance issues.

Plus the usual assortment of Civilopedia entries you'd have to tweak.
Spatzimaus is offline   Reply With Quote
Old Feb 12, 2011, 03:59 AM   #3
Riker13
Prince
 
Riker13's Avatar
 
Join Date: Nov 2001
Location: UK
Posts: 398
Bugger ;(

But thanks for the quick reply, ok plan 2.....................
Riker13 is offline   Reply With Quote
Old Feb 12, 2011, 12:59 PM   #4
DragonBlood87
Chieftain
 
DragonBlood87's Avatar
 
Join Date: Jan 2009
Location: Georgia, U.S.A.
Posts: 82
Quote:
Originally Posted by Spatzimaus View Post
2> You'll also need to adjust the quantities, and that means Lua editing, because the XML fields for this aren't used. (Specifically, AssignStartingPlots will need to be HEAVILY modified in at least six places that I can think of.) Luxuries and Strategics are handled almost entirely separately, so changing something from one category to the other would require a large amount of editing to the spawn tables.
This actually got me thinking... would it be possible to mod AssignStartingPlots so that it reads the values from a new table, instead of having the values defined in the LUA code? This could potentially make it a lot easier to mod in extra resources or alter the distribution of existing resources; all you would have to do is edit the XML file for the new table, instead of tweaking things everywhere in the LUA code.
DragonBlood87 is offline   Reply With Quote
Old Feb 12, 2011, 02:02 PM   #5
Spatzimaus
Mad Scientist
 
Spatzimaus's Avatar
 
Join Date: Sep 2005
Location: Los Angeles, CA
Posts: 3,062
Quote:
Originally Posted by DragonBlood87 View Post
This actually got me thinking... would it be possible to mod AssignStartingPlots so that it reads the values from a new table, instead of having the values defined in the LUA code?
No. I mean, yes, you can have Lua read XML, but that part's not actually the problem.

The first problem is that when the script calls GetMajorStrategicwhatever, the calling statement has a specific number of arguments. It's not being handled as an allocatable data structure or anything like that, so when the calling routine has 7 arguments and the called routine returns 10, or vice versa, then things break. It's just not dynamic; if you add a new resource, then you need to rewrite all of those, and that's what makes it incompatible with, say, the Lakes map script (since it has its own version of that subroutine). If the devs were smart they'd have written the map script resources as a modifier, so that you could default any new resources to x1, but they instead took the cheap way out and overwrote the existing routine. (The fact that map scripts override mods is also backwards, IMO.)
This also means that if you restructure AssignStartingPlots to read from files, then the Lakes, Great Plains, and Highlands map scripts will stop working entirely unless you make new versions of them as well.

The second problem is that the rarities are all handled through a bunch of weighting tables, and while you COULD transfer all of those to XML, it'd be a HUGE amount of work. So if a Small deposit on a grassland hill has a 25% chance of being Iron, a 45% chance of Uranium, and a 30% chance of Aluminum (just making those numbers up), then think about how much XML you'd have to write to just set that ONE rarity table. Now double that for the Major deposits, and add in the other dozen or so terrain types.

Besides just being a tremendous amount of work, you'd also end up with something that's completely incompatible with any future updates. Now, if Firaxis was smart they'd do this themselves, so that they could fix the map scripts at the same time. Of course, doing that would break plenty of existing mods (like mine) and nearly any custom map script, so I hope they don't do that any time soon.
Spatzimaus is offline   Reply With Quote
Old Feb 12, 2011, 04:10 PM   #6
SamBC
King
 
Join Date: Feb 2010
Location: Lancaster
Posts: 678
Quote:
Originally Posted by DragonBlood87 View Post
This actually got me thinking... would it be possible to mod AssignStartingPlots so that it reads the values from a new table, instead of having the values defined in the LUA code? This could potentially make it a lot easier to mod in extra resources or alter the distribution of existing resources; all you would have to do is edit the XML file for the new table, instead of tweaking things everywhere in the LUA code.
Yes, but the modification has to be a bit deeper than that, due to the architecture of the file. Quite a lot of it needs to be reworked.
__________________
SpeedRepacing - 2k Forum Thread - Official Wiki Page | Technology Enhanced Improvements - 2k Forum Thread - Official Wiki Page | Enhanced Resources - 2k Forum Thread - Official Wiki Page | Saner AI City Locations - 2k Forum Thread - Official Wiki Page
SamBC is offline   Reply With Quote
Reply

Bookmarks

Go Back Civilization Fanatics' Forums > CIVILIZATION V > Civ5 - Creation & Customization > Change resource - Help

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Advertisement

All times are GMT -6. The time now is 04:02 AM.


Powered by vBulletin®
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.
This site is copyright © Civilization Fanatics' Center.
Support CFC: Amazon.com | Amazon UK | Amazon DE | Amazon CA | Amazon FR