Results 1 to 4 of 4

Thread: Script not firing

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1

    Default Script not firing

    I am working on a submod for Das Heiliges Romisches Reich. It may be found here:
    Nordic Realism

    Unfortunately, I believe that I have messed up the script, before I have even begun to work on it. For some reason, every time I now play the game, the script will not work. The mod's beginning message never even appears.

    What kinds of problems can seemingly cause the entire script to not work? To my knowledge, the only way that the script has been changed by me is through the following addition at the end:
    Spoiler Alert, click show to read: 

    ;------------------------------------------
    ;------- Part XXIX: Nordic Realism Scripts
    ;------------------------------------------

    ;----Blot-Sven-----------------------

    monitor_event FactionTurnStart FactionType slave
    and I_TurnNumber = 4

    spawn_army
    faction slave, sub_faction sweden
    character Blot-Sven, named character, age 30, x 211, y 247, label Sven
    unit NE Bodyguard exp 3 armour 0 weapon_lvl 0
    unit Huscarls exp 3 armour 0 weapon_lvl 0
    unit Huscarls exp 3 armour 0 weapon_lvl 0
    unit Peasant Archers exp 1 armour 0 weapon_lvl 0
    unit Peasant Archers exp 1 armour 0 weapon_lvl 0
    unit Viking Raiders exp 2 armour 0 weapon_lvl 0
    unit Viking Raiders exp 2 armour 0 weapon_lvl 0
    unit Norse Swordsmen exp 2 armour 0 weapon_lvl 0
    unit Norse Swordsmen exp 2 armour 0 weapon_lvl 0
    unit Woodsmen exp 1 armour 0 weapon_lvl 0
    end

    end_monitor

    ;------------------------------------------


    I'm not sure, but could it have been caused by a change in something affected by the script?
    For instance, I have made some changes to the map, and files like descr_strat, including the locations, garrisons, and ownership of some cities. New names were added to the names files, although none should have been deleted. The Swedish family tree was also affected. As far as the renaming of regions/cities goes, only the in-game names should have been changed.

    Could something in the preferences.cfg be preventing the script? I believe that my only changes were the activation of windowed mode and the use of error logging.

    Anyways, does anyone have any suggestions as to what is causing this mess? I'll attach Dimitri's script, as I have changed it, below.

  2. #2

    Default Re: Script not firing

    You first need to find out if it is the script that is the problem or somthing else. Run the campaign again, until you either crash or have completed one turn. Open the log and search for campaign_script, continue searching for campaign script and read each line that contains 'campaign_script'. Those lines will tell you the exact problem if the script is at fault. For example, it will tell you that it was unable to compile the script due to an error on line 44 where it expected somthing or whatever the case may be. Just make sure you have your log set to trace.

    If it is the script, and likely it is if your script is supposed to fire a message on the first turn that you are not getting, then the log will tell you the exact issue. Simply make the changes needed and try again.
    ...longbows, in skilled hands, could reach further than trebuchets...

  3. #3

    Default Re: Script not firing

    Quote Originally Posted by Tsarsies View Post
    You first need to find out if it is the script that is the problem or somthing else. Run the campaign again, until you either crash or have completed one turn. Open the log and search for campaign_script, continue searching for campaign script and read each line that contains 'campaign_script'. Those lines will tell you the exact problem if the script is at fault. For example, it will tell you that it was unable to compile the script due to an error on line 44 where it expected somthing or whatever the case may be. Just make sure you have your log set to trace.

    If it is the script, and likely it is if your script is supposed to fire a message on the first turn that you are not getting, then the log will tell you the exact issue. Simply make the changes needed and try again.
    Thanks!

    Your suggestion to search was a very good one indeed. Normally, whenever I look through a log file, I tend to look through it manually. To save time, I have a bad habit of skimming, so the first time I went through the log I had missed the problem. After searching for 'campaign_script,' I found three errors where a strange new line had been placed right inside part of the script. I'm not entirely sure how they got there; they were nowhere near the part of the script I had added in, and they weren't there originally. Perhaps there was some data corruption? Anyways, the script is working again.

  4. #4
    Augustus Lucifer's Avatar Life = Like a beanstalk
    Patrician Citizen

    Join Date
    Aug 2006
    Location
    Mote of Dust
    Posts
    10,725

    Default Re: Script not firing

    You should also view my thread about logging here. If you use those lines it will separate the script-related checks and errors into a separate file, which is especially useful if you also log "* trace" which fills the file with thousands of kb of mainly useless information.

Posting Permissions

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