Results 1 to 11 of 11

Thread: game CTDs when I script with .bik files

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    hitokiri2486's Avatar Centenarius
    Join Date
    Aug 2008
    Location
    New York
    Posts
    805

    Default game CTDs when I script with .bik files

    Hello all,

    I am modifying the campaign script of Candelarius' Grand Unit AddOn Mod for Retrofit Mod. Specifically, what I'm trying to do is include the William Wallace spawn script that's found in Brittannia kingdoms.

    Here's the issue: when I have the script without the accompanying event .bik, the script works fine.

    So, looking at the Brittannia script for Wallace Wade, this is missing:

    historic_event scotland_wallace event/william_wallace.bik


    When I have the above line in the campaign script however, the game CTDs due to an unspecified error that's not detected in my log files. I find this odd, since the other events with .biks work (like the Mongols!), and I have the wallace_wade.bik in the data/fmv/events folder of both the mod and in the vanilla folder.

    Does anyone have any idea what might be causing the game to CTD only when I have the wallace_wade.bik included in my campaign script?

    For those of you unfamiliar with the Brittannia script, I have attached here the campaign_script.txt from the Grand Unit AddOn mod. The William Wallace script is at the very bottom of the text file.

    EDIT: I also forgot to mention, I have a scotland_wallace event in my historic_event.txt file in the retrofit/data/text folder, whose wording is the same as that heard in the .bik file. So I do not think that is the reason behind this mysterious CTD either...
    Last edited by hitokiri2486; October 18, 2008 at 01:07 PM. Reason: clarification

  2. #2

    Default Re: game CTDs when I script with .bik files

    Are you sure that your bik file is valid?

    Dominion of the Sword, a Medieval II: Total War Supermod
    Under the patronage of Archaon. Proud member of the House of Siblesz
    My friend died from chain letters. If you don't post this again 100 times, he will come and kill you in your sleep!

  3. #3
    Gigantus's Avatar I am not special - I am a limited edition.
    Moderator Emeritus Administrator Emeritus

    Join Date
    Aug 2006
    Location
    Goa - India
    Posts
    52,682
    Blog Entries
    35

    Default Re: game CTDs when I script with .bik files

    So, looking at the Brittannia script for Wallace Wade, this is missing:

    historic_event scotland_wallace event/william_wallace.bik


    When I have the above line in the campaign script however, the game CTDs due to an unspecified error that's not detected in my log files. I find this odd, since the other events with .biks work (like the Mongols!), and I have the wallace_wade.bik in the data/fmv/events folder of both the mod and in the vanilla folder.
    Sure you haven't got a typo here?










  4. #4
    hitokiri2486's Avatar Centenarius
    Join Date
    Aug 2008
    Location
    New York
    Posts
    805

    Default Re: game CTDs when I script with .bik files

    @ gigantus

    Sorry, I mistyped in my first post.

    The .bik file I have is indeed called william_wallace.bik, I just checked it myself, NOT wallace_wade.bik.

    @ Azim,

    I am certain that the .bik file I have is valid; it's straight from the Britannia campaign. I heard that SS 6.0 also has a similar event, so I downloaded it and tried their .bik file as well, and it did not work either. Not sure what is going on...

  5. #5

    Default Re: game CTDs when I script with .bik files

    Isn't historic_event supposed to be within an add_events? That's the way I always do it. I'm not sure if it works without the add_events.

    Dominion of the Sword, a Medieval II: Total War Supermod
    Under the patronage of Archaon. Proud member of the House of Siblesz
    My friend died from chain letters. If you don't post this again 100 times, he will come and kill you in your sleep!

  6. #6
    hitokiri2486's Avatar Centenarius
    Join Date
    Aug 2008
    Location
    New York
    Posts
    805

    Default Re: game CTDs when I script with .bik files

    Here is the entire william wallace event in the campaign script file:

    ;setup related event counters
    monitor_event FactionTurnStart FactionType scotland

    add_events
    event counter wallace_spawn_timer
    date 0
    end_add_events

    generate_random_counter wallace_spawn_timer 0 12

    terminate_monitor

    end_monitor

    ;increment the wallace spawn timer
    monitor_event FactionTurnStart FactionType scotland

    inc_event_counter wallace_spawn_timer 1

    end_monitor

    ;trigger Wallace when England attacks
    monitor_event GeneralCaptureSettlement I_TurnNumber >= 15
    and FactionType england
    and TargetFactionType scotland

    set_counter wallace_spawned 1

    terminate_monitor

    end_monitor

    ;trigger Wallace when Scotland is weakened
    monitor_event FactionTurnStart FactionType scotland
    and I_TurnNumber >= 3
    and I_NumberOfSettlements scotland < 5

    set_counter wallace_spawned 1

    terminate_monitor

    end_monitor

    ;trigger Wallace after a set amounted of time has passed
    monitor_event FactionTurnStart FactionType scotland
    and I_EventCounter wallace_spawn_timer >= 30

    set_counter wallace_spawned 1

    terminate_monitor

    end_monitor

    ;spawn wallace if his spawn conditions have been met
    monitor_event FactionTurnStart FactionType scotland
    and I_CompareCounter wallace_spawned = 1

    spawn_army
    faction scotland
    character William Wallace, named character, age 20, x 104, y 172, portrait wallace
    traits LoyaltyStarter 1, ManagementStarter 1, BattleChivalry 2, NaturalMilitarySkill 2, GoodRiskyAttacker 2, Loyal 2, Just 2
    unit Highland Nobles exp 3 armour 0 weapon_lvl 1
    unit Highland Nobles exp 2 armour 0 weapon_lvl 1
    unit Highlanders exp 3 armour 1 weapon_lvl 1
    unit Highlanders exp 3 armour 1 weapon_lvl 1
    unit Highlanders exp 3 armour 1 weapon_lvl 1
    unit Highland Pikemen exp 3 armour 1 weapon_lvl 0
    unit Highland Pikemen exp 3 armour 1 weapon_lvl 0
    unit Highland Pikemen exp 3 armour 1 weapon_lvl 0
    unit Highland Pikemen exp 3 armour 1 weapon_lvl 0
    unit Highland Nobles exp 3 armour 0 weapon_lvl 1
    unit Highland Nobles exp 3 armour 0 weapon_lvl 1
    unit Noble Highland Archers exp 1 armour 1 weapon_lvl 0
    unit Noble Highland Archers exp 1 armour 1 weapon_lvl 0
    unit Noble Highland Archers exp 1 armour 1 weapon_lvl 0
    unit Highland Rabble exp 3 armour 0 weapon_lvl 0
    unit Highland Rabble exp 3 armour 0 weapon_lvl 0
    unit Highland Rabble exp 3 armour 0 weapon_lvl 0
    unit Highland Rabble exp 3 armour 0 weapon_lvl 0
    end

    historic_event scotland_wallace event/william_wallace.bik

    terminate_monitor

    end_monitor



    This is a cut-and-paste job from the campaign script in Kingdoms:Britannia; the only things I changed were the x and y coordinates of William Wallace so he wouldn't spawn in the ocean, and some of the traits since they do not exist in Retrofit/Grand Unit AddOn. I also changed the number of turns required to trigger some of the actions to much smaller numbers, that way I could easily check to see whether or not this script works.

    One would think this script would work in a Retrofit/Grand Unit AddOn mod, since that is also based on Kingdoms, yes?

    If I were to use an add_events condition, how would I go about doing that? I understand the basic gist of scripting, but I am still very unfamiliar with the format of it.
    Last edited by hitokiri2486; October 20, 2008 at 03:07 PM. Reason: clarification

  7. #7

    Default Re: game CTDs when I script with .bik files

    Ok, I checked the docudemons, and it seems you forgot a parameter, the accept/decline boolean value.

    You should have this:

    historic_event scotland_wallace false event/william_wallace.bik

    Dominion of the Sword, a Medieval II: Total War Supermod
    Under the patronage of Archaon. Proud member of the House of Siblesz
    My friend died from chain letters. If you don't post this again 100 times, he will come and kill you in your sleep!

  8. #8
    hitokiri2486's Avatar Centenarius
    Join Date
    Aug 2008
    Location
    New York
    Posts
    805

    Default Re: game CTDs when I script with .bik files

    I tried the new parameter you have, and it does not seem to work.

    Actually, to be honest, the entire script is no longer working; the game does not seem to acknowledge its existence.

    I mentioned before that I could get this script to run without the command to run the .bik file. Now, I can't even do that with this script...the turns come and go without the army spawning, and the game runs merrily along without seeming to realize that this script exists.

    You can probably imagine the frustration I feel right now, since I haven't changed the script at all since the last time I tried it! What the heck is going on??

  9. #9

    Default Re: game CTDs when I script with .bik files

    Are you sure you haven't changed it?

    If there is a chance you changed the script, check your system.log.txt. There is probably an error along the lines of "script not compiled" in your log. If you see this, there should be another error immediately before "script not compiled" Fix this error and try again. If the campaign script still doesn't work, there is another error, consult your log again.

    If you are 100% sure that you did not change campaign script, did you change descr_strat.txt?
    Make sure the end of your descr_strat.txt looks like this:

    Code:
    script
    campaign_script.txt

    Dominion of the Sword, a Medieval II: Total War Supermod
    Under the patronage of Archaon. Proud member of the House of Siblesz
    My friend died from chain letters. If you don't post this again 100 times, he will come and kill you in your sleep!

  10. #10
    hitokiri2486's Avatar Centenarius
    Join Date
    Aug 2008
    Location
    New York
    Posts
    805

    Default Re: game CTDs when I script with .bik files

    Ah, how silly of me.

    I forgot to declare the William Wallace counter at the very top of the campaign_script.txt.

    On the other hand, it looks like your proposed fix worked, Azim. The event is working perfectly now!

    Many felt thanks; I would give you +rep, but since I'm new at this forum I apparently have no rep to give. Thanks for the help, though, I appreciate it~

  11. #11

    Default Re: game CTDs when I script with .bik files

    No problem. Remember that you have to declare counters but not event counters. (That really confused me for a while when I started scripting.)

    Dominion of the Sword, a Medieval II: Total War Supermod
    Under the patronage of Archaon. Proud member of the House of Siblesz
    My friend died from chain letters. If you don't post this again 100 times, he will come and kill you in your sleep!

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •