Apolyton Archive  |  Preserved copy of the Apolyton Civilization Site and its forums as they stood in September 2005. Read-only; nothing here can be posted to or replied to.  |  Forum index |  About this archive |  The 1998–2001 UBB forums
Today on Apolyton WARDELL INTERVIEW PROMO A.C.S. HISTORY CHAPTER 4 GET CIV4 /w FREE PLUS! A.C.S. PHOTO GALLERY GET A.O.M. V1.1
Apolyton Civilization Forums
main| civ2| civ3| civ4| smac| ctp2| ron| moo3| galciv| galciv2| alt| about|
ApolytonPLUS | register | search | faq | new posts | pm (-/-) | upload | members
hall of fame new! | civgroups | civgroups news | interviews | the column | radio | chat | directory | news | store | PLUS
Apolyton Civilization Forums : Powered by vBulletin version 2.0.3 Apolyton Civilization Forums > Call To Power II > CtP2-Creation/AI/Mods/Scenarios > Goods and Trade.
Show a Printable Version | Email This Page to Someone! | Receive updates to this thread | Report this to Apolyton news!

bottom of page
  
Author
Thread    < Last Thread     Next Thread > Post New Thread     Post A Reply
stankarp is offline stankarp
Prince
australia
Feb 2002
time: 05:35
  Old Post 19-05-2004 09:20
Edit/Delete Message Reply w/Quote
#1 Report this post to a moderator
Goods and Trade. Support Apolyton, buy Civilization 2

Wondering if someone can help with syntax and other questions on goods.

I know HasGood(location) returns the good number (0-3) for a good or -1 if there is no good. Is there syntax that would identify the specific good there, ie, instead of LAND_GOOD_ONE(returns 0) on a plain, identify Buffalo?

From goods.txt
# Rubies #0
TERRAIN_ARCTIC_MOUNTAIN_GOOD_ONE {
SpriteID 18
Sound SOUND_ID_RUBIES
Gold 1
Food 10
Production 10
Probability 0.25
Icon ICON_GOOD_ARCTIC_MOUNTAIN_ONE
}

What does "GOLD" do, what happens if you change it from 1 to something else?

"Probability 0.25"
Presume this means 1 in 4 chance that goods on Arctic Mountain will be "ONE", ie Rubies.

From goodsID.txt
"87
TERRAIN_ARCTIC_MOUNTAIN_GOOD_ONE 18 # "Rubies""
I presume the first number(87) is the number of sprites?
Second no (18) is the goods sprite id no?


Thanks for any help.

Martin Gühmann is offline Martin Gühmann
Emperor
Berlin, Germany
Mar 2001
time: 06:35
Post  Old Post 19-05-2004 18:23 Visit Martin Gühmann's homepage!
Edit/Delete Message Reply w/Quote
#2 Report this post to a moderator
Put an end to popups!

The HasGood function returns the database index of the good.

I don't know what gold does, but I think it should be 1, Production and Commerce do nothiong at least in Activision's version of the game. My guess it was supposesd to add a terrain bonus to the underlying terrain.

The first number in goodsID.txt is the number of entries. The other numbers are sprite IDs, but I think this file is not used in CTP2 it is a leftover from CTP1, however I did not tested this, I just filled this file and left the issure alone. Fact is that there is also a dsprite flag in Goods.txt. The probability for goods of one terrain has to be one at maximum.

-Martin

stankarp is offline stankarp
Prince
australia
Feb 2002
time: 05:35
  Old Post 19-05-2004 18:34
Edit/Delete Message Reply w/Quote
#3 Report this post to a moderator
Help yourself to an AD-FREE life

"The HasGood function returns the database index of the good." Posted by Martin.

I thought it only returned 0-3 for the good type ,eg Landclass Good 1 would return a "0". Good 2 a "1". etc.

Wheres the database index? Cant say I have seen anything that gives each good an id number, except in Goodmod.

Thanks.

stankarp is offline stankarp
Prince
australia
Feb 2002
time: 05:35
  Old Post 19-05-2004 18:44
Edit/Delete Message Reply w/Quote
#4 Report this post to a moderator
Support Apolyton, buy Civilization III: Complete

Except of course Goods.txt.

Are you saying Martin that if I use HasGood on a desert tile with oil, it will return 5, the number in CRA_Goods.txt, which I am using now?

Maquiladora is offline Maquiladora
Emperor

Jun 2001
time: 05:35
  Old Post 19-05-2004 19:36 Visit Maquiladora's homepage!
Edit/Delete Message Reply w/Quote
#5 Report this post to a moderator
Support Apolyton buy from Amazon

quote:
The probability for goods of one terrain has to be one at maximum.


I noticed that you dont need to have it equal 1 from the whole goods on one tile, but say if you put:

code:
# Cotton/Flax TERRAIN_GRASSLAND_GOOD_ONE { SpriteID 5 Sound SOUND_ID_COTTON Gold 1 Probability 1 Icon ICON_GOOD_GRASSLAND_ONE } # Tobacco TERRAIN_GRASSLAND_GOOD_TWO { SpriteID 21 Sound SOUND_ID_TOBACCO Gold 1 Probability 1 Icon ICON_GOOD_GRASSLAND_TWO


which is probability 1 for both, it will always use the first one in the goods.txt (cotton/flax) and ignore the other one. Not very useful information just something i noticed messing with goodmod.

Martin Gühmann is offline Martin Gühmann
Emperor
Berlin, Germany
Mar 2001
time: 06:35
Post  Old Post 19-05-2004 20:53 Visit Martin Gühmann's homepage!
Edit/Delete Message Reply w/Quote
#6 Report this post to a moderator
Support Apolyton, buy Civilization III: Complete

quote:
Originally posted by stankarp
Except of course Goods.txt.

Are you saying Martin that if I use HasGood on a desert tile with oil, it will return 5, the number in CRA_Goods.txt, which I am using now?


The database index is given by the order of the entries you find in goods.txt, I added these indices in the comments to GM1_Goods.txt, so that I don't need to count the entries everytime I hardencode an Good index into slic everytime, of course instead of hardencoding the indices you could also use the ResourceDB function to get the index of a certain good:

code:
int_t anIndex; anIndex = ResourceDB(TERRAIN_ARCTIC_MOUNTAIN_GOOD_ONE);


anIndex should after the execution of that piece of code the value 0.

quote:
Originally posted by Maquiladora
which is probability 1 for both, it will always use the first one in the goods.txt (cotton/flax) and ignore the other one. Not very useful information just something i noticed messing with goodmod.


That's right and therefore you can have so many goods for a terrain so that the total summed up probability is greater than 1. Of course you can also have a total summed up probability less then 1. In the second case this is not a problem, but it is a problem in the first case, and therefore the maximum total probability is 1 given you want that the game places all the goods onto the map.

-Martin

stankarp is offline stankarp
Prince
australia
Feb 2002
time: 05:35
  Old Post 20-05-2004 03:24
Edit/Delete Message Reply w/Quote
#7 Report this post to a moderator
Support Apolyton, pre-order Civilization IV

Just checking then, if I use HasGood, it will return 0-3 on a good depending on its class, eg Landgood class 1 would be 0.

If I use anIndex, I can get the exact number of the good from the Resource DB.
"int_t anIndex;
anIndex = ResourceDB(TERRAIN_ARCTIC_MOUNTAIN_GOOD_ONE);
If(anIndex=0){
do stuff}
That be the right syntax?

I was thinking ahead how to get round the 0-3 from HasGood by re-organising the goods so that class 1 is all the luxury type goods, 2 and 3 strategic types and 4 other types. With the help of IW and Peter Triggs I have created a new unit (migrant) and new tile, colony. Among other things the migrant can disband and create a watch tower that also extends borders like a fort. The colony is a normal improvement except it returns 10 gold to the owner each turn. This doubles if this is on any good. The next step is to adjust happiness if it is on a luxury good. By grouping the classes I can just use HasGood, 0 = a luxury good.

However, using the index to get the exact type is very useful.

Thanks.

stankarp is offline stankarp
Prince
australia
Feb 2002
time: 05:35
  Old Post 22-05-2004 03:02
Edit/Delete Message Reply w/Quote
#8 Report this post to a moderator
Support Apolyton buy from Amazon

Just checking again ,
is this the right syntax to use anIndex?

"int_t anIndex;
anIndex = ResourceDB(TERRAIN_ARCTIC_MOUNTAIN_GOOD_ONE);
If(anIndex=5){
do stuff}

Peter Triggs is offline Peter Triggs
Prince
Gone Fishin, Canada
Jan 2000
time: 05:35
  Old Post 22-05-2004 04:00
Edit/Delete Message Reply w/Quote
#9 Report this post to a moderator
Get a bigger avatar today!

Generally you want to use this index business when you want to cycle through the whole file/database. So you might have something like:

code:
for (index=0;index<42;index=index+1){ // 42 should be the number of types in goods.txt if (index == resourceDB(TERRAIN_ARCTIC_MOUNTAIN_GOOD_ONE){ //TRUE when i==0 //do stuff } if (index == resourceDB(TERRAIN_ARCTIC_MOUNTAIN_GOOD_TWO){ //TRUE when i==1 //do stuff } // and so on }


Did that special effects thing work? A timer is the last resort.

stankarp is offline stankarp
Prince
australia
Feb 2002
time: 05:35
  Old Post 22-05-2004 12:28
Edit/Delete Message Reply w/Quote
#10 Report this post to a moderator
Get a bigger avatar today!

Thanks Peter :-)))))

stankarp is offline stankarp
Prince
australia
Feb 2002
time: 05:35
  Old Post 22-05-2004 12:29
Edit/Delete Message Reply w/Quote
#11 Report this post to a moderator
Remove this text

Trying the speceffects thing tonight.

stankarp is offline stankarp
Prince
australia
Feb 2002
time: 05:35
  Old Post 25-05-2004 09:06
Edit/Delete Message Reply w/Quote
#12 Report this post to a moderator
Get a bigger avatar today!

Couple of questions re goods please.

Is there a limit of 68 goods in the game. I started getting a DataBase error that I could not figure out until I, eventually, deleted my last good no 69 and all references to it in unitcon, gl strings, terrain.txt etc. Then the errors stopped.

When you right click on a good, where is the name of the good held, ie the string name. I have altered everything to reorganise goods, but when I right click on the good on the map, the names are wrong. The sprite picture is correct, just the name string is wrong. I have altered gl_string.txt, goodsID.txt, gl.txt where the goods appear between <....>. Altered good txt and good.slic(goodmod)

The right click is still showing the old name of that good class on that terrain as far as I can tell.

J Bytheway is offline J Bytheway
Emperor
England
Jul 2001
time: 05:35
  Old Post 25-05-2004 16:17 Visit J Bytheway's homepage!
Edit/Delete Message Reply w/Quote
#13 Report this post to a moderator
Enter the AD-FREE zone

When seeking the place where names are stored, good method is simply to do a full text search of the ctp_data directory (or just the appropriate language subdirectory).

stankarp is offline stankarp
Prince
australia
Feb 2002
time: 05:35
  Old Post 25-05-2004 17:12
Edit/Delete Message Reply w/Quote
#14 Report this post to a moderator
Support Apolyton or Terrorists Win

I'll try a search but have to be careful as I dont want to muckup the original naming used in other mods.

stankarp is offline stankarp
Prince
australia
Feb 2002
time: 05:35
  Old Post 25-05-2004 17:49
Edit/Delete Message Reply w/Quote
#15 Report this post to a moderator
Avatar Enlargement: We've got the solution

I found the offending problem with the wrong names in the right click good function.

In my strings.txt file which I had copied from cradle was a reference to the cradle gl strings txt file which I had not noticed, so it was picking up those first and then going to my new gl strings text file for any missing ones. So my new units were coming up correctly and some goods where there were not old names, were showing. Thats what confused me the most.

Phew:-))

  < Last Thread     Next Thread > Post New Thread     Post A Reply
All times are GMT. The time now is 05:35.
Apolyton Time is 00:35.
    top of page
Rate This Thread:
Forum Jump:
Forum Rules:
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is ON
vB code is ON
Smilies are ON
[IMG] code is ON
 




Contact Us - Apolyton Civilization Site - Support Us!

Building a better Apolyton through better information. Click here and take our poll!
Non-US visitors, click here!

Powered by: vBulletin Version 2.0.3
Copyright ©2000, 2001, Jelsoft Enterprises Limited.

Page generated in 0.0383 seconds (89.69% PHP - 10.31% MySQL) with 30 queries
Page Loading Time:

Support Apolyton: Amazon USA | Amazon UK | Amazon DE | Amazon FR |
Support Apolyton and get FREE PLUS, Buy from Chips&Bits: Galactic Civilizations | Galactic Civilizations: Deluxe Edition | Call to Power 2 | Civilization: The Boardgame | GURPS/ Alpha Centauri | Alpha Centauri | Civilization IV | Civilization III: Complete |


Front Page | Civilization IV | Civilization III | Civilization II | Call to Power II | Alpha Centauri | Master of Orion III
Rise of Nations | Galactic Civilizations | Galactic Civilizations II | Misc
Alt.Civs | Civ I | C:CtP I | About | News | Directory | Apolyton Store | Forums | Chat | Columns | Interviews | Newsletter
Scenario League | CSC | Clash of Civs | Spanish Site | CtP Maps | Cradle of Civ | WesW's Ctp1/2 Site | Civ3 Haven

apolyton.net | apolyton.com | civilization2.net | civilization3.net | civilization4.net | civilizationiv.info | calltopower.net | galciv.net | galciv2.net | moo3.net