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 > Changing a string in the database
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    < Last Thread     Next Thread > Post New Thread     Post A Reply
tombom is offline tombom
Chieftain
Pining for the fjords
Oct 2004
time: 05:26
  Old Post 06-02-2005 21:29
Edit/Delete Message Reply w/Quote
#1 Report this post to a moderator
Changing a string in the database Increase the size of your Attachments

Is there any easy way to do this? I tried a version of AddStrNode which simply modifies the contents of the node when it finds it existing, but I always get an access violation.

EDIT: Actually, it simply has no effect.

Last edited by tombom on 06-02-2005 at 21:43

Martin Gühmann is offline Martin Gühmann
Emperor
Berlin, Germany
Mar 2001
time: 06:26
Post  Old Post 06-02-2005 22:27 Visit Martin Gühmann's homepage!
Edit/Delete Message Reply w/Quote
#2 Report this post to a moderator
Get a bigger avatar today!

Actually I don't get what you are trying to do, if you want to modify the string database, you can use any text editor to modify it. And if you want to modify certain parts of a sentence for instance you use placeholder variables of slic.

-Martin

tombom is offline tombom
Chieftain
Pining for the fjords
Oct 2004
time: 05:26
  Old Post 06-02-2005 22:32
Edit/Delete Message Reply w/Quote
#3 Report this post to a moderator
Enter the AD-FREE zone

I meant while in the code changing the value of a string already existing in g_theStringDB.

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

However still I don't get the point why modifying a string in the database, once it is loaded into the game from the textfiles. However AddStrNode can only add a string and can't modify it. The string database is not intended for string manipulation as it looks like.

-Martin

J Bytheway is offline J Bytheway
Emperor
England
Jul 2001
time: 05:26
  Old Post 08-02-2005 19:22 Visit J Bytheway's homepage!
Edit/Delete Message Reply w/Quote
#5 Report this post to a moderator
Remove this text

I think altering an existing string in the database is contrary to the philosophy of the strings database.

Fromafar is offline Fromafar
Prince

May 2003
time: 06:26
  Old Post 09-02-2005 02:30
Edit/Delete Message Reply w/Quote
#6 Report this post to a moderator
Increase Your PM Length

While mostly agreeing with the above remarks, I fail to see why modifying AddStrNode does not work, assuming you add some valid code to the "// Key exists: do not add" branch.
That is, if you are modifying a unique string. Do you know if InsertStr is called after you have modified your string? Before modifying AddStrNode, it would have detected that the string already existed (AddStrNode fails), and would have created a new entry with a different (key) name. After modifying AddStrNode, calling InsertStr may cause AddStrNode to succeed and overwrite the string once more!

However, you may consider explaining what game effect you want to achieve. Maybe there are more ways to do it than modifiying the text database.

Mirimunchkin is offline Mirimunchkin

Chieftain

Jan 2005
time: 05:26
  Old Post 13-02-2005 19:08
Edit/Delete Message Reply w/Quote
#7 Report this post to a moderator
Support Apolyton, buy Call to Power 2

Given that the AIs aren't really artificial intelligences, does anyone know what structure the 'databases' take? Are they true DBs (if so what type) or simple flat files?

Martin Gühmann is offline Martin Gühmann
Emperor
Berlin, Germany
Mar 2001
time: 06:26
Post  Old Post 13-02-2005 20:52 Visit Martin Gühmann's homepage!
Edit/Delete Message Reply w/Quote
#8 Report this post to a moderator
Support Apolyton, buy Civilization: The Boardgame

The data of the databases are stored in simple text files, e.g. unit.txt, tileimp.txt, goods.txt, strategies.txt, etc.

The data is loaded into the program on startup or on game reload. (Necessary for scenarios with different rule sets.)

For a standart game this means that you can change the rules during the game, but not to extensive, as the game for instance saves which technology you have and that is an index into the database.

And so far I don't see the sense behind adding or modifing a string during the game, to that database that can be done off-line, since it should be clear before the game which strings will be used.

-Martin

Mirimunchkin is offline Mirimunchkin

Chieftain

Jan 2005
time: 05:26
  Old Post 14-02-2005 00:47
Edit/Delete Message Reply w/Quote
#9 Report this post to a moderator
Inflate your Upload Space

Txs for the speedy reply, Martin.

It's what I expected from what I've found so far. It's just that I always worked in environments where databases were databases (DB2 & suchlike) and all other data was held in files. So I was just a little worried when people started talking about databases!

I've started trying to get a feel for the coding logic so, hopefully, I'll be better able to contribute to these discussions in future.

  < Last Thread     Next Thread > Post New Thread     Post A Reply
All times are GMT. The time now is 05:26.
Apolyton Time is 00:26.
    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.0321 seconds (86.59% PHP - 13.41% 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