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 > PROJECT: Playest II
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 (17): [ <<   2   3   4   5   6   7   8     >> ]
< Last Thread     Next Thread > Post New Thread     Post A Reply
Maquiladora is offline Maquiladora
Emperor

Jun 2001
time: 05:36
  Old Post 01-07-2004 00:37 Visit Maquiladora's homepage!
Edit/Delete Message Reply w/Quote
#121 Report this post to a moderator
Support Apolyton, buy GURPS/ Alpha Centauri

Downloaded and played some 50 turns of the new playtest. Nothing gone wrong yet, so thats good, but just a couple o things though.

Why is there such radical colours for the first 8 players? The bright green for player 3 is hard to look at. Fine if im playing with 32 i expect to get some strange colours, but not in the first 8. The dark blue for player 8 is hard to see on the graph too.

Of course its pretty easy to change the colors manually in the text file, but its not a good idea to have these as the default colours for someone new to the playtest.

Another thing you can see in the screenshot, the capital "C" on every window has a part missing from the font.

On the starting screen on map type select for Uranus it says, "Noth and South....".

Attachment: cs.gif
This has been downloaded 275 time(s).

Solver is offline Solver
Apolyton Duke Of Something
Latvia, Riga
Sep 2000
time: 07:36
  Old Post 01-07-2004 00:44 Visit Solver<br><img src=/forums/images/staff-icon.gif>'s homepage!
Edit/Delete Message Reply w/Quote
#122 Report this post to a moderator
Support Apolyton buy from Amazon

Default colors have been like that in previous playtests, too. I agree that player 3 is probably the worst one...

Then again, I'm playing with 11 players, and at least the colors are different enough.

BureauBert is offline BureauBert
Chieftain
Vienna, Europe
Apr 2003
time: 06:36
  Old Post 01-07-2004 00:54 Visit BureauBert's homepage!
Edit/Delete Message Reply w/Quote
#123 Report this post to a moderator
Support Apolyton, buy GURPS/ Alpha Centauri

CTP2 AE playtest is beating football!
Since I am almost a newbie here I have a feeling it's too early for serious treadjacking - therefore I put my reply to the Frenzy AI questions into the Frenzy AI revisited thread

Last edited by BureauBert on 03-07-2004 at 17:17

Solver is offline Solver
Apolyton Duke Of Something
Latvia, Riga
Sep 2000
time: 07:36
  Old Post 01-07-2004 01:53 Visit Solver<br><img src=/forums/images/staff-icon.gif>'s homepage!
Edit/Delete Message Reply w/Quote
#124 Report this post to a moderator
Browse Apolyton AD-FREE

Good posts there, nice thread it's going to be .

EPW is offline EPW
King
California, USA
Jan 2004
time: 21:36
  Old Post 03-07-2004 02:58 Visit EPW's homepage!
Edit/Delete Message Reply w/Quote
#125 Report this post to a moderator
Support Apolyton, pre-order Civilization IV

While playing the newest version I noticed that when you append items to multiple cities at once through the national manager, the voice that says 'building started" repeats over and over again and the game slows down a bit. It never lasts very long but its a bit annoying. Everything else works fine though

Solver is offline Solver
Apolyton Duke Of Something
Latvia, Riga
Sep 2000
time: 07:36
  Old Post 03-07-2004 03:02 Visit Solver<br><img src=/forums/images/staff-icon.gif>'s homepage!
Edit/Delete Message Reply w/Quote
#126 Report this post to a moderator
Inflate your Upload Space

Well, another bug associated with modern age is that sometimes air units will unstack on their own. Go play with some air units, you'll see what I mean easily, it happens often.

Also... if you order a unit to go somewhere pretty far, then the game thinks for several seconds before the unit starts moving. This was always the case, IIRC, but any way to work around that, perhaps?

EPW is offline EPW
King
California, USA
Jan 2004
time: 21:36
  Old Post 03-07-2004 05:55 Visit EPW's homepage!
Edit/Delete Message Reply w/Quote
#127 Report this post to a moderator
Enter the AD-FREE zone

The hotseat mode doesn't seem to work at all. It starts on the wrong player and there is no way to end the turn.

EPW is offline EPW
King
California, USA
Jan 2004
time: 21:36
  Old Post 03-07-2004 09:28 Visit EPW's homepage!
Edit/Delete Message Reply w/Quote
#128 Report this post to a moderator
Support Apolyton, buy Galactic Civilizations

Playing with mods (apolyton pack with goodmod) there are various texts that are missing on the new buttons and options. Is that expected?

Maquiladora is offline Maquiladora
Emperor

Jun 2001
time: 05:36
  Old Post 03-07-2004 12:11 Visit Maquiladora's homepage!
Edit/Delete Message Reply w/Quote
#129 Report this post to a moderator
Lose 30 kilos (of popups)

quote:
Also... if you order a unit to go somewhere pretty far, then the game thinks for several seconds before the unit starts moving. This was always the case, IIRC, but any way to work around that, perhaps?


Im getting this too, it certainly wasnt always this long a pause. I press "m" and give the Knight a route along roads and it takes about 1-2 seconds to respond. The funny thing is, the first 5 or so turns after i loaded the game, there was no pause, like it always is, then from about 5 turns in it pauses long every time i give a route.

Solver is offline Solver
Apolyton Duke Of Something
Latvia, Riga
Sep 2000
time: 07:36
  Old Post 03-07-2004 17:43 Visit Solver<br><img src=/forums/images/staff-icon.gif>'s homepage!
Edit/Delete Message Reply w/Quote
#130 Report this post to a moderator
Support Apolyton

Thinking of possible causes to that pause, it's probably not the pathfinder. The pathfinder is quick to actually find the path - indicated by the green line. But looks like there is some weirdo check after that, no idea yet on what it might be.

You know when it gets really annoying, it's with Tanks, when you order one to go some 20 tiles away from where it currently is. And if you're massing Tanks, getting several each turn and sending them to a rally point, it becomes a real annoyance.

Flinx is offline Flinx
Prince
Toronto, ON CANADA
Nov 2001
time: 00:36
  Old Post 05-07-2004 07:53 Visit Flinx's homepage!
Edit/Delete Message Reply w/Quote
#131 Report this post to a moderator
Support Apolyton, buy Civilization III: Complete

I installed CTP2 on new computer and added the 2004.06.28 playtest on top. Everything seemed to work ok except all of the messages are gobbledygook. When I got back home tonight, I put the 2004.06.28 playtest on top of 2004.05.19 which I have been playing and I am getting a mess of problems! 2004.06.15 also is giving me problems. Am I the only one? Is it because I am trying to play a saved game?

Flinx is offline Flinx
Prince
Toronto, ON CANADA
Nov 2001
time: 00:36
  Old Post 05-07-2004 07:59 Visit Flinx's homepage!
Edit/Delete Message Reply w/Quote
#132 Report this post to a moderator
Support Apolyton or Terrorists Win

Something I did notice when 2004.06.28 was working on the laptop I was using, was that I was able to set the colour profile to 01 in userprofile.txt which worked fine, but if I exited the game and reloaded I reverted back to 00.

Here is what is happening:
manually edit to =01 and load game -- get 01 colours
on exit, userprofile now has =1
load game, it does not understand =1 changes to =0 and uses 00 colours
on exit, userprofile now has =0

EPW is offline EPW
King
California, USA
Jan 2004
time: 21:36
  Old Post 05-07-2004 08:04 Visit EPW's homepage!
Edit/Delete Message Reply w/Quote
#133 Report this post to a moderator
Inflate your Upload Space

I'm having a problem where the game runs EXTREMEly slow during the computer's turn with the newest playtest. Rather annoying as its for the SP tournament.

Lui2 is offline Lui2
Chieftain
Saarbruecken
May 2004
time: 06:36
  Old Post 05-07-2004 09:39
Edit/Delete Message Reply w/Quote
#134 Report this post to a moderator
Help yourself to an AD-FREE life

quote:
Originally posted by Flinx
I installed CTP2 on new computer and added the 2004.06.28 playtest on top. Everything seemed to work ok except all of the messages are gobbledygook. When I got back home tonight, I put the 2004.06.28 playtest on top of 2004.05.19 which I have been playing and I am getting a mess of problems! 2004.06.15 also is giving me problems. Am I the only one? Is it because I am trying to play a saved game?


If you want to play old save games with the new release, you have to do a /reloadslic in the chatbox after loading. Because of the in the save game included old stringinfo and the changes in the new version.

Flinx is offline Flinx
Prince
Toronto, ON CANADA
Nov 2001
time: 00:36
  Old Post 05-07-2004 18:44 Visit Flinx's homepage!
Edit/Delete Message Reply w/Quote
#135 Report this post to a moderator
Support Apolyton

quote:
Originally posted by Lui2
If you want to play old save games with the new release, you have to do a /reloadslic in the chatbox after loading. Because of the in the save game included old stringinfo and the changes in the new version.


Ah! Thanks Lui.

J Bytheway is offline J Bytheway
Emperor
England
Jul 2001
time: 05:36
  Old Post 10-07-2004 00:09 Visit J Bytheway's homepage!
Edit/Delete Message Reply w/Quote
#136 Report this post to a moderator
Support Apolyton buy from Amazon

Sorry about this, but due to scircumstances beyond my control I won't be able to upload any new versions until September - if one is wanted before then another willing person will have to be found to put it together.

Keep the bug reports coming .

BureauBert is offline BureauBert
Chieftain
Vienna, Europe
Apr 2003
time: 06:36
  Old Post 14-07-2004 18:05 Visit BureauBert's homepage!
Edit/Delete Message Reply w/Quote
#137 Report this post to a moderator
CityIsValid always returns true Lose 30 kilos (of popups)

I already had the impression in earlier testing that CityIsValid always returns true.
Now I tested it again using a sound and AddCenter:

code:
int_f IsCityAtLocation(location_t theLoc) { location_t tmpLoc; city_t tmpCity; tmpLoc = theLoc; GetCityByLocation(tmpLoc, tmpCity); if(CityIsValid(tmpCity)) { PlaySound("SOUND_ID_BOO"); AddCenter(tmpLoc); return 1; } return 0; }

I am using the above function to check if an army is in a city - if so it shall not be used as an offensive army ...
Observation: I am getting the "boo" every time the function runs, the screen often centering on locations far away from any city (when tmpCity should be empty/invalid).
The only conclusion I can think of: CityIsValid always returns true.

Fromafar is offline Fromafar
Prince

May 2003
time: 06:36
  Old Post 14-07-2004 22:07
Edit/Delete Message Reply w/Quote
#138 Report this post to a moderator
Support Apolyton, buy Galactic Civilizations: Deluxe Edition

In the way you are using it here, it will return true every time after the first valid city has been found.

You are using GetCityByLocation, but are not checking its return value. When GetCityByLocation returns 0, there is no valid city at the location. In this case, the tmpCity variable is not updated, so it will still have the - valid city! - value from the last successful call.

Martin Gühmann is offline Martin Gühmann
Emperor
Berlin, Germany
Mar 2001
time: 06:36
Post  Old Post 14-07-2004 22:13 Visit Martin Gühmann's homepage!
Edit/Delete Message Reply w/Quote
#139 Report this post to a moderator
Support Apolyton, buy Alpha Centauri

First why do you make it so complicated, the following is enough:

code:
if(GetCityByLocation(tmpLoc, tmpCity)){ //Do some stuff if there is a city at tmpLoc }


Get city returns 1 if there is a city at rhe given location, otherwise it returns zero. From the source code the CityIsValid function is OK. And I think your problem is rather that you don't know how slic works.

All variables dicleared in slic keep their value until slic is relaoded or a new values is assigned.

When your IsCityAtLocation is entered for the first time the tmpCity variable may be filled or may be not filled by the GetCityByLocation. If the value of tmpCity is a valid city, the value is not set back to zero, when the function is called again, it keeps its value. The GetCityByLocation function only does something with tmpCity variable if at the given location is a city, otherwise the old value is keept. So once your function retuned true it will always return true until the city contained in tmpCity is destroyed.

-Martin

BureauBert is offline BureauBert
Chieftain
Vienna, Europe
Apr 2003
time: 06:36
  Old Post 15-07-2004 01:06 Visit BureauBert's homepage!
Edit/Delete Message Reply w/Quote
#140 Report this post to a moderator
Tired of ads?

quote:
posted by Fromafar
In the way you are using it here, it will return true every time after the first valid city has been found.
You are using GetCityByLocation, but are not checking its return value. When GetCityByLocation returns 0, there is no valid city at the location. In this case, the tmpCity variable is not updated, so it will still have the - valid city! - value from the last successful call.

Thank you, this explains it, so there is no need for fixing.

quote:
posted by Martin Gühmann
From the source code the CityIsValid function is OK. And I think your problem is rather that you don't know how slic works.

You do believe me that I am not doing all this for getting rich and famous, dont' you? Like most of the people here I am researching SLIC for having some serious fun. Let me put it in other words: This is not my profession, and even in this case I could not be blamed for "not knowing how SLIC works", since this scripting language is not documented too well. I think it is not completely dull to assume that a function "GetCityByLocation(location_t, city_t)" would just fill city_t with the city if there is a city and leave the variable empty (assign 0, NULL, whatever) if there is no city.
If I knew how GetCityByLocation works I could have considered the fact that SLIC keeps the value of local variables, somehow. But I have to admit that I didn't know either what this *exactly* means until you provided this information in your above answer (if I am interpreting it correctly): "In SLIC, local variables keep their values inside the function they are declared in (when the function is called again)". I wonder what happens if two local variables have the same name: Will SLIC recognize them as different local variables? For being on the safe side, most modders seem to be careful about using different names for local variables ...
Anyways, I am trying to contribute to a proper documentation of SLIC and other modding stuff and I updated some information here for helping SLIC-ignorants like me to become SLIC-gurus one day.
I will still appreciate any information about how things *really* work.

BureauBert is offline BureauBert
Chieftain
Vienna, Europe
Apr 2003
time: 06:36
  Old Post 15-07-2004 02:05 Visit BureauBert's homepage!
Edit/Delete Message Reply w/Quote
#141 Report this post to a moderator
Lose 30 kilos (of popups)

I know this is the playtest thread but I had a brief look at the descriptions for similar functions in the original documentation and, though they are all referenced to as int-functions, their description does not clearly state what this means. I would suggest the following:


  • GetArmyByIndex(int-player, int-index, armyvar): Returns true if the indexed army of the given player exists and stores it into armyvar
  • GetArmyFromUnit(unit, armyvar): Returns true if the given unit belongs to an army and stores the army into armyvar (AFAIK units always belong to an army, so this function would really always return true)
  • GetCityByIndex(player-int, index-int, cityvar): Returns true if the indexed city of the given player exists and stores it into cityvar
  • GetStopResearchingAdvance(player1, player2, intvar): Returns true if player1 wants player2 to stop researching an advance and stores the advance's index (-> Advance.txt) into intvar
  • GetUnitByIndex(int-player, int-index, unitvar): Returns true if the indexed unit of the given player exists and stores it into unitvar
  • GetUnitFromArmy(army, int-index, unitvar): Returns true if the army contains a unit given by index (from 0 up to number of units in the army - 1) and stores it into unitvar
  • GetUnitFromCell(location, int-index, unitvar): Returns true if there is a unit given by index (from 0 up to number of units in the cell -1) at the given location and stores it into unitvar

Any comments/corrections on these descriptions?

Fromafar is offline Fromafar
Prince

May 2003
time: 06:36
  Old Post 15-07-2004 02:50
Edit/Delete Message Reply w/Quote
#142 Report this post to a moderator
Support Apolyton buy from Amazon

The descriptions look good, except for GetStopResearchingAdvance. That one always returns 0 (false) and does nothing, because it has not been (re)implemented yet.

Your interpretation of the working of local variables is correct. For C programmers: all local variables behave as if the declaration would have contained a 'static' keyword.

Furthermore, there is no danger at all in giving the same name to different local variables. Internally, the Slic interpreter will rename every local variable by adding the function name, so they all are unique. In your example, the 'tmpLoc' variable is expanded to something like 'tmpLoc@IsCityAtLocation'. Because you are not allowed to use @ in variables names, you will not be able to generate the same expanded name.

kaan is offline kaan
Prince
Aarhus
Mar 2001
time: 05:36
  Old Post 15-07-2004 03:52
Edit/Delete Message Reply w/Quote
#143 Report this post to a moderator
Increase Your PM Length

quote:
Originally posted by BureauBert

You do believe me that I am not doing all this for getting rich and famous, dont' you? Like most of the people here I am researching SLIC for having some serious fun. Let me put it in other words: This is not my profession, and even in this case I could not be blamed for "not knowing how SLIC works", since this scripting language is not documented too well.


Hi BureauBert
I would like you to understand something about Martin Gühmann. Although he is very good at english and have a large vocabulary he is still using German grammatics most of the time (and im using Danish grammatics most of the time).
This can sometimes have result that what he writes can be highly offensive if this is not taken into account.
Please do not take offence of his writings, I am sure that he is just pointing out the fact that the error isnt in the source code but in your understanding of SLIC.

Regards
Klaus Kaan

BureauBert is offline BureauBert
Chieftain
Vienna, Europe
Apr 2003
time: 06:36
  Old Post 15-07-2004 14:29 Visit BureauBert's homepage!
Edit/Delete Message Reply w/Quote
#144 Report this post to a moderator
Support Apolyton, pre-order Civilization IV

Good morning, gentlemen!

Thank you, Fromafar, for your useful additional information. Although I am not a C-programmer (I used to work with "Clipper" a long time ago, if anyone remembers that and I have some experience with Perl, that's about it - and I did learn all I know about "programming" by doing) - anyways: Thanks to your explanation I now *do* understand for the first time how those local variables are handled in SLIC. And I am now able to add the above descriptions to the "knowledgebase".
Hi Kaan! Well I do understand that there are different people form all over the world in this forum and they all contribute some of their local habits, in most cases also their humor - this is what I always enjoyed here. I am afraid that I am contributing some of my Viennese habits, too. And I really don't mind if someone corrects me or even tells me my understanding of certain items in our "modding toolbox" is complete nonsense. If I am reporting a "bug" and someone tells me it's no bug at all but my own fault in using some SLIC-function, I am always glad to learn how to use SLIC correctly and I think there might be one or two other people out there who do not already know everything about SLIC, too (just as a sidenote: usually I *do* try and think about it myself before posting here , though the result might not always look like that).
As for grammatics and offense: I think I should eventually discuss this one with Martin himself in the first place (maybe via PM rather than via this thread). And yes: I am absolutely willing to take some minor differences between german and viennese language into consideration, too ...

With my best regards to all of you
Bert

Martin Gühmann is offline Martin Gühmann
Emperor
Berlin, Germany
Mar 2001
time: 06:36
Post  Old Post 15-07-2004 23:05 Visit Martin Gühmann's homepage!
Edit/Delete Message Reply w/Quote
#145 Report this post to a moderator
Full PM-box? Change here!

I'm sorry BureauBert if you felt being offended. However I think the cause of the missundarstanding wasn't a problem of grammer, but rather of word selection. Actual I wanted to say something about linkage, scope qand storage in slic. And also state this in the sentence, but I thought that you might not know these terms and actual more important I would have been in the need to look it up myself either to get it right. And my time this week is limited.

However slic in general is not uncomplicated, because it doesn't work as you expect, because of design, because of bugs. The storage duration you encountered is one example. IIRC I read somewhere that slic uses a c like syntax, for me that implies that local variables lose their values when the block of their declaration is left. It is not very nice to figuere out why a function does something else than expected, just because an array is not emptied when a function is left. In particular if you have to do it the hard way.

For the names of local variabled I don't know if you can use them in other block. At least I know that this gives an slic error:

code:
HandleEvent(BeginTurn)'Test_Name'post{ int_t i; } HandleEvent(ArmyClicked)'Test_Name'post{ int_t i; }


Because i is defined twice in the Test_Name event handler. Both event handle blocks have the same name. But I don't know if you can use the i in both blocks if you just define it in one block.

Doing this would be very interested, because if you need a variable that should be used in more than one event handler, you don't need to make it global. Something that you don't like if you are used to program object orientated.

-Martin

BureauBert is offline BureauBert
Chieftain
Vienna, Europe
Apr 2003
time: 06:36
  Old Post 16-07-2004 13:44 Visit BureauBert's homepage!
Edit/Delete Message Reply w/Quote
#146 Report this post to a moderator
Support Apolyton, buy Civilization 2

Good morning once again & Hi Martin!

quote:

I'm sorry BureauBert if you felt being offended. However I think the cause of the missundarstanding wasn't a problem of grammer, but rather of word selection.

OK, OK, it's OK for me and you are certainly right in your analysis about grammar/word selection.
This is such a small, nice community of people dealing with SLIC and CTP2-modding at all that I really don't want to "make a mountain out of a molehill" (that's what my dictionary suggests - it's about 20 years old ). Those viennese people can be so touchy at times .

quote:

And my time this week is limited

Ah, yes, at least some of us do have a life.

quote:

However slic in general is not uncomplicated, because it doesn't work as you expect, because of design, because of bugs.

... and the efforts and insights of the source code team will certainly help sorting these things - sometimes maybe even my "bug-" or bug-reports and questions ...

Fromafar is offline Fromafar
Prince

May 2003
time: 06:36
  Old Post 17-07-2004 00:22
Edit/Delete Message Reply w/Quote
#147 Report this post to a moderator
Support Apolyton, buy Call to Power 2

quote:
Originally posted by Martin Gühmann
[...]
Both event handle blocks have the same name. But I don't know if you can use the i in both blocks if you just define it in one block.

Doing this would be very interested, because if you need a variable that should be used in more than one event handler, you don't need to make it global. Something that you don't like if you are used to program object orientated.

Hadn't thought of this possibility. In C, non-static function names were supposed to be unique. However, the event handlers are never called explicitly, so multiple blocks having the same name is not an immediate problem.

If you define the variable (only once) in some block, it will be shared by all blocks with the same name. Defining it twice - as in your example - will result in an error.

I doubt this is an intended feature. Most likely it is a design flaw. While you may have a valid use for it, it will have a nasty consequence as well. When you (think you) are intentionally accessing a global variable in some function, you will end up accessing a completely different variable when someone else later adds an event handler with the same name as your function.

Martin Gühmann is offline Martin Gühmann
Emperor
Berlin, Germany
Mar 2001
time: 06:36
Post  Old Post 18-07-2004 00:15 Visit Martin Gühmann's homepage!
Edit/Delete Message Reply w/Quote
#148 Report this post to a moderator
Remove this text

dp

-Martin

Martin Gühmann is offline Martin Gühmann
Emperor
Berlin, Germany
Mar 2001
time: 06:36
Post  Old Post 18-07-2004 00:17 Visit Martin Gühmann's homepage!
Edit/Delete Message Reply w/Quote
#149 Report this post to a moderator
Full PM-box? Change here!

quote:
Originally posted by Fromafar
When you (think you) are intentionally accessing a global variable in some function, you will end up accessing a completely different variable when someone else later adds an event handler with the same name as your function.


It is not my intention to access an global variable. My intention is to access local variables in more then one context, and here lies the problem, because my goal is to encapsulate such a variable, so that it can only be used locally, and noone can change the value of my variable without modifing my code. But here you just need to write such an event handler and you are fine.

quote:
Originally posted by BureauBert (that's what my dictionary suggests - it's about 20 years old )


Maybe you should try my dictionary.

-Martin

Last edited by Martin Gühmann on 18-07-2004 at 00:24

Fromafar is offline Fromafar
Prince

May 2003
time: 06:36
  Old Post 18-07-2004 02:25
Edit/Delete Message Reply w/Quote
#150 Report this post to a moderator
Put an end to popups!

quote:
Originally posted by Martin Gühmann
It is not my intention to access an global variable. My intention is to access local variables in more then one context, and here lies the problem, because my goal is to encapsulate such a variable, so that it can only be used locally, and noone can change the value of my variable without modifing my code.

That's the problem exactly. There is no encapsulation of the variable at all. Without changing your code anywhere, I can still access your variable. I only have to define a new event handler with the same name. And worse, I may even do this while being completely unaware of your code. When I do not define the variable in my piece of code, I may think that I am accessing a global variable, but I am actually tricked into accessing your variable.

 
Pages (17): [ <<   2   3   4   5   6   7   8     >> ]
< Last Thread     Next Thread > Post New Thread     Post A Reply
All times are GMT. The time now is 05:36.
Apolyton Time is 00:36.
    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.0782 seconds (90.51% PHP - 9.49% 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