 |
|
ahenobarb
|
|
Does anyone know how to access the numerical constants in the non-unit database files?
If you want to get the constants for the unit.txt file you can ues this method:
UnitRecord[0] = UnitDB(UNIT_WARRIOR);
tmpArm = UnitDB(UnitRecord[0]).Armor;
But the unit database file is set up like this:
## UNIT 0
UNIT_ABOLITIONIST {
...
Firepower 1
Armor 1
...
}
How would you access the constants in the terrain file when the values there are set up like this?
TERRAIN_FOREST {
EnvBase {
Score 50
Food 10
Shield 5
Gold 10
}
}
I noticed in the Greatlibrary.txt file, they just wrote in the values by hand, but I'm hoping there is a way for SLIC to access the information without needing to be told what the values are.
|
|
|  |
 |
|
ahenobarb
|
|
The game launches but hangs when a game is started with:
Value[0] = TerrainDB(TERRAIN_FOREST);
tmpAtt = TerrainDB(Value[0]).food;
I think the problem is how to get the values inside the second set of brackets.
code:
TERRAIN_FOREST {
EnvBase {
Score 50
Food 10
Shield 5
Gold 10
}
}
How to make "TerrainDB(Value[0]).food" into "TerrainDB(Value[0]).EnvBase.food"? Obviously this syntax won't work, so I tried a double hop with:
Value[0] = TerrainDB(TERRAIN_FOREST);
Value[1] = TerrainDB(Value[0]).Envbase;
tmpAtt = TerrainDB(Value[1]).food;
But this just causes another game hang. ANy ideas?
Last edited by ahenobarb on 17-03-2003 at 03:07
|
|
|  |
 |
|
Peter Triggs
|
|
Gone Fishin, Canada
Jan 2000 time: 05:26
|
|
That's the theory. But, IIRC, I tried it with size=100 and size=10000 (bigger than the map area) and got incomprehensible results.
I wanted to use it in a function to find the areas of the oceans (it's supposed to work with oceans too) that two water locations are in so that if the areas were the same, I would know that they were in the same ocean.
|
|
|  |
 |
|
ahenobarb
|
|
quote: Originally posted by Peter Triggs
That's the theory. But, IIRC, I tried it with size=100 and size=10000 (bigger than the map area) and got incomprehensible results.
I wanted to use it in a function to find the areas of the oceans (it's supposed to work with oceans too) that two water locations are in so that if the areas were the same, I would know that they were in the same ocean. |
Hmmm. Didn't know that about the oceans, but it makes sense I suppose. One problem may be however, that the question is whether the continent is "bigger", so if it is the same size, the answer is no. You may have to do a size -1 equation to get the result?
|
|
|  |
 |
|  |
All times are GMT. The time now is 05:26. Apolyton Time is 00:26. |
top of page
|
| archivepost |
|
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
|
|
|
|
|
|