 |
|  |
 |
|  |
 |
|
Martin Gühmann
|
 |
Berlin, Germany
Mar 2001 time: 06:15
|
|
quote: Originally posted by Peter Triggs
The trouble is that 'IsHumanPlayer(g.player)' will return either 1 or 0, so this message will either go to player 1 (who's usually the human) or the Barbarians. If you use 'THE_HUMAN' you should get the generality you want.
|
A logical error, I don't like them, because you don't get any error message it only doen't work or worse it works but in a different as expected and you don't realize that.
code:
int_t THE_HUMAN;
HandleEvent(BeginTurn)'NumofPlayers' pre {
int_t i;
NUM_PLAYERS= preference("NumPlayers");
for(i=1; i < NUM_PLAYERS; i=i+1){
if (IsHumanPlayer(i)) {
THE_HUMAN=i;
}
}
}
This code is an improve but also buggy. "NumPlayers" is the number of civilisations with which you started. But if you set "MaxPlyers" higher than "NumPlayers" it is possible to get more than the initial players in a game and if you enabled the write protection of the userprofile.txt CTP2 won't change this number there. The result is that the loop will stop before the last player in this case it doesn't matter, because it is very unlikly that afterwards added players will be human players, OK you can change it via cheat editor.
Diplomod allready contains such a function, and I got some problems with it as I tested my GoodMod with debug=yes. Half of the world was suddenly covered with auxiliry tileimprovements, although the trigger should only fire at the biginning of the game also you reloadslic, therefore I implemented another disablement function.
So far I guess this code will also work if it would look like:
code:
int_t THE_HUMAN;
HandleEvent(BeginTurn)'NumofPlayers' pre {
int_t i;
NUM_PLAYERS= preference("NumPlayers");
for(i=1; i < 40; i=i+1){
if (IsHumanPlayer(i)) {
THE_HUMAN=i;
}
}
}
Maybe 40 is too high but I had no problems with it so far.
quote: Originally posted by player1
Aren't science pacts buggy, so Dale removed them from Diplomod?
|
I don't know the exact effect of science pacts. So far as I know if you sign a science pact with a under advanced AI this AI will catch up in science. In theory both players should put their science together in order to research faster. And you are right this pact is not a option in my current game, but only Dale could tell us why he removed it or I have to search for an old thread.
quote: Originally posted by player1
What are exact effects of Trade pact, a haven't noticed them?
|
I have no I idea but it seems that they have an effect and it is not very buggy. Here is a small discription from the interactions.txt:
quote:
17. TREATY_TRADE_PACT: (DESIRE_MAKE_FRIEND, DESIRE_GOLD)
Triggered when 1) no war has occurred between sender and receiver
for 10 turns, 2) sender trusts receiver, 3) receiver has no troops
on our territory, 4) receiver is pirating our trade routes, 5)
more than 10% of the value of senders trade is with the
receiver. 6) value of value of receivers trade with sender does
not exceed twice senders trade with receiver.
|
It doesn't help me very much to understand what the exact effect of a trade pact is but maybe it gives you some hints.
-Martin
|
|
|  |
 |
|
Martin Gühmann
|
 |
Berlin, Germany
Mar 2001 time: 06:15
|
|
I think I should read readmes, here is the stuff that I found about science pacts in Dale's readme:
quote: From Dale's Diplomod v3.6
The "research treaty" bug is where the AI will gain one advance per turn if you have a research pact with them. To counter this bug I have disabled Research Pacts entirely.
|
And here is the stuff about science pacts that I found in the interaction.txt:
quote:
18. TREATY_RESEARCH_PACT: (DESIRE_MAKE_FRIEND, FEAR_SCIENCE_RANK)
Triggered when 1) no war has occurred between sender and receiver for 10 turns, 2) sender trusts receiver, 3) receiver has no troops on our territory, 4) sender generater has less science than receiver per turn, or 5) sender does not generate more than 20% more science than receiver. |
To summerize it you should never sign a science pact with a player that has a science output that is 20% less than your science output.
An example from my current game, I am the most advanced player. I have more than 50 cities. Player 2 has three cities he is currently researching internal combustion this advance costs 75504 my current science output is something like 72000. His science output is very low. Now if I sign a science pact with player2 he will get his current advance in one turn his science output is added to my science output and his science output is added to my science output. As his science output very low I won't notice any effect. But he will get an advance every turn.
Player 4 is researching currently mass media in Apolyton pack it cost 81276, therefore a science pact with me would cause that he get an advance every second turn.
The other AI players are all researching something that cost 20000 and 90000 science points. Therefore the result will be same irrespective which AI signs a science pact wth me. Each AI will get a science boost, because of my high science output. Each AI will get their advances in one or two turns.
In that case it is no bug that the AI will get a science boost and I wouldn't see any effect. It is just the superior human science output. In unmodded games the human has such a high science output compared to the AI or higher normally. It is only a user bug if the human signs a science pact with a such under advanced AI.
-Martin
|
|
|  |
 |
|
Peter Triggs
|
|
Gone Fishin, Canada
Jan 2000 time: 05:15
|
|
This is turning out to be a lot more complicated, difficult, and tedious than I ever imagined. But I've been making notes as I go along and here's a preliminary version for anyone who wants to have a look. Even if you're not interested in Diplomacy, there's an appendix that has a fair amount of information on most of the poorly documented/undocumented SLIC functions. Any help in filling out the gaps in this information would be greatly appreciated.
D*mn, it doesn't like rtf files!!!
Last edited by Peter Triggs on 19-10-2001 at 03:02
|
|
|  |
 |
|  |
 |
|
Martin Gühmann
|
 |
Berlin, Germany
Mar 2001 time: 06:15
|
|
From the Alexander The Great scenario.slc:
PHP:
// Make the Persians and Independents REALLY hate you
if(IsPlayerAlive(4)) {// if Persians aren't dead
LogRegardEvent(4, 1, -9999, 0, ID_AG_REGARD_EVENT_NEG, 9999);
}
if(IsPlayerAlive(8)) {// if Independents aren't dead
LogRegardEvent(8, 1, -9999, 0, ID_AG_REGARD_EVENT_NEG, 9999);
}
The regard here for you is really lowered for you. From here possible values could be -9999 to 9999. But from the WW2 scenario it is OK to use -1000 to make the enemy really hate you.
Another way to realize a science pact would be a technology transfer pact. The content would be: Each civ get the advances of the other civ and the way around. If one civ discovers an advance the other civ will get this advance also. This would make human and AI equal in a science pacts.
-Martin
|
|
|  |
 |
|
Peter Triggs
|
|
Gone Fishin, Canada
Jan 2000 time: 05:15
|
|
The info about the regard and trust scales is from an answer that Azmel2 gave to a question from Locutus in the Conversations with Richard Myers (Azmel) thread. The only thing I can think of is that when you use the CancelAgreement function to end the war, it triggers some regard event that ups the regard between the two civs a bit more. How about temporarily putting some messages into your code to try to monitor this:
code:
int_t my_regard01;//now globals
int_t my_regard10;
//////////////////////////////////////////////////
//War Over script for DiploMOD
int_t my_warturn;
int_t my_rnd;
my_regard01 = GetEffectiveRegard(player[0], player[1]);
my_regard10 = GetEffectiveRegard(player[1], player[0]);
message(1,'PreEffectiveRegard');//new monitoring message
if(!IsHumanPlayer(player[1])) {
my_warturn = TurnsAtWar(player[0], player[1]);
my_rnd = random(100);
if((my_warturn > 10) && (my_warturn <= 20)) {
if (my_rnd >= 1 && my_rnd <= 2) { //2% chance
CancelAgreement(player[0], player[1], 31);
LogRegardEvent(player[0], player[1], 250 - my_regard01, 0, ID_REGARD_EVENT_POSITIVE_SENDER_DIPLOMACY_RESULT, 0);
LogRegardEvent(player[1], player[0], 250 - my_regard10, 0, ID_REGARD_EVENT_POSITIVE_RECEIVER_DIPLOMACY_RESULT
, 0);
my_regard01 = GetEffectiveRegard(player[0], player[1]);
my_regard10 = GetEffectiveRegard(player[1], player[0]);
Message (1, '401WarOver');
}
}
if((my_warturn > 20) && (my_warturn <= 30)) {
if (my_rnd >= 1 && my_rnd <= 4) { //4% chance
CancelAgreement(player[0], player[1], 31);
LogRegardEvent(player[0], player[1], 250 - my_regard01, 0, ID_REGARD_EVENT_POSITIVE_SENDER_DIPLOMACY_RESULT, 0);
LogRegardEvent(player[1], player[0], 250 - my_regard10, 0, ID_REGARD_EVENT_POSITIVE_RECEIVER_DIPLOMACY_RESULT
, 0);
my_regard01 = GetEffectiveRegard(player[0], player[1]);
my_regard10 = GetEffectiveRegard(player[1], player[0]);
Message (1, '401WarOver');
}
}
if((my_warturn > 30) && (my_warturn <= 40)) {
if (my_rnd >= 1 && my_rnd <= 6) { //6% chance
CancelAgreement(player[0], player[1], 31);
LogRegardEvent(player[0], player[1], 250 - my_regard01, 0, ID_REGARD_EVENT_POSITIVE_SENDER_DIPLOMACY_RESULT, 0);
LogRegardEvent(player[1], player[0], 250 - my_regard10, 0, ID_REGARD_EVENT_POSITIVE_RECEIVER_DIPLOMACY_RESULT
, 0);
my_regard01 = GetEffectiveRegard(player[0], player[1]);
my_regard10 = GetEffectiveRegard(player[1], player[0]);
Message (1, '401WarOver');
}
}
if((my_warturn > 40) && (my_warturn <= 50)) {
if (my_rnd >= 1 && my_rnd <= 8) { //8% chance
CancelAgreement(player[0], player[1], 31);
LogRegardEvent(player[0], player[1], 250 - my_regard01, 0, ID_REGARD_EVENT_POSITIVE_SENDER_DIPLOMACY_RESULT, 0);
LogRegardEvent(player[1], player[0], 250 - my_regard10, 0, ID_REGARD_EVENT_POSITIVE_RECEIVER_DIPLOMACY_RESULT
, 0);
my_regard01 = GetEffectiveRegard(player[0], player[1]);
my_regard10 = GetEffectiveRegard(player[1], player[0]);
Message (1, '401WarOver');
}
}
if(my_warturn > 50) {
if (my_rnd >= 1 && my_rnd <= 10) { //10% chance
CancelAgreement(player[0], player[1], 31);
LogRegardEvent(player[0], player[1], 250 - my_regard01, 0, ID_REGARD_EVENT_POSITIVE_SENDER_DIPLOMACY_RESULT, 0);
LogRegardEvent(player[1], player[0], 250 - my_regard10, 0, ID_REGARD_EVENT_POSITIVE_RECEIVER_DIPLOMACY_RESULT
, 0);
my_regard01 = GetEffectiveRegard(player[0], player[1]
my_regard10 = GetEffectiveRegard(player[1], player[0]);
Message (1, '401WarOver');
}
}
}
//////////////////////////////////////////////////
messagebox 'PreEffectiveRegard' {
show();
Text (ID_PreEffectiveRegardM) ;
//PreEffectiveRegardM "Pre my_regard01={my_regard01}, my_regard10={my_regard10}"
}
and likewise put "my_regard01={my_regard01}, my_regard10={my_regard10}" into 401WarOver.
|
|
|  |
 |
|
Peter Triggs
|
|
Gone Fishin, Canada
Jan 2000 time: 05:15
|
|
Martin, I haven't gone away, honest. It's just that the flame wars over in the Civ3 forums have been so distracting.
I came to the conclusion that the best way to proceed would be to start from scratch with Diplmod. There's a lot of things you just can't do, even though you should be able to do them. But I think I've made quite a lot of progress and will post a report soon.
|
|
|  |
All times are GMT. The time now is 05:15. Apolyton Time is 00:15. |
top of page
|
| archivepost |
|
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
|
|
|
|
|
|