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 Sep 28, 2010, 11:28 PM   #1
Jennar
Chieftain
 
Jennar's Avatar
 
Join Date: Nov 2008
Posts: 55
Adding Strategic Resources - Help Needed

I'm trying to add food types to strategic resources and am running into some issues. I've found out where the quantity produced per tile is located but I can't seem to get it to implement. Was curious if anyone else had better luck with this type of modding or if some the veterans already know where to look. Thanks in advance.
Jennar is offline   Reply With Quote
Old Sep 29, 2010, 12:58 AM   #2
Dale
Deity
 
Dale's Avatar
 
Join Date: Mar 2002
Location: Melbourne
Posts: 6,481
Resources aren't implemented in XML anymore (regardless of what the XML file includes).

I direct your attention to the file AssignStartingPlots.lua instead.

Good luck, I'm struggling with adding a new strategic resource myself. At present, can't define a FONT_ICON for new resources so you have to pick an existing one.
__________________
http://www.brrgames.com
Dale is offline   Reply With Quote
Old Sep 29, 2010, 03:15 AM   #3
Saarud
Warlord
 
Saarud's Avatar
 
Join Date: Aug 2004
Posts: 112
Ahh if even Dale struggles with this it's no wonder why I totally failed. I tried to make all luxuary and food resources to strategic resources instead. For every grain you can build one bakery, jewel stores turns gems into happiness and so on. Would have been fancy if it would have worked.
Saarud is offline   Reply With Quote
Old Sep 29, 2010, 03:58 AM   #4
Dale
Deity
 
Dale's Avatar
 
Join Date: Mar 2002
Location: Melbourne
Posts: 6,481
If you want, I've got a beta of Hardwood strategic resource on the hub. Take a look at what I've done to get it working and to help your effort.

I would suggest using something like WinMerge to compare the default AssignStartingPlots.lua and my AssignStartingPlots.lua file to find where I've changed things.
__________________
http://www.brrgames.com
Dale is offline   Reply With Quote
Old Sep 29, 2010, 12:52 PM   #5
Jennar
Chieftain
 
Jennar's Avatar
 
Join Date: Nov 2008
Posts: 55
I went through your mod and the LUA file. All I can see in that LUA is that you are defining how to set up the map in the game. You'r XML files for the resource don't differ from mine. So I must be missing something in that LUA that defines the resource as strategic for the game. Is it perhaps the list and amt values? Getting this working is gonna be 90% of my mod. lol.
Jennar is offline   Reply With Quote
Old Sep 29, 2010, 02:08 PM   #6
Dale
Deity
 
Dale's Avatar
 
Join Date: Mar 2002
Location: Melbourne
Posts: 6,481
Here's a tip:

In the game it will show as a "bonus" resource until you make a unit require it. Then it becomes "strategic".
__________________
http://www.brrgames.com
Dale is offline   Reply With Quote
Old Sep 29, 2010, 02:16 PM   #7
Edgecrusher
King
 
Edgecrusher's Avatar
 
Join Date: Aug 2006
Location: Massachusetts
Posts: 904
I havent had a chance to play around with the SDK, but had question for Dale.

Say you assign Cotton as a requirement for a Naval unit, or Ivory for Elephant units.
Does the game treat Cotton/Ivory as a Strategic or Luxury resource? or both?
__________________
Units: War Pigs, Siege Quinquereme

Mod Comps: Heroes, Unique National Wonders
Edgecrusher is offline   Reply With Quote
Old Sep 29, 2010, 02:52 PM   #8
Saarud
Warlord
 
Saarud's Avatar
 
Join Date: Aug 2004
Posts: 112
Quote:
Originally Posted by Dale View Post
Here's a tip:

In the game it will show as a "bonus" resource until you make a unit require it. Then it becomes "strategic".
Must it be a unit? If a building requires a "bonus" resource will that do as well?
Saarud is offline   Reply With Quote
Old Sep 29, 2010, 03:38 PM   #9
Jennar
Chieftain
 
Jennar's Avatar
 
Join Date: Nov 2008
Posts: 55
Quote:
Originally Posted by Dale View Post
Here's a tip:

In the game it will show as a "bonus" resource until you make a unit require it. Then it becomes "strategic".
:head desk:

And here I was looking for something far more complicated.
Jennar is offline   Reply With Quote
Old Sep 29, 2010, 04:56 PM   #10
Dale
Deity
 
Dale's Avatar
 
Join Date: Mar 2002
Location: Melbourne
Posts: 6,481
Quote:
Originally Posted by Saarud View Post
Must it be a unit? If a building requires a "bonus" resource will that do as well?
You are correct.
__________________
http://www.brrgames.com
Dale is offline   Reply With Quote
Old Sep 29, 2010, 04:58 PM   #11
Dale
Deity
 
Dale's Avatar
 
Join Date: Mar 2002
Location: Melbourne
Posts: 6,481
Quote:
Originally Posted by Edgecrusher View Post
I havent had a chance to play around with the SDK, but had question for Dale.

Say you assign Cotton as a requirement for a Naval unit, or Ivory for Elephant units.
Does the game treat Cotton/Ivory as a Strategic or Luxury resource? or both?
Converting a luxury to a strategic is not as simple. Here's where a couple of the XML tags for resources are actually used. You need to change the resource type (I think it says RESOURCE_LUXURY, don't have the files in front of me) and then define the XML to tell the engine how many units of the resource to plant. Then modify AssignStartingPlots.lua to plant the resource as a strategic not a luxury.
__________________
http://www.brrgames.com
Dale is offline   Reply With Quote
Old Sep 30, 2010, 01:41 AM   #12
Jennar
Chieftain
 
Jennar's Avatar
 
Join Date: Nov 2008
Posts: 55
Alright running into more issues with this. Using Dale's mod as a road map I've come across a bunch of stuff. The plating of luxury resources, strategic resources, bonus resources and fish are completely different (yes, fish has it's own category of placement, weird). There is no place that I have found where you can simply tell the game to place a number of resources instead of just the resource. You would almost have to remove all references to the old resource from the LUA and recode it. This is horribly inefficient and unnecessarily cumbersome. Second the way it is handled makes all resource based mods unnmodular. This has to do with the fact that each mod would need it's own version of the AssignStartingPlots.LUA file that would be exclusive to the mod. Unlike XML modding where you update the database resources, because of the way they are handled, do not update and instead need specific LUA coding to get them to work.

Adding and removing resources was infinitely easier in CIV4 then it is now in CIV5, The first definitive step backwards in modding capability that I've seen in this iteration.

I'm sure there has to be a better way to do this then hard coding the LUA every time you add a resource. The frustration level for me has hit a critical mass, so I'm done for the night, perhaps tomorrow will shed light on how to do this easier.
Jennar is offline   Reply With Quote
Old Sep 30, 2010, 02:51 AM   #13
Dale
Deity
 
Dale's Avatar
 
Join Date: Mar 2002
Location: Melbourne
Posts: 6,481
Let me just say that when I found out resources were hardcoded in that lua file.....

I screamed for a month!
__________________
http://www.brrgames.com
Dale is offline   Reply With Quote
Reply

Bookmarks

Go Back Civilization Fanatics' Forums > CIVILIZATION V > Civ5 - Creation & Customization > Adding Strategic Resources - Help Needed

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 12:11 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