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-Source Code Project > E's Source Code attempts
Show a Printable Version | Email This Page to Someone! | Receive updates to this thread | Report this to Apolyton news!
CivGroups
CTP2 Source Code Project (59): Not a Member - Join

bottom of page
  
Author
Thread   
Pages (3): [ 1   2   3   ]
< Last Thread     Next Thread > Post New Thread     Post A Reply
E is offline E
King
July 24,2005 Ctp2 Tiles in sig!
May 1999
time: 21:18
  Old Post 31-08-2005 11:34 Visit E's homepage!
Edit/Delete Message Reply w/Quote
#61 Report this post to a moderator
Enter the AD-FREE zone

Still working but martin I'm getting this (and I didnt touch it!)

code:
CTPDatabase.cpp F:\SVN-Code\trunk\ctp2_code\gs\newdb\CTPDatabase.cpp(166) : error C2039: 'Serialize' : is not a member of 'EndGameObjectRecord' F:\SVN-Code\trunk\ctp2_code\gs\newdb\EndGameObjectRecord.h(38) : see declaration of 'EndGameObjectRecord' C:\Program Files\Microsoft Visual Studio\VC98\INCLUDE\xmemory(59) : while compiling class-template member function 'void __thiscall CTPDatabase::Serialize(class CivArchive &)' F:\SVN-Code\trunk\ctp2_code\gs\newdb\CTPDatabase.cpp(181) : error C2664: '__thiscall EndGameObjectRecord::EndGameObjectRecord(const class EndGameObjectRecord &)' : cannot convert parameter 1 from 'class CivArchive' to 'const class EndGameObjectRecor d &' Reason: cannot convert from 'class CivArchive' to 'const class EndGameObjectRecord' No constructor could take the source type, or constructor overload resolution was ambiguous C:\Program Files\Microsoft Visual Studio\VC98\INCLUDE\xmemory(59) : while compiling class-template member function 'void __thiscall CTPDatabase::Serialize(class CivArchive &)'

Martin Gühmann is offline Martin Gühmann
Emperor
Berlin, Germany
Mar 2001
time: 06:18
Post  Old Post 31-08-2005 21:27 Visit Martin Gühmann's homepage!
Edit/Delete Message Reply w/Quote
#62 Report this post to a moderator
Inflate your Upload Space

quote:
Originally posted by E
Still working but martin I'm getting this (and I didnt touch it!)


The remark in parentheses hits your problem, of course these *Record.* files have to be updated, actual your compiler is supposed to do it automaticly, and if you do a complete rebuild it just does this. But you can update the file manually. To do this just select the EndGameObject.cdb in the file view of Visual Studio and press Ctrl + F7. And then dbgen updates the files for your, given you have recompiled it before.

-Martin

Fromafar is offline Fromafar
Prince

May 2003
time: 06:18
  Old Post 31-08-2005 23:33
Edit/Delete Message Reply w/Quote
#63 Report this post to a moderator
Support Apolyton, buy Call to Power 2

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 is offline E
King
July 24,2005 Ctp2 Tiles in sig!
May 1999
time: 21:18
  Old Post 01-09-2005 11:03 Visit E's homepage!
Edit/Delete Message Reply w/Quote
#64 Report this post to a moderator
Tired of ads?

Ok I updated stuff and I think I was following what you said. its compiling but its not working when i add a good in the radius or at all like my working code.


code:
if(rec->GetNumNeedsCityGood() > 0) { sint32 g; bool found = false; for(g = 0; g < (m_buyingResources[g] + m_collectingResources[g]); g++) { if((HasResource(g) || m_buyingResources[g]) && rec->GetNeedsCityGoodIndex(g)) break; } if(!found) return FALSE; }

Martin Gühmann is offline Martin Gühmann
Emperor
Berlin, Germany
Mar 2001
time: 06:18
Post  Old Post 01-09-2005 21:12 Visit Martin Gühmann's homepage!
Edit/Delete Message Reply w/Quote
#65 Report this post to a moderator
Full PM-box? Change here!

quote:
Originally posted by E
Ok I updated stuff and I think I was following what you said. its compiling but its not working when i add a good in the radius or at all like my working code.


Of course this doesn't work, instead of deleting one lines you deleted two lines, and none of them should be deleted. Actual one of them has to be modifed.

And you have modified two lines, the first one is modified correctly but the second one doesn't look like, the one in NeedsCityGood. And obviously you didn't get this: GetNeedsCityGoodIndex returns an interger that represents an index into the resource database. An integer that represents a resource database index is expected by the [] operator of m_buyingResources and m_collectingResources. That should be now obviously.

-Martin

E is offline E
King
July 24,2005 Ctp2 Tiles in sig!
May 1999
time: 21:18
  Old Post 02-09-2005 09:06 Visit E's homepage!
Edit/Delete Message Reply w/Quote
#66 Report this post to a moderator
Increase the size of your Attachments

I havent seen this before:

code:
F:\SVN-Code\trunk\ctp2_code\gs\gameobj\CityData.cpp(5411) : error C2446: '<' : no conversion from 'const class ResourceRecord *' to 'long' This conversion requires a reinterpret_cast, a C-style cast or function-style cast F:\SVN-Code\trunk\ctp2_code\gs\gameobj\CityData.cpp(5411) : error C2040: '<' : 'long' differs in levels of indirection from 'const class ResourceRecord *'



I did this...

code:
if(rec->GetNumNeedsCityGood() > 0) { sint32 g; bool found = false; for(g = 0; g < (rec->GetNeedsCityGood(g)); g++) { if((m_buyingResources[g] + m_collectingResources[g]) > 0) { if((HasResource(g) || m_buyingResources[g]) && rec->GetNeedsCityGoodIndex(g)) break; } } if(!found) return FALSE; }


I'm leaving on vacation for tweeks so I hope I can figure out on my own before then.

Martin Gühmann is offline Martin Gühmann
Emperor
Berlin, Germany
Mar 2001
time: 06:18
Post  Old Post 02-09-2005 21:21 Visit Martin Gühmann's homepage!
Edit/Delete Message Reply w/Quote
#67 Report this post to a moderator
Support Apolyton buy from Amazon

quote:
Originally posted by E
I havent seen this before:
code:
F:\SVN-Code\trunk\ctp2_code\gs\gameobj\CityData.cpp(5411) : error C2446: '<' : no conversion from 'const class ResourceRecord *' to 'long' This conversion requires a reinterpret_cast, a C-style cast or function-style cast F:\SVN-Code\trunk\ctp2_code\gs\gameobj\CityData.cpp(5411) : error C2040: '<' : 'long' differs in levels of indirection from 'const class ResourceRecord *'



I did this...

code:
if(rec->GetNumNeedsCityGood() > 0) { sint32 g; bool found = false; for(g = 0; g < (rec->GetNeedsCityGood(g)); g++) { if((m_buyingResources[g] + m_collectingResources[g]) > 0) { if((HasResource(g) || m_buyingResources[g]) && rec->GetNeedsCityGoodIndex(g)) break; } } if(!found) return FALSE; }


quote:
Originally posted by E
I'm leaving on vacation for tweeks so I hope I can figure out on my own before then.


Of course this doesn't compile, GetNeedsCityGood(g) returns a pointer on a resource database record. It can be converted to a number but you better don't do it, actual you shouldn't but in the condition of the for-loop on both sides the counting variable, that could lead to nice endless loops. In fact in the condition of the for-loop in the CityStyleOnly code you have there a GetNum function. And in your latest version you deleted the line where the found variable is set to true.

Actual you already identified the line that contains the essential difference to your CityStyleOnly code:

quote:
Originally posted by E
code:
// Added by E - Compares Unit CityStyle to the CityStyle of the City if(rec->GetNumCityStyleOnly() > 0) { sint32 s; bool found = false; for(s = 0; s < rec->GetNumCityStyleOnly(); s++) { if(rec->GetCityStyleOnlyIndex(s) == m_cityStyle) { found = true; break; } } if(!found) return FALSE; }


The line in bold must contain another condition, and I already told you the condition, it's the sum of collected and incomming of a certain type of goods. The GetNeedsCityGoodIndex returns you an index for the good you want to check. Actual I already told you that in word:

m_buyingResources[sint32]
m_collectingResources[sint32]
sint32 GetNeedsCityGoodIndex(sint32)

So now put one and one together and do the code.

-Martin

E is offline E
King
July 24,2005 Ctp2 Tiles in sig!
May 1999
time: 21:18
  Old Post 20-09-2005 00:57 Visit E's homepage!
Edit/Delete Message Reply w/Quote
#68 Report this post to a moderator
Increase the size of your Attachments

Martin, I'll give my code a shot but since you mde the civilsation.cdb I was wondering if using building and wonder attributes could be used to make Civilzation traits, like civ3 but much more diverse and better as an example I would add these flags to the cdb:

code:
// for national flags StringID NationUnitFlag // from building.cdb to add Civilisation traits Bit(Float) OffenseBonusLand Bit(Float) OffenseBonusWater Bit(Float) OffenseBonusAir Bit(Int) HappyInc Bit DoubleTelevangelists Bit(Float) ProductionPercent Bit(Float) FoodPercent Bit(Float) CommercePercent Bit(Float) SciencePercent Bit NoUnhappyPeople Bit NoRushBuyPenalty Bit(Float) LowerCrime Bit(Float) LowerPeaceMovement Bit(Int) GoldPerCitizen Bit ProtectFromNukes Bit(Float) ProtectFromBioAgents Bit(Float) ProtectFromNanoVirus Bit Television Bit Brokerage Bit NuclearPlant Bit(Float) SciencePerPop Bit(Int) RaiseOvercrowdingLevel Bit(Int) RaiseMaxPopulation Bit(Int) StarvationProtection // from Wonder.cdb for additional civ attributes Bit(Int) ReduceReadinessCost Bit EmbassiesEverywhere Bit(Int) DecCrimePercent Bit(Int) IncKnowledgePercent Bit(Int) DecEmpireSize Bit(Int) IncHappinessEmpire Bit(Int) IncConvertedCitiesFeePercent Bit(Int) GoldPerWaterTradeRoute Bit(Int) GoldPerTelevision Bit GlobalRadar Bit SpiesEverywhere Bit(Int) GoldPerInternationalTradeRoute Bit ProtectFromBiologicalWarfare Bit(Int) PollutersToParks Bit(Int) ReduceWorldPollution Bit AllCitizensContent Bit EliminateNukes Bit AllBoatsDeepWater Bit(Int) IncreaseBoatMovement Bit FreeTradeRoutes Bit(Int) DecreaseMaintenance Bit(Int) RandomAdvanceChance Bit(Int) IncreaseHp Bit(Int) MultiplyTradeRoutes Bit(Int) IncreaseScientists Bit(Int) OtherCivRandomAdvanceChance Bit(Int) IncreaseProduction Bit(Int) BonusGold Bit(Int) IncreaseFoodAllCities Bit(Int) TemporaryFullHappiness Bit RevoltingCitiesJoinPlayer Bit NoPollutionUnhappiness Bit EmbassiesEverywhereEvenAtWar Bit(Int) IncreaseSpecialists Bit(Int) IncreaseCathedrals Bit(Int) IncreaseBrokerages Bit(Int) IncreaseRegard Bit PreventConversion Bit ProtectFromBarbarians Bit(Record Building) BuildingEverywhere Bit(Float) PollutionPercent Bit(Float) PollutionAmount


as for the one in bold should it be astring or should we make it a record. this would be code to add national flags to be displayed instead of the color flags for units. I figure I can get the tga info for the flag used and create a bunch of tgas for the national flags. I will take me a day to do all 44 civs but I think it would be nice. And I think I'd have to do that change in the DrawHerald code. but we can come back to this later

Martin Gühmann is offline Martin Gühmann
Emperor
Berlin, Germany
Mar 2001
time: 06:18
Post  Old Post 20-09-2005 01:44 Visit Martin Gühmann's homepage!
Edit/Delete Message Reply w/Quote
#69 Report this post to a moderator
Support Apolyton, buy GURPS/ Alpha Centauri

quote:
Originally posted by E
as for the one in bold should it be a string or should we make it a record.


Depends on what you want to do it with. Actual I would prefer to make it a string not a StringID, this way you don't have to modify any text files of the string databses, and all languages it would be the same.

quote:
Originally posted by E
this would be code to add national flags to be displayed instead of the color flags for units.


Why instead and not in addition?

quote:
Originally posted by E
I figure I can get the tga info for the flag used and create a bunch of tgas for the national flags. I will take me a day to do all 44 civs but I think it would be nice.


We have now 63 civs in the game since Locutus' interface update, and with a new interface the game could even now handle much more civs.

quote:
Originally posted by E
And I think I'd have to do that change in the DrawHerald code. but we can come back to this later


I am not sure whether it is so simple.

-Martin

E is offline E
King
July 24,2005 Ctp2 Tiles in sig!
May 1999
time: 21:18
  Old Post 20-09-2005 08:08 Visit E's homepage!
Edit/Delete Message Reply w/Quote
#70 Report this post to a moderator
Got spare money?

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 is offline Martin Gühmann
Emperor
Berlin, Germany
Mar 2001
time: 06:18
Post  Old Post 20-09-2005 21:18 Visit Martin Gühmann's homepage!
Edit/Delete Message Reply w/Quote
#71 Report this post to a moderator
Avatar Enlargement: We've got the solution

quote:
Originally posted by E
going through the code but on my compile I got this:

[..]

its not my code and i have the latest svn update.


That's a problem of the *.dsw file, I commit an update, when I have done the DiffDB. (Actual this is the plan)

quote:
Originally posted by E
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; }


However this code doesn't work, now you have to modify one line, delete one line and add one line. You don't modify the found variable, that's bad.

And the other think is: What part of the following statement did you not understand?

<returns a good database index>GetNeedsCityGoodIndex
m_buyingResources[<exspects a good database index>]
m_collectingResources[<exspects a good database index>]

-Martin

Martin Gühmann is offline Martin Gühmann
Emperor
Berlin, Germany
Mar 2001
time: 06:18
Post  Old Post 20-09-2005 21:29 Visit Martin Gühmann's homepage!
Edit/Delete Message Reply w/Quote
#72 Report this post to a moderator
Support Apolyton buy from Amazon

quote:
Originally posted by Martin Gühmann

quote:
Originally posted by E
going through the code but on my compile I got this:

[..]

its not my code and i have the latest svn update.



That's a problem of the *.dsw file, I commit an update, when I have done the DiffDB. (Actual this is the plan)


Well I forgot to mention the solution of course you have to recompile the EndGameObject.cdb manually. To do this just select the file in the tree view of MSVS and press Ctrl+F7.

Oh and please read again my last post especilly the last part I had some problem with this forum html-parser.

-Martin

E is offline E
King
July 24,2005 Ctp2 Tiles in sig!
May 1999
time: 21:18
  Old Post 21-09-2005 00:39 Visit E's homepage!
Edit/Delete Message Reply w/Quote
#73 Report this post to a moderator
Tired of ads?

quote:
Originally posted by Martin Gühmann


However this code doesn't work, now you have to modify one line, delete one line and add one line. You don't modify the found variable, that's bad.

And the other think is: What part of the following statement did you not understand?

<returns a good database index>GetNeedsCityGoodIndex
m_buyingResources[<exspects a good database index>]
m_collectingResources[<exspects a good database index>]

-Martin



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, but in one post where I bolded everything you said the line to delete is below the bold which is the one I deleted.

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?

tonight I might start from scratch (again) and try to identify what needs to be changed and try to understand why it needs to be changed again although my old code worked.

Martin Gühmann is offline Martin Gühmann
Emperor
Berlin, Germany
Mar 2001
time: 06:18
Post  Old Post 21-09-2005 02:06 Visit Martin Gühmann's homepage!
Edit/Delete Message Reply w/Quote
#74 Report this post to a moderator
Suffering from ads?

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

E is offline E
King
July 24,2005 Ctp2 Tiles in sig!
May 1999
time: 21:18
  Old Post 22-09-2005 08:44 Visit E's homepage!
Edit/Delete Message Reply w/Quote
#75 Report this post to a moderator
Got spare money?

Ok, I think I figured what you are saying and it compiles and it works EXCEPT I removed the

code:
((m_buyingResources[g] + m_collectingResources[g]) > 0)


Not sure how to fit that back in... but here is the code and i did anothre compiled revision


code:
if(rec->GetNumNeedsCityGood() > 0) { sint32 g; bool found = false; for(g = 0; g < rec->GetNumNeedsCityGood(); g++) { if((HasResource(rec->GetNeedsCityGoodIndex(g))) || m_buyingResources[rec->GetNeedsCityGoodIndex(g)]) found = true; break; } if(!found) return FALSE; }

Martin Gühmann is offline Martin Gühmann
Emperor
Berlin, Germany
Mar 2001
time: 06:18
Post  Old Post 22-09-2005 21:34 Visit Martin Gühmann's homepage!
Edit/Delete Message Reply w/Quote
#76 Report this post to a moderator
Increase Your PM Length

quote:
Originally posted by E
Ok, I think I figured what you are saying and it compiles and it works EXCEPT I removed the
code:
((m_buyingResources[g] + m_collectingResources[g]) > 0)


Not quite actual I told you that this is the condition to use instead of the condition you use in the CityStyle code. Of course this line has to be modified.

quote:
Originally posted by E
Not sure how to fit that back in... but here is the code and i did anothre compiled revision


code:
if(rec->GetNumNeedsCityGood() > 0) { sint32 g; bool found = false; for(g = 0; g < rec->GetNumNeedsCityGood(); g++) { if((HasResource(rec->GetNeedsCityGoodIndex(g))) || m_buyingResources[rec->GetNeedsCityGoodIndex(g)]) found = true; break; } if(!found) return FALSE; }


Actual you have removed two lines instead of one line. (The closing brace had its own line.)

And the code does not do what it is supposed to do. If in the array is just one good than it is ok, but if there are more goods in the list that are supposed to be checked these aren't checked. The break breaks the loop in its first iteration. So what did I tell you about brace-blocks?

And one thing I should have done at first is to insist on the indention, the if(!found) is on the same level as the for loop.

-Martin

E is offline E
King
July 24,2005 Ctp2 Tiles in sig!
May 1999
time: 21:18
  Old Post 22-09-2005 21:43 Visit E's homepage!
Edit/Delete Message Reply w/Quote
#77 Report this post to a moderator
Full PM-box? Change here!

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...

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.

Oh and an english note "actually" is used not "actual" just caught that a few times, but no problem.

Martin Gühmann is offline Martin Gühmann
Emperor
Berlin, Germany
Mar 2001
time: 06:18
Post  Old Post 22-09-2005 22:08 Visit Martin Gühmann's homepage!
Edit/Delete Message Reply w/Quote
#78 Report this post to a moderator
Inflate your Upload Space

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

 
Pages (3): [ 1   2   3   ]
< Last Thread     Next Thread > Post New Thread     Post A Reply
All times are GMT. The time now is 05:18.
Apolyton Time is 00:18.
    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.0684 seconds (92.57% PHP - 7.43% MySQL) with 36 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