 |
|  |
 |
|
Martin Gühmann
|
 |
Berlin, Germany
Mar 2001 time: 06:32
|
|
I am trying to figure out where the problem of the slic database access lies. So far I know this:
code:
int1 = GovernmentDB(GOVERNMENT_CORPORATE_REPUBLIC).CrimeOffset;
This does work the argument of GovernmentDB is a string variable of the government name or something like this. This doesn't work and make the game crash:
code:
int1 = GovernmentDB(3).CrimeOffset;
I also know that the code somewhere converts the GOVERNMENT_CORPORATE_REPUBLIC into a number. Unfortunatly I don't know where it is determined that GovernmentDB accepts just an advance name/type or whatever but not a number, maybe it is somewhere in these *.y or *.l files determined, but so far I wasn't able to find it.
I only found the place where you can have a GovernmentDB, unfortunatly it is a template and the parser is so far a miracle to me.
So does anyone has some knowledge about Bison?
-Martin
Last edited by Martin Gühmann on 16-01-2004 at 04:04
|
|
|  |
 |
|
Peter Triggs
|
|
Gone Fishin, Canada
Jan 2000 time: 05:32
|
|
quote:
I am trying to figure out where the problem of the slic database access lies.
|
Are you trying to find a function that returns the GovernmentDB index rather than the string?
quote:
I only found the place where you can have a GovernmentDB, unfortunatly it is a template and the parser is so far a miracle to me.
|
Me too.
|
|
|  |
 |
|
MrBaggins
|
|
I'm looking into this for the other issue. I'll probably bump into at least some info for this when I'm doing the alterations to the parser.
|
|
|  |
 |
|
MrBaggins
|
|
right... I understand...
Bison and flex parse the db structure datafiles, used by ctpdb to create the actual database parser and db classes in ctp2.exe
The issue is that the accessor used by the slic function accessing the data object takes a constant identifier.. rather than an index.
|
|
|  |
 |
|
Peter Triggs
|
|
Gone Fishin, Canada
Jan 2000 time: 05:32
|
|
Nice work, Martin.
quote:
I tried it on the settler and I got 10000 MaxMovePoints instead of 100 as you find it in the unit.txt.
|
Some of the members of UnitRecord are doubles (m_MaxMovePoints is one of them) and Mr Ogre wrote:
quote:
Floating point values are multiplied by 100 and converted to ints, since SLIC does not otherwise support floating point variables.
|
I guess this is what you're seeing and you'll have to counter it.
|
|
|  |
 |
|  |
 |
|
Peter Triggs
|
|
Gone Fishin, Canada
Jan 2000 time: 05:32
|
|
I'm not having any luck with this Slic Database code. I put the following simple Slic script into the Activision World Map scenario and can't get it parsed. Am I missing something?
code:
HandleEvent(BeginTurn) 'Test' post {
int_t i;
int_t numunits;
unit_t tmpUnit;
int_t unit2;
int_t unit3;
int_t unit4;
if (g.year>0){
numUnits=player[0].units;
if (numUnits){
for (i=0; i < numUnits; i=i+1){
GetUnitByIndex(player[0],i,tmpUnit);
if (tmpUnit.valid){
unit[0]=tmpUnit;
unit2=unitDB(UNIT_TANK);
unit3=unitDB(tmpUnit.type);
unit4=unitDB(unit[0].type);
}
}
}
}
}
|
|
|  |
 |
|
MrBaggins
|
|
What are you working on currently, Peter? The SLIC files for AI functionality?
|
|
|  |
 |
|
Peter Triggs
|
|
Gone Fishin, Canada
Jan 2000 time: 05:32
|
|
I filled in most of the AI SLIC functions a while back but haven't properly debugged them yet. Now that the database access is going I want to get CTC working as a scenario. It's a first step towards getting the mods converted back to scenarios, which is what they should have been in the first place.
|
|
|  |
 |
|
Peter Triggs
|
|
Gone Fishin, Canada
Jan 2000 time: 05:32
|
|
I put in personalityDB, AgeDB, and SpriteDB. Most of the others have strings, which aren't a lot of use to us yet.
I'm in the process of organizing my stuff so that I can post it, hopefully, later tonight.
Another thing I've done is to add two new buildlists to strategy.ctb so that you get:
code:
// Unit Percents must total to 1 (100%)
OffensiveUnitsPercent 0.20
DefensiveUnitsPercent 0.40
RangedUnitsPercent 0.30
BombardUnitsPercent 0.10
FlankerUnitsPercent 0.0
SeaUnitsPercent 0.0
AirUnitsPercent 0.0
...
// Types of standard units that should be built
OffensiveUnitList UNIT_BUILD_LIST_OFFENSE
DefensiveUnitList UNIT_BUILD_LIST_DEFENSE
RangedUnitList UNIT_BUILD_LIST_RANGED
BombardUnitList UNIT_BUILD_LIST_BOMBARD
FlankerUnitList UNIT_BUILD_LIST_FLANKER
SeaUnitList UNIT_BUILD_LIST_SEA
AirUnitList UNIT_BUILD_LIST_AIR
I also expanded the garrison count categories:
code:
// minimum number of units to keep in cities as a garrison
OffensiveGarrisonCount 0
DefensiveGarrisonCount 1
RangedGarrisonCount 1
BombardGarrisonCount 0
FlankerGarrisonCount 0
One of the first things that WesW wanted when the game was released was a more flexible unit building system. The question is: Should I include this stuff at this point?
|
|
|  |
 |
|
MrBaggins
|
|
I think we need to have a chat discussion about the AI. I spent spare time on Friday, looking over the AI code.
|
|
|  |
 |
|
Peter Triggs
|
|
Gone Fishin, Canada
Jan 2000 time: 05:32
|
|
Yes, so it will mean re-doing all the strategies. I've put some data in for the vanilla game and CTC but haven't done the Activision scenarios.
|
|
|  |
 |
|
Peter Triggs
|
|
Gone Fishin, Canada
Jan 2000 time: 05:32
|
|
Yup, I'm still debugging.
|
|
|  |
All times are GMT. The time now is 05:32. Apolyton Time is 00:32. |
top of page
|
|
|
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
|
|
|
|
|
|