Results 1 to 15 of 15

Thread: How to properly spawn heretic and generals..(solved)

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    RollingWave's Avatar Praepositus
    Join Date
    Feb 2005
    Location
    Taiwan
    Posts
    5,083

    Default How to properly spawn heretic and generals..(solved)

    Ok.. I'm writing a script to spawn a very strong heretic and then later on a rebel general.. but I have ran into several issue.

    1.my spawn heretic script doesn't seem to work. here it is..

    monitor_event FactionTurnStart FactionType slave
    and I_TurnNumber = 1

    if I_SettlementOwner Marrakesh = moors
    and I_SettlementOwner Fes = moors
    spawn_character slave Amghar ibn_Tumart, heretic, age 40, x 37, y 94

    set_event_counter ibn_tumart 1
    add_money slave 10000
    end_if

    if I_EventCounter ibn_tumart = 1
    historic_event ibn_Tumart
    console_command give_trait Amghar ibn_Tumart NaturalHereticSkill 3
    console_command give_trait Amghar ibn_Tumart HereticPersuasion 3
    console_command give_trait Amghar ibn_Tumart GrowingConviction 3
    end_if

    terminate_monitor
    end_monitor
    I'm not sure what's the problem here, but after I tried this it always crash when it's suppose to spawn without giving the reason in system log. the tile is not the issue, i've checked several times and it's a prefectly acceptable position .

    quesiton 2

    I want to spawn a rebel islamic general, but my first attempts saw the general spawning as a catholic dude, I'm guessing it's because rebels faction by default is southern_european. so i tweaked it around a bit... would this work? precisely the lines I put in bold

    monitor_event FactionTurnStart FactionType slave
    and I_TurnNumber = 3

    if I_SettlementOwner Marrakesh = moors
    and I_SettlementOwner Cordoba = moors
    and I_SettlementOwner Fes = moors
    and I_NumberOfSettlements moors > 5
    spawn_army
    faction slave sub_faction moors
    character Abd al-Mu'min, named character, age 30, x 17, y 74, direction N, battle_model Eastern_General, portrait saladin, label Abd_Almohad
    traits GoodCommander 4 , BattleDread 3 , StrategyDread 2 , PublicFaith 1 , NaturalMilitarySkill 2
    unit ME Bodyguard exp 2 armour 0 weapon_lvl 0
    unit Berber Spearmen exp 2 armour 0 weapon_lvl 0
    unit Berber Spearmen exp 2 armour 0 weapon_lvl 0
    unit Desert Cavalry exp 2 armour 0 weapon_lvl 0
    unit Desert Cavalry exp 2 armour 0 weapon_lvl 0
    unit Berber Infantry exp 2 armour 0 weapon_lvl 0
    unit Berber Infantry exp 2 armour 0 weapon_lvl 0
    unit ME Spear Militia exp 2 armour 0 weapon_lvl 0
    unit ME Spear Militia exp 2 armour 0 weapon_lvl 0
    unit Desert Cavalry exp 2 armour 0 weapon_lvl 0
    unit Shaykh Cavalry exp 2 armour 0 weapon_lvl 0
    unit Berber Infantry exp 2 armour 0 weapon_lvl 0
    unit Dismounted Shaykh exp 2 armour 0 weapon_lvl 0
    unit Desert Archers exp 2 armour 0 weapon_lvl 0
    unit Desert Archers exp 2 armour 0 weapon_lvl 0
    unit Desert Archers exp 2 armour 0 weapon_lvl 0
    unit Desert Archers exp 2 armour 0 weapon_lvl 0
    unit ME Catapult exp 2 armour 0 weapon_lvl 0
    end
    set_event_counter almohad_rebel 1
    add_money slave 10000
    end_if

    if I_EventCounter almohad_rebel = 1
    historic_event almohad_uprising
    end_if

    terminate_monitor
    end_monitor
    I had tried to use strat_model line in the same way as battle_model but that appears to not work, (script error is given) . this setup right now don't have error but I'm not sure if it'll actually work.

    thx for the help
    Last edited by RollingWave; March 02, 2012 at 06:14 AM.
    1180, an unprecedented period of peace and prosperity in East Asia, it's technology and wealth is the envy of the world. But soon conflict will engulf the entire region with great consequences and lasting effects for centuries to come, not just for this region, but the entire known world, when one man, one people, unites.....

  2. #2
    Lazy's Avatar Biarchus
    Join Date
    Jul 2011
    Location
    Aachen
    Posts
    661

    Default Re: How to properly spawn heretic and generals..

    I bet its because the name... there are these brackets missing!

    Lazy the Great => crash
    "Lazy the Great" => works

    Additionally try not not use "if" if you do not really need it because not every event is able to use it...

    Code:
    monitor_event FactionTurnStart FactionType slave
        and I_TurnNumber = 1
        and I_SettlementOwner Marrakesh = moors ( at the first turn the moors own this town always... so its not needed )
        and I_SettlementOwner Fes = moors ( this is not needed too )
    
            spawn_character slave "Amghar ibn_Tumart", heretic, age 40, x 37, y 94
            console_command give_trait "Amghar ibn_Tumart" NaturalHereticSkill 3
            console_command give_trait "Amghar ibn_Tumart" HereticPersuasion 3
            console_command give_trait "Amghar ibn_Tumart" GrowingConviction 3
        
            set_event_counter ibn_tumart 1 ( delete this line if not really needed )
            add_money slave 10000 ( slaves do not have a money account I think so I bet this can be deleted)
            historic_event ibn_Tumart
    
        terminate_monitor
    end_monitor
    Sorry for bad english... I am "a little" drunk
    I wuold try to look at the second question too but its too much... I cant read it right now...
    Last edited by Lazy; February 29, 2012 at 02:46 PM.
    Quote Originally Posted by SirWarts View Post
    ...the woman trampled didn't look impenetrable. So they ran through her.

  3. #3
    RollingWave's Avatar Praepositus
    Join Date
    Feb 2005
    Location
    Taiwan
    Posts
    5,083

    Default Re: How to properly spawn heretic and generals..

    Ahhh, great! thx man
    1180, an unprecedented period of peace and prosperity in East Asia, it's technology and wealth is the envy of the world. But soon conflict will engulf the entire region with great consequences and lasting effects for centuries to come, not just for this region, but the entire known world, when one man, one people, unites.....

  4. #4
    RollingWave's Avatar Praepositus
    Join Date
    Feb 2005
    Location
    Taiwan
    Posts
    5,083

    Default Re: How to properly spawn heretic and generals..

    hmmm, still seem to have problem.... the comp crash when I get to the turns right now and the heretic simply doesn't spawn.

    monitor_event FactionTurnStart FactionType slave
    and I_TurnNumber = 2

    if I_SettlementOwner Marrakesh = moors
    and I_SettlementOwner Fes = moors
    spawn_character slave "Amghar ibn_Tumart", heretic, age 40, x 37, y 94

    console_command give_trait "Amghar ibn_Tumart" NaturalHereticSkill 3
    console_command give_trait "Amghar ibn_Tumart" HereticPersuasion 3
    console_command give_trait "Amghar ibn_Tumart" GrowingConviction 3
    historic_event ibn_tumart

    end_if

    terminate_monitor
    end_monitor
    is this right? note I'm not actually going to set it at turn 1 , i'm doing this to test if it works so that's why I have the if conditions
    1180, an unprecedented period of peace and prosperity in East Asia, it's technology and wealth is the envy of the world. But soon conflict will engulf the entire region with great consequences and lasting effects for centuries to come, not just for this region, but the entire known world, when one man, one people, unites.....

  5. #5
    Withwnar's Avatar Script To The Waist
    Join Date
    Oct 2008
    Location
    Earth
    Posts
    6,329

    Default Re: How to properly spawn heretic and generals..

    Do you have an entry for that historic event in historic_events.txt? That causes error-less CTDs.

    How do you know that he isn't spawning if it's crashing? I would have thought that you wouldn't have time to see if he spawns or not before the crash.

  6. #6
    Vegas_Bear's Avatar Biarchus
    Join Date
    Sep 2005
    Location
    Las Vegas, NV
    Posts
    605

    Default Re: How to properly spawn heretic and generals..

    I'd try to start off w/ the basics and then build off of that -

    monitor_event FactionTurnStart FactionType slave
    and I_TurnNumber = 1

    spawn_character slave, Amghar ibn_Tumart, heretic, age 40, x 37, y 94
    console_command give_trait "Amghar ibn_Tumart" NaturalHereticSkill 3
    console_command give_trait "Amghar ibn_Tumart" HereticPersuasion 3
    console_command give_trait "Amghar ibn_Tumart" GrowingConviction 3

    terminate_monitor
    end_monitor
    Start w/ this and then add the historic event and regions owned by the moors. Is Amghar ibn_Tumart listed for the slave faction in the descr_names.txt?

    VB

  7. #7
    Vegas_Bear's Avatar Biarchus
    Join Date
    Sep 2005
    Location
    Las Vegas, NV
    Posts
    605

    Default Re: How to properly spawn heretic and generals..

    For your spawned General, try this -

    declare_counter almohad_rebel
    set_counter almohad_rebel 0

    monitor_event FactionTurnStart FactionType slave
    and I_TurnNumber = 3

    if I_SettlementOwner Marrakesh = moors
    and I_SettlementOwner Cordoba = moors
    and I_SettlementOwner Fes = moors
    and I_NumberOfSettlements moors > 5
    spawn_army
    faction slave, sub_faction moors
    character Abd al-Mu'min, named character, age 30, x 17, y 74, direction N, battle_model Eastern_General, portrait saladin, label Abd_Almohad
    traits GoodCommander 4 , BattleDread 3 , StrategyDread 2 , PublicFaith 1 , NaturalMilitarySkill 2
    unit ME Bodyguard exp 2 armour 0 weapon_lvl 0
    unit Berber Spearmen exp 2 armour 0 weapon_lvl 0
    unit Berber Spearmen exp 2 armour 0 weapon_lvl 0
    unit Desert Cavalry exp 2 armour 0 weapon_lvl 0
    unit Desert Cavalry exp 2 armour 0 weapon_lvl 0
    unit Berber Infantry exp 2 armour 0 weapon_lvl 0
    unit Berber Infantry exp 2 armour 0 weapon_lvl 0
    unit ME Spear Militia exp 2 armour 0 weapon_lvl 0
    unit ME Spear Militia exp 2 armour 0 weapon_lvl 0
    unit Desert Cavalry exp 2 armour 0 weapon_lvl 0
    unit Shaykh Cavalry exp 2 armour 0 weapon_lvl 0
    unit Berber Infantry exp 2 armour 0 weapon_lvl 0
    unit Dismounted Shaykh exp 2 armour 0 weapon_lvl 0
    unit Desert Archers exp 2 armour 0 weapon_lvl 0
    unit Desert Archers exp 2 armour 0 weapon_lvl 0
    unit Desert Archers exp 2 armour 0 weapon_lvl 0
    unit Desert Archers exp 2 armour 0 weapon_lvl 0
    unit ME Catapult exp 2 armour 0 weapon_lvl 0
    end
    set_event_counter almohad_rebel 1
    add_money slave 10000
    end_if

    if I_EventCounter almohad_rebel = 1
    historic_event almohad_uprising
    end_if

    terminate_monitor
    end_monitor
    You were missing a comma in the sub-faction line.

    VB

  8. #8
    RollingWave's Avatar Praepositus
    Join Date
    Feb 2005
    Location
    Taiwan
    Posts
    5,083

    Default Re: How to properly spawn heretic and generals..

    Quote Originally Posted by Vegas_Bear View Post
    For your spawned General, try this -



    You were missing a comma in the sub-faction line.

    VB
    I tried your suggestion, but i'm still getting this

    Spoiler Alert, click show to read: 
    1180, an unprecedented period of peace and prosperity in East Asia, it's technology and wealth is the envy of the world. But soon conflict will engulf the entire region with great consequences and lasting effects for centuries to come, not just for this region, but the entire known world, when one man, one people, unites.....

  9. #9
    Withwnar's Avatar Script To The Waist
    Join Date
    Oct 2008
    Location
    Earth
    Posts
    6,329

    Default Re: How to properly spawn heretic and generals..

    Quote Originally Posted by RollingWave View Post
    I had tried to use strat_model line in the same way as battle_model but that appears to not work, (script error is given) .
    For strat models you need to use descr_model_strat and descr_character, then set the appropriate Level via a trait/ancillary.

  10. #10
    RollingWave's Avatar Praepositus
    Join Date
    Feb 2005
    Location
    Taiwan
    Posts
    5,083

    Default Re: How to properly spawn heretic and generals..

    Quote Originally Posted by Withwnar View Post
    For strat models you need to use descr_model_strat and descr_character, then set the appropriate Level via a trait/ancillary.
    ok I got the heretic thing working now, here's the final stuff I did

    monitor_event FactionTurnStart FactionType slave
    and I_TurnNumber = 39

    if I_SettlementOwner Marrakesh = moors
    and I_SettlementOwner Fes = moors

    historic_event ibn_tumart
    set_event_counter new_prophet 1
    end_if

    if I_EventCounter new_prophet = 1
    spawn_character slave Amghar ibn_Tumart, heretic, age 40, x 20, y 74
    console_command give_trait "Amghar ibn_Tumart" GrowingConviction 1
    console_command give_trait "Amghar ibn_Tumart" NaturalHereticSkill 3
    console_command give_trait "Amghar ibn_Tumart" HereticPersuasion 3
    console_command give_trait "Amghar ibn_Tumart" StrongFaith 4
    console_command add_money moors -2000
    end_if

    terminate_monitor
    end_monitor
    Now on to tackling the strat model...
    1180, an unprecedented period of peace and prosperity in East Asia, it's technology and wealth is the envy of the world. But soon conflict will engulf the entire region with great consequences and lasting effects for centuries to come, not just for this region, but the entire known world, when one man, one people, unites.....

  11. #11
    Withwnar's Avatar Script To The Waist
    Join Date
    Oct 2008
    Location
    Earth
    Posts
    6,329

    Default Re: How to properly spawn heretic and generals..

    If this is the only use of that new_prophet counter then it is redundant. You may as well do this...

    Code:
    if I_SettlementOwner Marrakesh = moors
     and I_SettlementOwner Fes = moors
    
     historic_event ibn_tumart
     set_event_counter new_prophet 1
     end_if
    
     if I_EventCounter new_prophet = 1
     spawn_character slave Amghar ibn_Tumart, heretic, age 40, x 20, y 74
     console_command give_trait "Amghar ibn_Tumart" GrowingConviction 1
     console_command give_trait "Amghar ibn_Tumart" NaturalHereticSkill 3
     console_command give_trait "Amghar ibn_Tumart" HereticPersuasion 3
     console_command give_trait "Amghar ibn_Tumart" StrongFaith 4 
     console_command add_money moors -2000
     end_if
    But I can't see why this works and your previous one doesn't. Are you sure that is all that you changed? e.g. It wasn't a missing historic_events.txt entry?

  12. #12
    RollingWave's Avatar Praepositus
    Join Date
    Feb 2005
    Location
    Taiwan
    Posts
    5,083

    Default Re: How to properly spawn heretic and generals..

    Any other suggestions? on how to make the rebel general strat model to actually look middle eastern? the subfaction or sub_faction tag didn't seem to help :/
    1180, an unprecedented period of peace and prosperity in East Asia, it's technology and wealth is the envy of the world. But soon conflict will engulf the entire region with great consequences and lasting effects for centuries to come, not just for this region, but the entire known world, when one man, one people, unites.....

  13. #13

    Default Re: How to properly spawn heretic and generals..

    Quote Originally Posted by RollingWave View Post
    Any other suggestions? on how to make the rebel general strat model to actually look middle eastern? the subfaction or sub_faction tag didn't seem to help :/
    sub_faction tag does not work in CS spawn commands. Assuming you are using Kingdoms you will need to create extra general model entry in descr_character.txt, then the trait with effect Level 1 (assuming your model entry is second in descr_character.txt) and give your character this trait. It will change his model to the desired one.

    However note that as sub_faction does not work traits and ancillaries don't work either so you will have to do it via console_command give_trait.

    Mod Leader, Mapper & Bohemian Researcher

  14. #14
    RollingWave's Avatar Praepositus
    Join Date
    Feb 2005
    Location
    Taiwan
    Posts
    5,083

    Default Re: How to properly spawn heretic and generals..

    Quote Originally Posted by Resurrection View Post
    sub_faction tag does not work in CS spawn commands. Assuming you are using Kingdoms you will need to create extra general model entry in descr_character.txt, then the trait with effect Level 1 (assuming your model entry is second in descr_character.txt) and give your character this trait. It will change his model to the desired one.

    However note that as sub_faction does not work traits and ancillaries don't work either so you will have to do it via console_command give_trait.
    Aha! that did it! thanks a ton!

    Spoiler Alert, click show to read: 
    1180, an unprecedented period of peace and prosperity in East Asia, it's technology and wealth is the envy of the world. But soon conflict will engulf the entire region with great consequences and lasting effects for centuries to come, not just for this region, but the entire known world, when one man, one people, unites.....

  15. #15

    Default Re: How to properly spawn heretic and generals..

    I am glad you figured it out!

    Mod Leader, Mapper & Bohemian Researcher

Posting Permissions

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