Results 1 to 6 of 6

Thread: Am I even close

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Firebat11's Avatar Semisalis
    Join Date
    Jan 2007
    Location
    Canada
    Posts
    465

    Default Am I even close

    I'm trying to add an event where if the Teutonic Order takes Stettin and Thorn, they will get an army spawned with a bunch or Crusaders.

    I add an event to historic_events

    Code:
    {TEUTONIC_ORDER_TAKES_POMERELIA_BODY}Control of Pomerelia has allowed the Order to connect their monastic state with the borders of the Holy Roman Empire. Crusading reinforcements and supplies are able to travel from the Imperial territory of Hither Pomerania through Pomerelia to Prussia, while Poland's access to the Baltic Sea, is blocked. While Poland had mostly been an ally of the knights against the pagan Prussians and Lithuanians, the capture of Pomerelia has turned the kingdom into a determined enemy of the Order. 
    {TEUTONIC_ORDER_TAKES_POMERELIA_TITLE}The Teutonic Order takes Stettin and Thorn.
    And I'm trying to edit the campaign_script file.

    Am I even close?

    Spoiler Alert, click show to read: 
    Code:
    monitor_event FactionTurnStart FactionType teutonic_order
      and I_TurnNumber > 0
     
      if I_SettlementOwner Thorn teutonic_order
       and I_SettlementOwner Stettin teutonic_order
     
        historic_event TEUTONIC_ORDER_TAKES_POMERELIA factions { teutonic_order, }
     
        terminate_monitor 
      spawn_army 
        faction teutonic_order
        character Charles, named character, x 246, y 255
        traits LoyaltyStarter 1, ReligionStarter 1, GoodAttacker 1
        unit  Crusader Sergeants    exp 0 armour 0 weapon_lvl 0
        unit  Crusader Sergeants    exp 0 armour 0 weapon_lvl 0
        unit  Crusader Sergeants    exp 0 armour 0 weapon_lvl 0
        unit  Order Militia    exp 0 armour 1 weapon_lvl 0
        unit  Dismounted Crusader Knights    exp 0 armour 0 weapon_lvl 0
        unit  Knetchen    exp 0 armour 1 weapon_lvl 0
        unit  Knetchen exp 0 armour 1 weapon_lvl 0
        unit  Christ Knights  exp 0 armour 0 weapon_lvl 0
        unit  Christ Knights exp 0 armour 0 weapon_lvl 0
      end
      terminate_monitor
     
     end_monitor


    Thank you,
    Co-Creator of Battle for the Baltic Mod for SS 6.1

  2. #2

    Default Re: Am I even close

    A little rephrasing and you should be fine... try...
    The red markings is what i changed or altered.

    Code:
    monitor_event FactionTurnStart FactionType teutonic_order
      and I_TurnNumber > 0
     
      if I_SettlementOwner Thorn = teutonic_order
       and I_SettlementOwner Stettin = teutonic_order
     
        historic_event teutonic_order_takes_pomerelia
    
      spawn_army 
        faction teutonic_order
        character Charles, named character, x 246, y 255
        traits LoyaltyStarter 1, ReligionStarter 1, GoodAttacker 1
        unit  Crusader Sergeants    exp 0 armour 0 weapon_lvl 0
        unit  Crusader Sergeants    exp 0 armour 0 weapon_lvl 0
        unit  Crusader Sergeants    exp 0 armour 0 weapon_lvl 0
        unit  Order Militia    exp 0 armour 1 weapon_lvl 0
        unit  Dismounted Crusader Knights    exp 0 armour 0 weapon_lvl 0
        unit  Knetchen    exp 0 armour 1 weapon_lvl 0
        unit  Knetchen exp 0 armour 1 weapon_lvl 0
        unit  Christ Knights  exp 0 armour 0 weapon_lvl 0
        unit  Christ Knights exp 0 armour 0 weapon_lvl 0
      end
    end_if
      terminate_monitor
     end_monitor

    You had terminate_monitor in the monitor twice, you only need it once at the end. You also were missing an 'end_if' and '=' signs.

    Should be fine
    ...longbows, in skilled hands, could reach further than trebuchets...

  3. #3
    Firebat11's Avatar Semisalis
    Join Date
    Jan 2007
    Location
    Canada
    Posts
    465

    Default Re: Am I even close

    Thank you, does it matter where I place this in the file?
    Co-Creator of Battle for the Baltic Mod for SS 6.1

  4. #4

    Default Re: Am I even close

    no it shouldnt make a difference where you place it. i generaly try to keep everything in some kind of order, just for easy reading i guess
    ...longbows, in skilled hands, could reach further than trebuchets...

  5. #5
    Firebat11's Avatar Semisalis
    Join Date
    Jan 2007
    Location
    Canada
    Posts
    465

    Default Re: Am I even close

    I put what you said. But when I took Thorn and Stettin, nothing happend?? What do I do now?

    P.S. Started a new campaign to test, didn't work
    Co-Creator of Battle for the Baltic Mod for SS 6.1

  6. #6

    Default Re: Am I even close

    when you take thorn and stettin as the tuetonic order are you getting the event message pop up at all? <if not, it could be a clerical error in the evnts files, other wise try the following...

    a couple of things that you should do to ensure that the script you have is going to work fine is...

    Ensure the chartacter name 'charles' is in the names.txt for the tuetonic order.

    ensure the character traits (LoyaltyStarter, ReligionStarter, GoodAttacker) are in the character traits file.

    ensure all units you wish to spawn are present in the EDU.

    make sure the x,y coordinates are a valid position on the campaign map.

    and recheck all spelling, its an easy mistake to make and ive made it too many times to count.

    I dont know anyone else that has had this issue, but i tend to have an issue with the terminate monitor, from my understanding if any part of the monitor fires then so will terminate monitor, so try removing terminate monitor and see if it will work.

    somthing like this may be happening... the monitor your using is firing true as soon as the game reads the 'if', everything before the if is being read true, then the game reads the if, realises that the tuetonic order has not taken either settlement, doesnt care because the if has fired regardless, sees terminate monitor, never attempts to fire it again...

    so maybe try remobinbg the 'if' aswell as 'end_if' and replace with and... like this...

    monitor_event FactionTurnStart FactionType teutonic_order
    and I_TurnNumber > 0
    and I_SettlementOwner Thorn = teutonic_order
    and I_SettlementOwner Stettin = teutonic_order

    historic_event teutonic_order_takes_pomerelia

    spawn_army
    faction teutonic_order
    character Charles, named character, x 246, y 255
    traits LoyaltyStarter 1, ReligionStarter 1, GoodAttacker 1
    unit Crusader Sergeants exp 0 armour 0 weapon_lvl 0
    unit Crusader Sergeants exp 0 armour 0 weapon_lvl 0
    unit Crusader Sergeants exp 0 armour 0 weapon_lvl 0
    unit Order Militia exp 0 armour 1 weapon_lvl 0
    unit Dismounted Crusader Knights exp 0 armour 0 weapon_lvl 0
    unit Knetchen exp 0 armour 1 weapon_lvl 0
    unit Knetchen exp 0 armour 1 weapon_lvl 0
    unit Christ Knights exp 0 armour 0 weapon_lvl 0
    unit Christ Knights exp 0 armour 0 weapon_lvl 0
    end
    terminate_monitor
    end_monitor

    the game will not regonize the terminate monitor until all 'and's have fired true. where as before the game would recognise if as soon as it was read. i have found that the 'if' statements are seen as 'commands' and not 'conditions', and terminate monitor tend to fire true as soon as a command is read. I hope that helps... if not, im happy to help further...

    oh, and also, what i do when testing new scripts is use a clean campaign script... nothing but ...

    script

    >your test script<

    wait_monitors
    end_script

    this way you ensure no other scripts are interferring with your new script. you also get the added bonus of the game reading the script alot faster (5 second truns, cant beat that)
    ...longbows, in skilled hands, could reach further than trebuchets...

Posting Permissions

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