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 > Miscellaneous > Archive > CtP2-Creation/AI/Mods/Scenarios-Archive > Med Mod 2 Multiplayer Crash
Show a Printable Version | Email This Page to Someone! | Receive updates to this thread | Report this to Apolyton news!

bottom of page
  
Author
Thread   
Pages (2): [ 1   2   ]
< Last Thread     Next Thread > Post New Thread     Post A Reply
Spanscape is offline Spanscape
Settler

Mar 2002
time: 05:18
  Old Post 22-03-2002 03:16
Edit/Delete Message Reply w/Quote
#31 Report this post to a moderator
Remove this text

And again, just tried commenting these two guys:

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

with everything else left in... crashed.

J Bytheway is offline J Bytheway
Emperor
England
Jul 2001
time: 05:18
  Old Post 22-03-2002 03:21 Visit J Bytheway's homepage!
Edit/Delete Message Reply w/Quote
#32 Report this post to a moderator
Increase Your PM Length

It must be one of the (BeginTurn) triggers which directly causes the crash, right?

Spanscape is offline Spanscape
Settler

Mar 2002
time: 05:18
  Old Post 22-03-2002 03:22
Edit/Delete Message Reply w/Quote
#33 Report this post to a moderator
Get a bigger avatar today!

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.

J Bytheway is offline J Bytheway
Emperor
England
Jul 2001
time: 05:18
  Old Post 22-03-2002 03:24 Visit J Bytheway's homepage!
Edit/Delete Message Reply w/Quote
#34 Report this post to a moderator
Support Apolyton, buy Civilization: The Boardgame

I suspect
HandleEvent(EstablishEmbassy) 'DIP_FlagEmbassyMade' pre

Spanscape is offline Spanscape
Settler

Mar 2002
time: 05:18
  Old Post 22-03-2002 04:18
Edit/Delete Message Reply w/Quote
#35 Report this post to a moderator
Inflate your Upload Space

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 on 22-03-2002 at 04:29

Dale is offline Dale
King
Sir! Why do you keep clicking on me?
Dec 2000
time: 15:18
  Old Post 22-03-2002 04:43
Edit/Delete Message Reply w/Quote
#36 Report this post to a moderator
Support Apolyton, buy GURPS/ Alpha Centauri

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 Dale
King
Sir! Why do you keep clicking on me?
Dec 2000
time: 15:18
  Old Post 22-03-2002 04:56
Edit/Delete Message Reply w/Quote
#37 Report this post to a moderator
Support Apolyton, buy Galactic Civilizations: Deluxe Edition

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 Dale
King
Sir! Why do you keep clicking on me?
Dec 2000
time: 15:18
  Old Post 22-03-2002 04:59
Edit/Delete Message Reply w/Quote
#38 Report this post to a moderator
Inflate your Upload Space

Scanscape, try this.......

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

Dale is offline Dale
King
Sir! Why do you keep clicking on me?
Dec 2000
time: 15:18
  Old Post 22-03-2002 05:25
Edit/Delete Message Reply w/Quote
#39 Report this post to a moderator
Get a bigger avatar today!

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).

Spanscape is offline Spanscape
Settler

Mar 2002
time: 05:18
  Old Post 22-03-2002 05:58
Edit/Delete Message Reply w/Quote
#40 Report this post to a moderator
Support Apolyton, buy Civilization: The Boardgame

(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!

Peter Triggs is offline Peter Triggs
Prince
Gone Fishin, Canada
Jan 2000
time: 05:18
  Old Post 22-03-2002 06:28
Edit/Delete Message Reply w/Quote
#41 Report this post to a moderator
Tired of ads?

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.

Dale is offline Dale
King
Sir! Why do you keep clicking on me?
Dec 2000
time: 15:18
  Old Post 22-03-2002 06:34
Edit/Delete Message Reply w/Quote
#42 Report this post to a moderator
Increase the size of your Attachments

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.

Spanscape is offline Spanscape
Settler

Mar 2002
time: 05:18
  Old Post 22-03-2002 06:43
Edit/Delete Message Reply w/Quote
#43 Report this post to a moderator
Support Apolyton, buy Call to Power 2

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.

hexagonian is offline hexagonian
King
Gnawing on your mind...
Jun 1999
time: 23:18
  Old Post 22-03-2002 20:04 Visit hexagonian's homepage!
Edit/Delete Message Reply w/Quote
#44 Report this post to a moderator
Support Apolyton, buy Civilization 2

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!!!

child of Thor is offline child of Thor
Emperor
UK
Jan 2002
time: 05:18
  Old Post 18-07-2002 19:11
Edit/Delete Message Reply w/Quote
#45 Report this post to a moderator
Tired of ads?

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).

hexagonian is offline hexagonian
King
Gnawing on your mind...
Jun 1999
time: 23:18
  Old Post 18-07-2002 19:33 Visit hexagonian's homepage!
Edit/Delete Message Reply w/Quote
#46 Report this post to a moderator
Browse Apolyton AD-FREE

Dale's fixed files have been part of Cradle 1.31 and beyond...

child of Thor is offline child of Thor
Emperor
UK
Jan 2002
time: 05:18
  Old Post 18-07-2002 20:30
Edit/Delete Message Reply w/Quote
#47 Report this post to a moderator
Support Apolyton buy from Amazon

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

 
Pages (2): [ 1   2   ]
< Last Thread     Next Thread > Post New Thread     Post A Reply
All times are GMT. The time now is 05:18.
Apolyton Time is 00:18.
    top of page
Rate This Thread:
archivepost
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.0454 seconds (89.11% PHP - 10.89% MySQL) with 31 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