 |
|  |
 |
|
Locutus
|
|
ACS CTP1/2 Manager & Civ4 Co-Manager
|
 |
Hengelo, The Netherlands
Nov 1999 time: 06:13
|
|
Gedrin,
I (finally) had time to study them yesterday and I found a few odd things in them, you may have put them there deliberately but you may not have, so I thought I'd mention them.
1) Back when I still had CtPI installed on my system I tried your triggers for a while and all the time got messages about having received advances that I already possessed. Example: (didn't actually occur, but it could have) in turn 100 I invented Monarchy and in turn 120 I got the message that I had gained the advance of Monarchy due to the dissemination code (don't remember the exact text anymore). This can easily be prevented by performing one extra test (to see if the player already has the advance) before sending the message to human players, like this:
code: if ((advanceGranted == 1) && (IsHumanPlayer(playerIndex) == 1) && !HasAdvance(playerIndex, discovery.type)) {
Message(playerIndex, '117DisseminationDiscovery');
}
2) You make the same mistake (presuming it is a mistake) as I did for the Garrison code, you treat the discovery.type and discovery.trade as two seperate cases, but in fact discovery.type covers the trading of advances as well, so you during trade you add two instead of one to the variable that keep track of the number of times a new advance is gained. (Actually, you *might* even be adding four to the variable since there are two parties involved in trade so it's possible (though I'm not certain of it) that the trigger is activated twice).
3) For number of players you take the number of players that was in the game at the start, not the number of players currently in the game. Did you do make that choice deliberately or did you not see a better way to do it? If the latter is the case, I might have a solution for you. I didn't actually test it (don't have CtP installed at the moment), but something similar seemed to work when I working on flat-map support. It would look something like this:
[code]numberOfPlayers = 0;
if (player.0 == 0) {numberOfPlayers = numberOfPlayers + 1;}
if (player.1 == 1) {numberOfPlayers = numberOfPlayers + 1;}
if (player.2 == 2) {numberOfPlayers = numberOfPlayers + 1;}
if (player.3 == 3) {numberOfPlayers = numberOfPlayers + 1;}
if (player.4 == 4) {numberOfPlayers = numberOfPlayers + 1;}
if (player.5 == 5) {numberOfPlayers = numberOfPlayers + 1;}
if (player.6 == 6) {numberOfPlayers = numberOfPlayers + 1;}
...(etc until: )
if (player.32 == 32) {numberOfPlayers = numberOfPlayers + 1;}
IIRC every player that doesn't exist has the value 0, so only the players that exist are counted.
Like I said, I haven't actually tested any of this so I may well be wrong about everything or my 'solutions' might not work at all, but if you ever want to improve your code, you could have a look at this.
Further I'd like to say that I really like all the cool SLIC work you're doing and I'm looking forward the your next thing 
[This message has been edited by Locutus (edited September 29, 2000).]
|
|
|  |
 |
|  |
 |
|
Gedrin
|
|
Hmmm... you know I think I may have to rewrite the whole thing to deal with this new info about userdefined values not persisting over a restart.
I don't see anyway to do it without couting the number who HasAdvance every time.
But I am very confused. When I reload my games I do not execute Setup again... meaning numberOfPlayers is not reset and yet I see no impact on the operation of functions that require these values.
In addition to the fact that SLICs cannot be added midgame I suspect the entire SLIC address space is saved on a savegame.
How did you come to conclude that user defined primitive values are not stored? What about the structures like UnitType etc... are they stored?
Seems odd to have such things if they are not stored.
Gedrin
|
|
|  |
 |
|
Locutus
|
|
ACS CTP1/2 Manager & Civ4 Co-Manager
|
 |
Hengelo, The Netherlands
Nov 1999 time: 06:13
|
|
No, Gedrin, I don't see an alternative way of implementing your ideas either (apart from waiting for CtPII to arrive but I don't think that's what you want to hear )
Gemini found out about the variable-thing, look here. I didn't double-check his findings at the time as I normally would have, because school-exams were pretty much taking up all my time. You can always investigate for yourself, you never know...
I don't know if structures are saved, you'd have to try for yourself.
The whole thing seems very odd to me as well, but I don't suppose Activision deliberately choose for this, it has to be a bug.
[This message has been edited by Locutus (edited October 02, 2000).]
|
|
|  |
 |
|  |
All times are GMT. The time now is 05:13. Apolyton Time is 00:13. |
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
|
|
|
|
|
|