 |
|
Fromafar
|
|
You may also have to delete the ctp2_code/gs/database/RiskRecord.h file manually. The SVN update did not delete it for me, but kept it as an unmanaged file. When this file is still present, you will get a lot of errors involving g_theRiskDB.
|
|
|  |
 |
|
E
|
 |
July 24,2005 Ctp2 Tiles in sig!
May 1999 time: 21:18
|
|
going through the code but on my compile I got this:
code:
F:\SVN-Code\trunk\ctp2_code\gs\slic\SlicDBConduit.h(118) : error C2039: 'm_intArrayAccessor' : is not a member of 'EndGameObjectRecordAccessorInfo'
..\gs\newdb\EndGameObjectRecord.h(163) : see declaration of 'EndGameObjectRecordAccessorInfo'
F:\SVN-Code\trunk\ctp2_code\gs\slic\SlicDBConduit.h(111) : while compiling class-template member function 'long __thiscall SlicDBConduit::GetValue(long,const char *,const long
)'
F:\SVN-Code\trunk\ctp2_code\gs\slic\SlicDBConduit.h(119) : error C2039: 'm_intArrayAccessor' : is not a member of 'EndGameObjectRecordAccessorInfo'
..\gs\newdb\EndGameObjectRecord.h(163) : see declaration of 'EndGameObjectRecordAccessorInfo'
F:\SVN-Code\trunk\ctp2_code\gs\slic\SlicDBConduit.h(111) : while compiling class-template member function 'long __thiscall SlicDBConduit::GetValue(long,const char *,const long
)'
F:\SVN-Code\trunk\ctp2_code\gs\slic\SlicDBConduit.h(121) : error C2039: 'm_floatArrayAccessor' : is not a member of 'EndGameObjectRecordAccessorInfo'
..\gs\newdb\EndGameObjectRecord.h(163) : see declaration of 'EndGameObjectRecordAccessorInfo'
F:\SVN-Code\trunk\ctp2_code\gs\slic\SlicDBConduit.h(111) : while compiling class-template member function 'long __thiscall SlicDBConduit::GetValue(long,const char *,const long
)'
F:\SVN-Code\trunk\ctp2_code\gs\slic\SlicDBConduit.h(122) : error C2039: 'm_floatArrayAccessor' : is not a member of 'EndGameObjectRecordAccessorInfo'
..\gs\newdb\EndGameObjectRecord.h(163) : see declaration of 'EndGameObjectRecordAccessorInfo'
F:\SVN-Code\trunk\ctp2_code\gs\slic\SlicDBConduit.h(111) : while compiling class-template member function 'long __thiscall SlicDBConduit::GetValue(long,const char *,const long
)'
its not my code and i have the latest svn update.
but I did this code and it compiled, but I cant test it since the above errors prevent compiling ctp2.exe
code:
if(rec->GetNumNeedsCityGood() > 0) {
sint32 g;
bool found = false;
for(g = 0; g < rec->GetNumNeedsCityGood(); g++) {
if(rec->GetNeedsCityGoodIndex(g) == (m_buyingResources[g] + m_collectingResources[g]) > 0) {
if((HasResource(g) || m_buyingResources[g]) && rec->GetNeedsCityGoodIndex(g)== g)
break;
}
}
if(!found)
return FALSE;
}
|
|
|  |
 |
|
Martin Gühmann
|
 |
Berlin, Germany
Mar 2001 time: 06:18
|
|
quote: Originally posted by E
can you give me more detail as to what to add what to modify and what to delete? not the lines specifically but maybe explain why somethings have to be added, etc.
also for the add line. I'm assuming I have to replace the found = true line that I deleted, |
Actual you have to readd, otherwise your algorithm can't find out whether you have the needed good.
quote: Originally posted by E
but in one post where I bolded everything you said the line to delete is below the bold which is the one I deleted. |
The language difficuilies, actual I said: "but the line to delete is under the bold" it is under not below. A litteral translation into German can mean that it is one of the bold and according to Meriam Webster under can mean "within the group or designation of" in English and that is indeed the intended meaning: The line to delete is within the group of the bold. Otherwise I would be too specific. Obviously it can be very misstakable.
quote: Originally posted by E
as far as the statement, the part i guess I didnt understand is the bracket. I assumed that my twooptions were to not pass a variable (leave it blank) or pass the "g" variable. in which case the code only comiled if I passed the g. So how did I mess that up? |
The brakets, they form an operator something like plus or minus, the only difference is that it works on arrays or objects if they have such an operator defined.
It is index based, therefore it accepts everything that is integerlike. The output of the GetNeedsCityGoodIndex is an integer, to be precise it is sint32 representing an index into the Resource aka Good database.
If you know look at the operator of the Resource class then you see that it accesses the underlying m_supply array, and actual I asked you for the size of this array, the answer is that it has the same size as the Resource database, meaning each element of that array represents some piece of information of exactly one element in the Resource database. And of course the according infomation for one good can be found under the same index as the good in its database.
Again to this, actual I just have described it above, so the final conclusion is up to you. But just this: The output of one thing is the input of two other things.
<returns a good database index>GetNeedsCityGoodIndex
m_buyingResources[<exspects a good database index>]
m_collectingResources[<exspects a good database index>]
-Martin
|
|
|  |
 |
|
Martin Gühmann
|
 |
Berlin, Germany
Mar 2001 time: 06:18
|
|
quote: Originally posted by E
so should I move the brace ahead of the break? does that keep it looping? or do I add another brace at the before the found=true and another closing brace. not sure about how that affects the looping. I have to relook brace-blocks... |
I don't quite understand this. Here is a try:
whatever;
In c++ the above is a statement, look at the semicolon at the end of the line. If ypi put multipile statements into a block of braces you combine them to one statement.
{whatever}
So the stuff can be counted as statement as well.
An "if" just executes the next statement if its condition is true.
quote: Originally posted by E
for ">" I need to add that line back in, but what is the value of that check regarding the code, not sure what its accomplishing. |
There is a difference to your code, its cleaner, your code asumes that this m_buyingResources[rec->GetNeedsCityGoodIndex(g)] returns a BOOL, but it returns an integer. In that case it doesn't matter, because non-zero values are casted to TRUE and otherwise to FALSE. In my opinion you shouldn't mix up such things, even if there is like here no difference. If you start to mix up such things and your data represents indices then you get a problem, zero is a valid indix. In fact such a problem was in the game, the AI in the default game couldn't use entertainers, and you gotn't a warning for the first wonder in the database when someone else had nealy doen it.
Its cleaner and in the case of doubt you save some bugs.
quote: Originally posted by E
Oh and an english note "actually" is used not "actual" just caught that a few times, but no problem. |
Well, thanks for pointing it out. In fact I wasn't sure about it, but you are right it has to be an adverb.
-Martin
|
|
|  |
 |
|  |
All times are GMT. The time now is 05:18. Apolyton Time is 00:18. |
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
|
|
|
|
|
|