Announcement

Collapse
No announcement yet.

Med Mod 2 Multiplayer Crash

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • child of Thor
    replied
    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

    Leave a comment:


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

    Leave a comment:


  • child of Thor
    replied
    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).

    Leave a comment:


  • hexagonian
    replied
    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!!!

    Leave a comment:


  • Spanscape
    replied
    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.

    Leave a comment:


  • Dale
    replied
    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.

    Leave a comment:


  • Peter Triggs
    replied
    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:

    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.

    Leave a comment:


  • Spanscape
    replied
    (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!

    Leave a comment:


  • Dale
    replied
    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).

    Leave a comment:


  • Dale
    replied
    Scanscape, try this.......

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

    Leave a comment:


  • Dale
    replied
    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.

    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
    }

    Leave a comment:


  • Dale
    replied
    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?

    Leave a comment:


  • Spanscape
    replied
    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.

    Leave a comment:


  • J Bytheway
    replied
    I suspect
    HandleEvent(EstablishEmbassy) 'DIP_FlagEmbassyMade' pre

    Leave a comment:


  • Spanscape
    replied
    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.

    Leave a comment:

Working...
X