Thread Tools
Old March 21, 2002, 18:16   #31
Spanscape
Settler
 
Local Time: 21:32
Local Date: October 31, 2010
Join Date: Mar 2002
Posts: 29
And again, just tried commenting these two guys:

HandleEvent(ContactMade) 'DIP_FlagContactMade' pre
HandleEvent(EstablishEmbassy) 'DIP_FlagEmbassyMade' pre

with everything else left in... crashed.
Spanscape is offline  
Old March 21, 2002, 18:21   #32
J Bytheway
Call to Power PBEMCall to Power II Democracy GameCTP2 Source Code Project
Emperor
 
J Bytheway's Avatar
 
Local Time: 22:32
Local Date: October 31, 2010
Join Date: Jul 2001
Location: England
Posts: 3,826
It must be one of the (BeginTurn) triggers which directly causes the crash, right?
J Bytheway is offline  
Old March 21, 2002, 18:22   #33
Spanscape
Settler
 
Local Time: 21:32
Local Date: October 31, 2010
Join Date: Mar 2002
Posts: 29
Quote:
Originally posted by Dale
Well, you can elliminate:

HandleEvent(BeginTurn) 'WDT_BeginGame' pre

After the first turn, this is disabled anyways.

Also, I don't think it's going to be:

HandleEvent(InitDiplomaticState) 'DIP_InitDiploState' pre
HandleEvent(NextDiplomaticState) 'DIP_NextDiploState' pre

These two functions will only ever trigger if you're an AI.

Which leaves the embassy functions. I had a hellova time getting that running. Wouldn't surprise if there was still a bug in it. *sigh*
Wow, actually I think its one of those two exactly:

HandleEvent(InitDiplomaticState) 'DIP_InitDiploState' pre
HandleEvent(NextDiplomaticState) 'DIP_NextDiploState' pre

With those two out, there's no crashing.

The tightest test I have without crashing doesn't have either of those, or these two:

HandleEvent(ContactMade) 'DIP_FlagContactMade' pre
HandleEvent(EstablishEmbassy) 'DIP_FlagEmbassyMade' pre

But just removing those 2 by themself it still crashes... hmmm.
Spanscape is offline  
Old March 21, 2002, 18:24   #34
J Bytheway
Call to Power PBEMCall to Power II Democracy GameCTP2 Source Code Project
Emperor
 
J Bytheway's Avatar
 
Local Time: 22:32
Local Date: October 31, 2010
Join Date: Jul 2001
Location: England
Posts: 3,826
I suspect
HandleEvent(EstablishEmbassy) 'DIP_FlagEmbassyMade' pre
J Bytheway is offline  
Old March 21, 2002, 19:18   #35
Spanscape
Settler
 
Local Time: 21:32
Local Date: October 31, 2010
Join Date: Mar 2002
Posts: 29
Okay, commenting ONLY these 4 lines out, and it does NOT crash:

HandleEvent(InitDiplomaticState) 'DIP_InitDiploState' pre {
// DIP_diplostate = DiplomacyDB(DIPLOMACY_AI_AI_NORMAL);
// if(!(IsHumanPlayer(player[0])) && !(IsHumanPlayer(player[1])) && player[0] != 0 && player[1] != 0) {
// ConsiderDiplomaticState(player[0], player[1], 9999, DIP_diplostate, -1,-1,-1);
// ChangeDiplomaticState(player[0], player[1]);
// }
}


Hard to believe that when those 4 lines are commented out in a new game, I can conquer AI civs without it crashing multiplayer...

Thoughts from the expert SLICers?

Oh, and I tried adding em back in and making this change, but it still crashes:

if(IsPlayerAlive(player[0]) && IsPlayerAlive(player[1]) && !(IsHumanPlayer(player[0])) && !(IsHumanPlayer(player[1])) && player[0] != 0 && player[1] != 0) {
DIP_diplostate = DiplomacyDB(DIPLOMACY_AI_AI_NORMAL);
ConsiderDiplomaticState(player[0], player[1], 9999, DIP_diplostate, -1,-1,-1);
ChangeDiplomaticState(player[0], player[1]);
}

And for giggles I tried 'Cradle More Peaceful AI' - which appears to point to Diplomod 3.6, that also crashes.

Last edited by Spanscape; March 21, 2002 at 19:29.
Spanscape is offline  
Old March 21, 2002, 19:43   #36
Dale
Emperor
 
Dale's Avatar
 
Local Time: 07:32
Local Date: November 1, 2010
Join Date: Dec 2000
Posts: 3,944
And yet, straight from Apolyton diplomod.slc.......

Code:
///////////////////////////////////
// Ensure AI -> AI Diplo state
///////////////////////////////////

HandleEvent(InitDiplomaticState) 'DIP_InitDiploState' pre {
	int_t tmpPer;
	tmpPer = 0;
	tmpPer = GetPersonalityType(player[0]);
	if(!(IsHumanPlayer(player[0])) && !(IsHumanPlayer(player[1])) && player[0] != 0 && player[1] != 0) {
		if(tmpPer == 1) {
			DIP_diplostate = DiplomacyDB(DIPLOMACY_AI_AI_SUCKUP);
			ConsiderDiplomaticState(player[0], player[1], 9999, DIP_diplostate, -1,-1,-1);
			ChangeDiplomaticState(player[0], player[1]);
		}
These are the same as the one that crashes (effectively).

Apolyton's diplomod.slc v3.6 is used in World At War. Question: Does WAW crash with Apolyton's diplomod.slc?
Dale is offline  
Old March 21, 2002, 19:56   #37
Dale
Emperor
 
Dale's Avatar
 
Local Time: 07:32
Local Date: November 1, 2010
Join Date: Dec 2000
Posts: 3,944
Here's an interesting thought. According to the SLIC documentation, InitDiplomaticState is only called at the start of the game to initialise the AI's original diplomatic states. During the game, NextDiplomaticState is called.

Quote:
The initial diplomatic state record load for a player can be redefined by writing a SLIC function that handles the InitDiplomaticState event and calls ConsiderDiplomaticState followed by a call to ChangeDiplomaticState. For example:

HandleEvent (InitDiplomaticState) ‘Example_DiplomaticStateInit’ post {
// player[0] is the player being initialized
// player[1] is the foreigner
// code that ends up calling ConsiderDiplomaticState
// code that calls ChangeDiplomaticState
}

At the beginning of every turn the NextDiplomaticState event will be triggered for every foreigner that has been contacted. You can define SLIC functions to handle this event and change which diplomacy record should be loaded by calling the ConsiderDiplomaticState function. Do not call the ChangeDiplomaticState function from within these handlers; it will be called after all handlers have been executed and cause a change to the one with the highest priority.

HandleEvent (NextDiplomaticState) ‘Example_NextDiplomaticState’ pre {
// player[0] is the player being whose turn it is
// player[1] is the foreigner
// code that ends up calling ConsiderDiplomaticState
}
Dale is offline  
Old March 21, 2002, 19:59   #38
Dale
Emperor
 
Dale's Avatar
 
Local Time: 07:32
Local Date: November 1, 2010
Join Date: Dec 2000
Posts: 3,944
Scanscape, try this.......

In InitDiplomaticState & NextDiplomaticState, comment out (//) all the ChangeDiplomaticState lines.
Dale is offline  
Old March 21, 2002, 20:25   #39
Dale
Emperor
 
Dale's Avatar
 
Local Time: 07:32
Local Date: November 1, 2010
Join Date: Dec 2000
Posts: 3,944
Man, I'm just flowing with ideas on this today.

Try this one instead......

At the start of the InitDiplomaticState function, add this line in:

Code:
HandleEvent(InitDiplomaticState) 'DIP_InitDiploState' pre {
if(g.year > 1) {
     DisableTrigger('DIP_InitDiploState');
} else {

...... Current code goes here .......

} // Don't forget to add another of these at the end of the function.
My reason for this is that when a Civ is destroyed, it'll create a new one (if MaxPlayers > NumPlayers in userprofile.txt). When it creates a new Civ it'll probably run InitDiplomaticState (it's logical to do this). The function doesn't crash at the beginning of the game, so it works on turn 0. It may be crashing in later turns. This code will only allow the script to run on the first turn of the game (thus setting up the diplomatic stances).
Dale is offline  
Old March 21, 2002, 20:58   #40
Spanscape
Settler
 
Local Time: 21:32
Local Date: October 31, 2010
Join Date: Mar 2002
Posts: 29
(Attempt #1):

In InitDiplomaticState & NextDiplomaticState, comment out (//) all the ChangeDiplomaticState lines.

(Result):

Crash


(Attempt #2):

Add if(g.year > 1) ...

(Result):

NO CRASH!


... is this an acceptable solution? or will something go amiss later on in the game?

Otherwise, *wipes sweat from brow*, I consider this 40 some Cradle games in the day well spent!
Spanscape is offline  
Old March 21, 2002, 21:28   #41
Peter Triggs
CTP2 Source Code ProjectCivilization IV Creators
King
 
Local Time: 21:32
Local Date: October 31, 2010
Join Date: Jan 2000
Location: Gone Fishin, Canada
Posts: 1,059
Looks good, Dale's reasoning seems perfectly sound. Why it should be crashing when it creates a new civ is really puzzling.

To be on the safe side, it's probably a good idea to remove the ChangeDiplomaticState calls from the NextDiplomaticState event handler. They did say:

Quote:
Do not call the ChangeDiplomaticState function from within these handlers; it will be called after all handlers have been executed and cause a change to the one with the highest priority.

Good stuff, guys. Careful about getting hooked on this, Scanscape. It's argueably more fun than playing games but can take up a lot of time.
Peter Triggs is offline  
Old March 21, 2002, 21:34   #42
Dale
Emperor
 
Dale's Avatar
 
Local Time: 07:32
Local Date: November 1, 2010
Join Date: Dec 2000
Posts: 3,944
WOOHOO!!!!

To answer your question:

- The InitDiplomaticState directs the AI's diplomatic stance to the new modified ones I'd written right from turn 1. By default, the AI will always select one of the original diplomatic settings. My code put it into the better ones.
- The NextDiplomaticState is the check to keep the AI player in the new diplomatic states.

- If a new AI is formed due to conquest, it'll automatically select one of the default diplomatic stances. On it's first diplomatic check it'll run NextDiplomaticState and be forced into the new diplomatic states.

I see no problem with an AI running the default states for a few turns. It won't have an impact as I modified the default states to very close to warmonger state.
Dale is offline  
Old March 21, 2002, 21:43   #43
Spanscape
Settler
 
Local Time: 21:32
Local Date: October 31, 2010
Join Date: Mar 2002
Posts: 29
Hey, I'm stoked... I can finally *fingers crossed* get through a multiplayer Cradle game.

IMO, modded CTP2 really might be the best "Civ" option out there... perhaps we can put everyone's work together and market it? =)

If you don't see me post for a few days now, you can assume I'm happily hooked playing Cradle.
Spanscape is offline  
Old March 22, 2002, 11:04   #44
hexagonian
The Courts of Candle'Bre
Emperor
 
hexagonian's Avatar
 
Local Time: 16:32
Local Date: October 31, 2010
Join Date: Jun 1999
Location: Smemperor
Posts: 3,405
Quote:
Originally posted by Spanscape
If you don't see me post for a few days now, you can assume I'm happily hooked playing Cradle.
...time well-spent - tell all your friends!!!
__________________
Yes, let's be optimistic until we have reason to be otherwise...No, let's be pessimistic until we are forced to do otherwise...Maybe, let's be balanced until we are convinced to do otherwise. -- DrSpike, Skanky Burns, Shogun Gunner
...aisdhieort...dticcok...
hexagonian is offline  
Old July 18, 2002, 10:11   #45
child of Thor
Call to Power II Democracy GameCTP2 Source Code Project
Emperor
 
child of Thor's Avatar
 
Local Time: 21:32
Local Date: October 31, 2010
Join Date: Jan 2002
Location: UK
Posts: 3,272
thanks to Locotus for the link to this
Hexagonian, what was the final workaround for this and anychance of it making it into the next Craddle update?
I take it it all worked fine?
And nice work Spanscape and Dale(now departed, sniff).
__________________
'The very basis of the liberal idea – the belief of individual freedom is what causes the chaos' - William Kristol, son of the founder of neo-conservitivism, talking about neo-con ideology and its agenda for you.info here. prove me wrong.

Bush's Republican=Neo-con for all intent and purpose. be afraid.
child of Thor is offline  
Old July 18, 2002, 10:33   #46
hexagonian
The Courts of Candle'Bre
Emperor
 
hexagonian's Avatar
 
Local Time: 16:32
Local Date: October 31, 2010
Join Date: Jun 1999
Location: Smemperor
Posts: 3,405
Dale's fixed files have been part of Cradle 1.31 and beyond...
__________________
Yes, let's be optimistic until we have reason to be otherwise...No, let's be pessimistic until we are forced to do otherwise...Maybe, let's be balanced until we are convinced to do otherwise. -- DrSpike, Skanky Burns, Shogun Gunner
...aisdhieort...dticcok...
hexagonian is offline  
Old July 18, 2002, 11:30   #47
child of Thor
Call to Power II Democracy GameCTP2 Source Code Project
Emperor
 
child of Thor's Avatar
 
Local Time: 21:32
Local Date: October 31, 2010
Join Date: Jan 2002
Location: UK
Posts: 3,272
Doh! well serves me right for digging up an old thread! Still ds-5-li(sorry for the errors!) geezer was having a problem with an apolyton mod still causeing this error, and it comes up from time to time - i guess it must be with the older Mods? This crash and the ex-city tile pillage crash are probably the most annoying bugs, especially in MP.
Still nice to know it's fixed now in Craddle
__________________
'The very basis of the liberal idea – the belief of individual freedom is what causes the chaos' - William Kristol, son of the founder of neo-conservitivism, talking about neo-con ideology and its agenda for you.info here. prove me wrong.

Bush's Republican=Neo-con for all intent and purpose. be afraid.
child of Thor is offline  
 

Bookmarks

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is On

Forum Jump


All times are GMT -4. The time now is 17:32.


Design by Vjacheslav Trushkin, color scheme by ColorizeIt!.
Powered by vBulletin® Version 3.8.2
Copyright ©2000 - 2010, Jelsoft Enterprises Ltd.
Apolyton Civilization Site | Copyright © The Apolyton Team