Results 1 to 22 of 22

Thread: Ways to make CTD with script ?

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Finder of Little Oddities Senior Member Makanyane's Avatar
    Join Date
    Jan 2006
    Posts
    2,220

    Default Re: Ways to make CTD with script ?

    Very much simplified script - simple three spawns on same tile on subsequent turns results in randomly occuring CTD a random number of turns after last spawn. Can't duplicate reason when playing one of the spawned factions but stopping them spawning on same spot seems to stop problem (so far so good).

    So need to try and add a check to see if anyone is on tile before spawning:

    Code:
      if whatever_conditions
    
    ;sets counter to stop spawn
       if I_CharacterTypeNearTile alemanni general, 0 97,121
    	set_counter nospawn 2
       end_if
       if I_CharacterTypeNearTile alemanni family, 0 97,121
    	set_counter nospawn 2
       end_if
    
    ;only triggers if army not on tile
    	if I_CompareCounter nospawn < 2
             spawn_army
                faction slave
                character Moireabh, named character, command 1, influence 1, management 1, subterfuge 0, age 23, x 97, y 121
                unit souleatergeneral, exp 1 armour 0 weapon_lvl 0
             end
            end_if
    
    ;reset for other if/monitors
        if I_CompareCounter nospawn = 2
           set_counter nospawn 0
        end_if
    
    ; terminate_monitor
     end_if
    seems to work to just stop them spawning on exact same tile as alemanni, but would need same entry for all factions, luckily I haven't got full set of factions in use, but wonder if anyone knows of way of wording that for 'any faction' on tile that's shorter....?

    Any other advice on lines of 'Scripters Guide to CTD's' might also be useful in-case there is anything else causing problem.
    Not used mods before? Looking for something small and fun?!
    Download the:

  2. #2
    Shaidar Haran Senior Member SAM Site Champion Myrddraal's Avatar
    Join Date
    Feb 2004
    Location
    UK
    Posts
    5,752

    Default Re: Ways to make CTD with script ?

    Maybe use true_condition?

    Just a wild guess

  3. #3
    Finder of Little Oddities Senior Member Makanyane's Avatar
    Join Date
    Jan 2006
    Posts
    2,220

    Default Re: Ways to make CTD with script ?

    I did try TrueCondition at one point and it show_err'd unknown faction - though I might have missed correct way of phrasing...

    anyway, I changed all spawns so they can't occur on occupied tile, which fixes the problem I induced by making all possible spawns happen in first few goes.
    It doesn't however fix my random late stage CTD when used in script with proper triggers reinstated..

    Trying to isolate it is driving me slightly barmy.. Script is split basically into 5 sections with garrison and spawns for areas of map occupied by four main factions and then section for slave areas. If I run full script it CTD's fairly regularly somewhere around 150 turns in when playing via year jump started as two of the factions.

    So I think ahha remove one of the 5 sections relating to specific area of map completely and test.... lo, it doesn't CTD, so I make revised version of script with just the one suspect section I just removed in it, so I can proceed to isolate problem further..... but, the one suspect section on its own doesn't CTD either.

    If you don't see me for a while its because I've thrown something heavy at computer



    Does anyone have any experience or any ideas at all about obscure hard to find ways of making script crash game???
    Last edited by Makanyane; 12-11-2007 at 00:47.
    Not used mods before? Looking for something small and fun?!
    Download the:

  4. #4
    Axebitten Modder Senior Member Dol Guldur's Avatar
    Join Date
    Apr 2005
    Location
    England
    Posts
    1,550

    Default Re: Ways to make CTD with script ?

    Turn back from the Dark Side, Mak. Event scripts are evil....it's not too late...turn back now...or EoD will never be stable again...
    "One of the most sophisticated Total War mods ever developed..."

  5. #5
    Anything that isn't 'member' Member Squid's Avatar
    Join Date
    Apr 2005
    Location
    Canada
    Posts
    596

    Default Re: Ways to make CTD with script ?

    Silly question, but you're only checking for generals and family could other character types be causing the problem? If so maybe just check for the character type all.

    As for the factions have you tried all for the factions you want to catch instead of doing it one faction at a time. Incidentally I have no idea if all would work or not, but it might be worth a try.

    -Trait/Ancillary/Building Editor

    "Two things are infinite: the universe and human stupidity;
    and I'm not sure about the universe." -----Albert Einstein

  6. #6
    Finder of Little Oddities Senior Member Makanyane's Avatar
    Join Date
    Jan 2006
    Posts
    2,220

    Default Re: Ways to make CTD with script ?

    DG, I've been on the dark side for a Long time :P

    Squid thanks for the idea but it doesn't accept all for either of those, I get faction type or character type not recognised message if I try, would have been useful if it had. I could try adding for other types specifically, still trying to work out why it seems happy to run any combination of four of my script sections just falls over (occasionally) when I have all five together ........
    Not used mods before? Looking for something small and fun?!
    Download the:

  7. #7
    Finder of Little Oddities Senior Member Makanyane's Avatar
    Join Date
    Jan 2006
    Posts
    2,220

    Default Re: Ways to make CTD with script ?

    Update no.MMCXXVII for anyone I've been boring with this!

    I did test and it didn't seem to mind having armies spawned on same square as agents. (it would be a lot more of a fluke for that to happen as well)


    Anallein reminded me about problem with spawned_armies for human player - if they spawn outside your FOW they don't reset the FOW and you can't select them from campaign map. I'm not sure if that affects the AI when AI faction armies spawn or not but am back to testing script with a lot of spawns deliberately induced at start of game.

    Getting a mixture of armies slave and faction spawned on first turn, some of which won't be visible from settlements/existing armies does indeed produce a random crash on some runs about 10/20 turns later.


    Was trying to see if making the army spawn with a general instead of named character makes any difference and found it won't accept a spawned slave army with a general (though same one as named character works fine). Has anyone got any ideas on why that is, or if spawning slave armies by script is perhaps just a bad idea anyway?????

    Other question is should you ensure that all spawns take place in area within line-of sight of settlement owned by spawning faction? In case AI does get version of the FOW problem....
    Last edited by Makanyane; 12-31-2007 at 15:11.
    Not used mods before? Looking for something small and fun?!
    Download the:

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Single Sign On provided by vBSSO