Results 1 to 9 of 9

Thread: Help with spawning characters

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    papio's Avatar Libertus
    Join Date
    May 2009
    Location
    Texas
    Posts
    86

    Default Help with spawning characters

    Hi, I'm currently playing Third Age TW using a sub mod that makes nazgul immortal by respawning them when they die (http://www.twcenter.net/forums/showthread.php?t=260218). However I want there to be a few turns in between their death and respawn so I wrote a script to do so. It is, unfortunatly, not working so I thought I'd post it here and see if anyone has an idea as to why.

    Spoiler Alert, click show to read: 
    declare_counter nazgul
    declare_counter nazgula
    declare_counter nazgulb
    declare_counter nazgulc
    declare_counter nazguld
    declare_counter nazgule
    declare_counter nazgulf
    declare_counter nazgulg
    declare_counter nazgulh
    declare_counter nazguli
    set_counter nazgula 0
    set_counter nazgulb 0
    set_counter nazgulc 0
    set_counter nazguld 0
    set_counter nazgule 0
    set_counter nazgulf 0
    set_counter nazgulg 0
    set_counter nazgulh 0
    set_counter nazguli 0



    monitor_event FactionTurnStart FactionType england

    if not I_WorldwideAncillaryExists ring_nazgula
    and I_SettlementOwner Gorgoroth = england
    inc_counter nazgula 1
    end_if

    if I_SettlementOwner Gorgoroth = england
    and I_CompareCounter nazgula = 3

    spawn_army
    faction england
    character Nazgula, named character, age 35, x 290, y 138, portrait nazgul1, battle_model mounted_nazgul
    traits RingOne 1, factionleader 1, Witchking 1, LoyaltyStarter 3, GoodCommander 3, BattleScarred 2, BattleDread 1, CaptorDread 1, GoodAttacker 1, NightBattleCapable 1
    unit Black Numenorians exp 3 armour 1 weapon_lvl 0
    end

    set_counter nazgula 0
    set_counter nazgul 1
    end_if
    terminate_monitor
    end_monitor

    monitor_event FactionTurnStart FactionType england

    if not I_WorldwideAncillaryExists ring_nazgulb
    and I_SettlementOwner Gorgoroth = england
    inc_counter nazgulb 1
    end_if

    if I_SettlementOwner Gorgoroth = england
    and I_CompareCounter nazgulb = 3

    spawn_army
    faction england
    character Nazgulb, named character, age 32, x 290, y 138, portrait nazgul2, battle_model mounted_nazgul
    traits RingTwo 1, Nazgul 1, LoyaltyStarter 3 , GoodCommander 3 , BattleScarred 2, BattleDread 1 , CaptorDread 1 , GoodAttacker 1 , NightBattleCapable 1
    unit Black Numenorians exp 3 armour 1 weapon_lvl 0
    end

    set_counter nazgulb 0
    set_counter nazgul 1
    end_if
    terminate_monitor
    end_monitor

    monitor_event FactionTurnStart FactionType england

    if not I_WorldwideAncillaryExists ring_nazgulc
    and I_SettlementOwner Gorgoroth = england
    inc_counter nazgulc 1
    end_if

    if I_SettlementOwner Gorgoroth = england
    and I_CompareCounter nazgulc = 3

    spawn_army
    faction england
    character Nazgulc, named character, age 30, x 290, y 138, portrait nazgul4, battle_model mounted_nazgul
    traits RingThree 1, Nazgul 1, LoyaltyStarter 3, GoodCommander 2, BattleScarred 3, StrategyDread 1, GoodAttacker 1, NightBattleCapable 1
    unit Black Numenorians exp 3 armour 1 weapon_lvl 0
    end

    set_counter nazgulc 0
    set_counter nazgul 1
    end_if
    terminate_monitor
    end_monitor

    monitor_event FactionTurnStart FactionType england

    if not I_WorldwideAncillaryExists ring_nazguld
    and I_SettlementOwner Gorgoroth = england
    inc_counter nazguld 1
    end_if

    if I_SettlementOwner Gorgoroth = england
    and I_CompareCounter nazguld = 3

    spawn_army
    faction england
    character Nazguld, named character, age 42, x 290, y 138, portrait nazgul3, battle_model mounted_nazgul
    traits Nazgul 1, RingFour 1, LoyaltyStarter 3, GoodCommander 3, BattleScarred 2, BattleDread 1, CaptorDread 1, GoodAttacker 1, NightBattleCapable 1
    unit Black Numenorians exp 3 armour 1 weapon_lvl 0
    end

    set_counter nazguld 0
    set_counter nazgul 1
    end_if
    terminate_monitor
    end_monitor

    monitor_event FactionTurnStart FactionType england

    if not I_WorldwideAncillaryExists ring_nazgule
    and I_SettlementOwner Gorgoroth = england
    inc_counter nazgule 1
    end_if

    if I_SettlementOwner Gorgoroth = england
    and I_CompareCounter nazgule = 3

    spawn_army
    faction england
    character Nazgule, named character, age 30, x 290, y 138, portrait nazgul5, battle_model mounted_nazgul
    traits RingFive 1, Nazgul 1, LoyaltyStarter 3 , GoodCommander 3 , BattleScarred 1, BattleDread 1 , CaptorDread 1 , GoodAttacker 1 , NightBattleCapable 1
    unit Black Numenorians exp 3 armour 1 weapon_lvl 0
    end

    set_counter nazgule 0
    set_counter nazgul 1
    end_if
    terminate_monitor
    end_monitor

    monitor_event FactionTurnStart FactionType england

    if not I_WorldwideAncillaryExists ring_nazgulf
    and I_SettlementOwner Gorgoroth = england
    inc_counter nazgulf 1
    end_if

    if I_SettlementOwner Gorgoroth = england
    and I_CompareCounter nazgulf = 3

    spawn_army
    faction england
    character Nazgulf, named character, age 34, x 290, y 138, portrait nazgul6, battle_model mounted_nazgul
    traits RingSix 1, Nazgul 1, LoyaltyStarter 3 , GoodCommander 3 , BattleScarred 2, BattleDread 1 , CaptorDread 1 , NightBattleCapable 1
    unit Black Numenorians exp 3 armour 1 weapon_lvl 0
    end

    set_counter nazgulf 0
    set_counter nazgul 1
    end_if
    terminate_monitor
    end_monitor

    monitor_event FactionTurnStart FactionType england

    if not I_WorldwideAncillaryExists ring_nazgulg
    and I_SettlementOwner Gorgoroth = england
    inc_counter nazgulg 1
    end_if

    if I_SettlementOwner Gorgoroth = england
    and I_CompareCounter nazgulg = 3

    spawn_army
    faction england
    character Nazgulg, named character, age 38, x 290, y 138, portrait nazgul7, battle_model mounted_nazgul
    traits RingSeven 1, Nazgul 1, LoyaltyStarter 2 , GoodCommander 3 , BattleScarred 2, BattleDread 1 , CaptorDread 1 , GoodAttacker 1 , NightBattleCapable 1
    unit Black Numenorians exp 3 armour 1 weapon_lvl 0
    end

    set_counter nazgulg 0
    set_counter nazgul 1
    end_if
    terminate_monitor
    end_monitor

    monitor_event FactionTurnStart FactionType england

    if not I_WorldwideAncillaryExists ring_nazgulh
    and I_SettlementOwner Gorgoroth = england
    inc_counter nazgulh 1
    end_if

    if I_SettlementOwner Gorgoroth = england
    and I_CompareCounter nazgulh = 3

    spawn_army
    faction england
    character Nazgulh, named character, age 42, x 290, y 138, portrait nazgul8, battle_model mounted_nazgul
    traits RingEight 1, Nazgul 1, LoyaltyStarter 3 , GoodCommander 3 , BattleScarred 2, BattleDread 1 , CaptorDread 1 , GoodAttacker 1 , NightBattleCapable 1
    unit Black Numenorians exp 3 armour 1 weapon_lvl 0
    end

    set_counter nazgulh 0
    set_counter nazgul 1
    end_if
    terminate_monitor
    end_monitor

    monitor_event FactionTurnStart FactionType england

    if not I_WorldwideAncillaryExists ring_nazguli
    and I_SettlementOwner Gorgoroth = england
    inc_counter nazguli 1
    end_if

    if I_SettlementOwner Gorgoroth = england
    and I_CompareCounter nazguli = 3

    spawn_army
    faction england
    character Nazguli, named character, age 48, x 290, y 138, portrait nazgul9, battle_model mounted_nazgul
    traits RingNine 1, Nazgul 1, LoyaltyStarter 3 , GoodCommander 3 , BattleScarred 2, BattleDread 1 , CaptorDread 1 , GoodAttacker 1 , NightBattleCapable 1
    unit Black Numenorians exp 3 armour 1 weapon_lvl 0
    end

    set_counter nazguli 0
    set_counter nazgul 1
    end_if
    terminate_monitor
    end_monitor

    monitor_event FactionTurnStart FactionType england
    and I_LocalFaction england
    and I_CompareCounter nazgul = 1
    historic_event nazgul
    set_counter nazgul 0
    terminate_monitor
    end_monitor


    I have tried many variations of this but with no success. Any help will be much appreciated.

  2. #2
    Squid's Avatar Opifex
    Patrician Artifex Technical Staff

    Join Date
    Feb 2007
    Location
    Frozen waste lands of the north
    Posts
    17,751
    Blog Entries
    3

    Default Re: Help with spawning characters

    I can tell you one possible problem with the script. For each nazgul you test for the presence of its associated ancillary, but when the nazgul is recreated you don't give it that ancillary, so unless that ancillary is given some other way you will be spawing each nazgul every 3 turns.
    Under the patronage of Roman_Man#3, Patron of Ishan
    Click for my tools and tutorials
    "Two things are infinite: the universe and human stupidity; and I'm not sure about the universe." -----Albert Einstein

  3. #3
    konny's Avatar Artifex
    Join Date
    Jul 2007
    Location
    Germania Inferior
    Posts
    3,631

    Default Re: Help with spawning characters

    I would suspect "terminate_monitor" to be the problem: The monitor is excuted the first time not I_WorldwideAncillaryExists ring_nazgula, and terminated thereafter, so counter nazgula can never reach "3".

    Team member of: Das Heilige Römische Reich, Europa Barbarorum, Europa Barbarorum II, East of Rome
    Modding help by Konny: Excel Traitgenerator, Setting Heirs to your preference
    dHRR 0.8 beta released! get it here
    New: Native America! A mini-mod for Kingdoms America

  4. #4
    papio's Avatar Libertus
    Join Date
    May 2009
    Location
    Texas
    Posts
    86

    Default Re: Help with spawning characters

    Quote Originally Posted by Sqυιd View Post
    I can tell you one possible problem with the script. For each nazgul you test for the presence of its associated ancillary, but when the nazgul is recreated you don't give it that ancillary, so unless that ancillary is given some other way you will be spawing each nazgul every 3 turns.
    They get the ancillary from their ring trait.

    I would suspect "terminate_monitor" to be the problem: The monitor is excuted the first time not I_WorldwideAncillaryExists ring_nazgula, and terminated thereafter, so counter nazgula can never reach "3".
    Hmm, sounds good, never fully understood terminate_monitor vs end_monitor, but I think I get it now.

    Thanks very much to both of you

    Edit: I tried it again, this time with all terminate_monitor lines removed, but with no success. Removing the terminate monitor commands also for some reason stopped other scripts, such as 4 turns per year aging, from working correctly.

    Thanks again for any help

    Edit2: here's what I'm seeing in the log file

    21:33:05.620 [game.script] [error] Script parsing error at line 6050, column 52 in mods/americas/data/world/maps/campaign/imperial_campaign/campaign_script.txt
    Unrecognised unit data string ()
    21:33:05.620 [game.script] [error] Script parsing error at line 6054, column 1 in mods/americas/data/world/maps/campaign/imperial_campaign/campaign_script.txt
    Couldn't create a script from file mods/americas/data/world/maps/campaign/imperial_campaign/campaign_script.txt

    line 6050 is the line starting with 'unit' to spawn nazgula
    Last edited by papio; May 28, 2009 at 09:50 PM.

  5. #5
    konny's Avatar Artifex
    Join Date
    Jul 2007
    Location
    Germania Inferior
    Posts
    3,631

    Default Re: Help with spawning characters

    Quote Originally Posted by papio View Post
    Edit: I tried it again, this time with all terminate_monitor lines removed, but with no success. Removing the terminate monitor commands also for some reason stopped other scripts, such as 4 turns per year aging, from working correctly.
    But you did keep "end_if" and "end_monitor"?

    21:33:05.620 [game.script] [error] Script parsing error at line 6050, column 52 in mods/americas/data/world/maps/campaign/imperial_campaign/campaign_script.txt
    Unrecognised unit data string ()
    It is not able to recognize "Black Numenorians"

    21:33:05.620 [game.script] [error] Script parsing error at line 6054, column 1 in mods/americas/data/world/maps/campaign/imperial_campaign/campaign_script.txt
    Couldn't create a script from file mods/americas/data/world/maps/campaign/imperial_campaign/campaign_script.txt
    This seems to be refering to this block:

    set_counter nazgula 0
    set_counter nazgul 1
    end_if
    terminate_monitor
    end_monitor


    BTW: "mods/americas/"? Is this mod running in the Americas folder?

    Team member of: Das Heilige Römische Reich, Europa Barbarorum, Europa Barbarorum II, East of Rome
    Modding help by Konny: Excel Traitgenerator, Setting Heirs to your preference
    dHRR 0.8 beta released! get it here
    New: Native America! A mini-mod for Kingdoms America

  6. #6
    papio's Avatar Libertus
    Join Date
    May 2009
    Location
    Texas
    Posts
    86

    Default Re: Help with spawning characters

    But you did keep "end_if" and "end_monitor"?
    Yes it was exactly the same except for terminate_monitor.
    It is not able to recognize "Black Numenorians"
    That's odd though because the default script is the same other than a few spacing differences.
    BTW: "mods/americas/"? Is this mod running in the Americas folder?
    Yes, I'm using steam and didn't feel like editing the registry to get it the mod to work in its own folder

    Edit: tested with spawn army command copy and pasted from the mods campaign script (as opposed to typing it out) and it now works. Thank you very much for you help. +rep (when I can, got to wait till 24hrs limit is up)
    Last edited by papio; May 29, 2009 at 10:20 AM.

  7. #7

    Default Re: Help with spawning characters

    what mod are you using? for example if its mine.. your problem is with the fact that Gorgoroth isn't owned by england lol =)
    Son of the Ancient Archaon, House of Siblesz

  8. #8
    papio's Avatar Libertus
    Join Date
    May 2009
    Location
    Texas
    Posts
    86

    Default Re: Help with spawning characters

    1.1 with RC and visual enhancement with this, http://www.twcenter.net/forums/showthread.php?t=260218. The script works now, the problem was some sort of syntax error within the spawn army command.
    Last edited by papio; May 30, 2009 at 11:54 AM.

  9. #9

    Default Re: Help with spawning characters

    Quote Originally Posted by papio View Post
    1.1 with RC and visual enhancement with this, http://www.twcenter.net/forums/showthread.php?t=260218. The script works now, the problem was some sort of syntax error within the spawn army command.
    Hi Papio, how have you fared with this issue? do you still have a problem with a syntax error? can you post the last lines of the log file?

Posting Permissions

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