Page 5 of 6 FirstFirst 123456 LastLast
Results 81 to 100 of 112

Thread: The placement of units, Coded and Scripted - using various commands

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    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: The placement of units, Coded and Scripted - using various commands

    The first unit in the spawn determines the model the general will get. If you set peasants, then your general will be a peasant etc...
    Haven't checked what texture he will get, most likely the one of the sub faction. Custom units might be the way to go here.










  2. #2
    wudang_clown's Avatar Fire Is Inspirational
    Join Date
    Jan 2009
    Location
    Poland
    Posts
    7,357

    Default Re: The placement of units, Coded and Scripted - using various commands

    Quote Originally Posted by Gigantus View Post
    The first unit in the spawn determines the model the general will get. If you set peasants, then your general will be a peasant etc...
    Haven't checked what texture he will get, most likely the one of the sub faction. Custom units might be the way to go here.
    Not exactly.

    In my example, first unit is of teutonic knights, but it has generic Middle Eastern (or Mongolian, I can't recognize vanilla models) general, not Latin one.

    I've been trying different combinations of entries in character line, but apparently "sub_faction" doesn't work in campaign_script.

    When I put it in "faction slave, sub_faction x" the game ignores "sub_faction" part. When I put "sub_faction x" instead of "faction slave" - the army isn't spawned and the log says that it's general's entry which should be first. When I put "sub_faction x" right after "character" header - the game can't recognize next entries in character's line, like "general" or "named character"...

    It seems I can't apply it, so it may be that it doesn't work at all. But it would be good to know whether someone more experienced in scripting got it actually to work.

    Does it work or not? Anyone?

    Under the patronage of m_1512

  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: The placement of units, Coded and Scripted - using various commands

    Sorry, should have checked properly before posting...
    Last edited by Gigantus; August 31, 2010 at 01:40 PM.










  4. #4

    Default Re: The placement of units, Coded and Scripted - using various commands

    This is my findings, per my opening post;

    campaign_script.txt entry example
    spawn_army
    faction faction_name, sub_faction faction_name
    character name, named character, family, age 32, x 290, y 134, portrait portrait_name, label label_name, battle_model battle_model_name, hero_ability hero_ability_name, direction (N,E,S,W)
    traits GoodCommander 3 , BattleScarred 2, BattleDread 1 , CaptorDread 1 , GoodAttacker 1 , NightBattleCapable 1
    unit unit_name exp 3 armour 1 weapon_lvl 0
    end


    but this is restricted to;
    faction slave, sub_faction faction_name

    campaign_script.txt entry example
    spawn_army
    faction slave, sub_faction faction_name
    character name, named character, family, age 32, x 290, y 134, portrait portrait_name, label label_name, battle_model battle_model_name, hero_ability hero_ability_name, direction (N,E,S,W)
    traits GoodCommander 3 , BattleScarred 2, BattleDread 1 , CaptorDread 1 , GoodAttacker 1 , NightBattleCapable 1
    unit unit_name exp 3 armour 1 weapon_lvl 0
    end


    I knew this restriction when posting my opening post, however i did not state it clearly enough;
    sub_faction faction_name is necessary for a slave faction army to spawn.
    what i should have said was;

    sub_faction faction_name is necessary for a slave faction army to spawn - but sub_faction only works for the slave faction

  5. #5
    wudang_clown's Avatar Fire Is Inspirational
    Join Date
    Jan 2009
    Location
    Poland
    Posts
    7,357

    Default Re: The placement of units, Coded and Scripted - using various commands

    An update after a long time:
    Quote Originally Posted by Archaon View Post
    what i should have said was;

    sub_faction faction_name is necessary for a slave faction army to spawn - but sub_faction only works for the slave faction
    The "sub_faction faction_name" doesn't work in campaign_script.txt, neither for slave nor for any other faction.

    I've checked it in many different ways, using many different models, as Broken Crescent nicely allows that, I'd even say I tested it in all possible ways. It works nicely in descr_strat.txt, true, but it doesn't work in campaign_script.txt. The only way to set appearance of specific rebel model at specific date in game is to place it normally via descr_strat.txt in some safe spot on the map, and then move it via script at specific date to desired location.

    Now, another question. It seems that this (questionable code marked in red):
    Quote Originally Posted by Archaon View Post
    sample use;
    descr_strat.txt entry example
    character name, named character, male, age 23, x 239, y 127, direction E
    traits GoodCommander 1 , NaturalMilitarySkill 1 , ReligionStarter 1
    army
    unit unit_name exp 0 armour 0 weapon_lvl 0
    unit unit_name exp 0 armour 0 weapon_lvl 0
    unit unit_name exp 0 armour 0 weapon_lvl 0
    unit unit_name exp 0 armour 0 weapon_lvl 0
    unit unit_name exp 0 armour 0 weapon_lvl 0
    unit unit_name exp 0 armour 0 weapon_lvl 0
    sieging
    siege_equipment ram 1
    siege_equipment tower 1
    siege_equipment ladder 1
    siege_equipment sap_point 1
    ...doesn't work as well, this time in descr_strat.txt. No matter what direction I choose, the general faces south. I've also tried "sieging, direction N" - with the same result.

    I hope I'm wrong, and I'd appreciate if someone have helped me.

    Under the patronage of m_1512

  6. #6
    Gorrrrrn's Avatar Citizen
    Join Date
    Jan 2007
    Location
    here
    Posts
    5,546

    Default Re: The placement of units, Coded and Scripted - using various commands

    found that the sub_faction determines the name of the officer in charge of a slave army if not otherwise allocated by script.

    in SS6.3 we had a area that accidentally had an kievan_rus sub_faction in Ireland.
    they got russian names for officers in charge.
    change the sub_faction to england and they got english names.

    it seems name is generated at random each time a slave unit or army moves?

  7. #7

    Default Re: The placement of units, Coded and Scripted - using various commands

    Quote Originally Posted by Rozanov View Post
    found that the sub_faction determines the name of the officer in charge of a slave army if not otherwise allocated by script.

    in SS6.3 we had a area that accidentally had an kievan_rus sub_faction in Ireland.
    they got russian names for officers in charge.
    change the sub_faction to england and they got english names.

    it seems name is generated at random each time a slave unit or army moves?
    Regarding the captain names, you are correct.
    But i cannot confirm for you the name generation per move, as i have never tested that.
    It seems logically unlikely but with the TW engine who knows...

  8. #8
    wudang_clown's Avatar Fire Is Inspirational
    Join Date
    Jan 2009
    Location
    Poland
    Posts
    7,357

    Default Re: The placement of units, Coded and Scripted - using various commands

    Sorry for not responding so long.

    Thank you all for explanations. I suspect the reason it doesn't work is some mistake in descr_model_strat.txt.

    I'm trying to figure it out.

    Thanks again!
    Last edited by wudang_clown; September 05, 2010 at 05:01 AM.

    Under the patronage of m_1512

  9. #9
    Gorrrrrn's Avatar Citizen
    Join Date
    Jan 2007
    Location
    here
    Posts
    5,546

    Default Re: The placement of units, Coded and Scripted - using various commands

    But i cannot confirm for you the name generation per move, as i have never tested that.
    It seems logically unlikely but with the TW engine who knows...
    With my perm fort mod I have watched a single unit move in and out of a fort and back again with a different captain name each time.
    (sometimes the AI will do that move up to 4 times as it decides whether to keep an army in a fort or not.)

  10. #10
    Agis Tournas's Avatar ★ Modder-at-Arms ★
    Join Date
    May 2008
    Location
    Athens, Hellas
    Posts
    1,714

    Default Re: The placement of units, Coded and Scripted - using various commands

    Is there a way that you could merge two units via script..?
    A mini-mod is never late! Nor is it ever early. It arrives precisely when I mean it to do!


    Son of Agisilaos / Grandson of jimkatalanos / Great-grandson of Garbarsardar





  11. #11

    Default Re: The placement of units, Coded and Scripted - using various commands

    Quote Originally Posted by Agis Tournas View Post
    Is there a way that you could merge two units via script..?
    No i don't think so.

  12. #12

    Default Re: The placement of units, Coded and Scripted - using various commands

    Excellent! this scipt was exactly what I was looking for

  13. #13

    Default Re: The placement of units, Coded and Scripted - using various commands

    A questions, I am fairly new to scripting so this may seem a bit obvious.

    If I wanted the siege to trigger at a historical event which code should I add?
    Last edited by sputnik; January 26, 2011 at 09:19 AM.

  14. #14
    /|\/|\/|\/|\/|\/|\/
    Join Date
    Jun 2005
    Posts
    10,770

    Default Re: The placement of units, Coded and Scripted - using various commands

    Script to be triggered by an historic event?:

    monitor_event EventCounter EventCounter blahblah = 1

  15. #15

    Default Re: The placement of units, Coded and Scripted - using various commands

    Great thanks.

  16. #16

    Default Re: The placement of units, Coded and Scripted - using various commands

    * moved to other thread *
    Last edited by sputnik; January 30, 2011 at 08:36 AM.

  17. #17
    w.wallace61's Avatar Civis
    Join Date
    May 2009
    Location
    Where Another Bagpipe is Being played :)
    Posts
    132

    Default Re: The placement of units, Coded and Scripted - using various commands

    Hi Archaon This topic is very useful for new bloods in scripting.. Especially for me to make an army siege settlement was becoming a real headache :/ So thank u very very much for your tutorial ) ı used it works great..
    So here comes my question you are using labels for characters..But when they are labeled they only spawn one time in the entire game..I'm trying to make real rebelling mod For SS..factions armies are spawning even after the faction is destroyed.. but whe ı use labels it happens only once.. is there a way to reset this.I dont want to give name to the characters... I dont want a rebellion always under the same guy because i lıke random_names.. It brings more realism If you can answer if it is possible to spawn an army several times with a labeled character i woul be very happy tnx again if ı manage to finish my mod your name will be on the top

  18. #18
    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: The placement of units, Coded and Scripted - using various commands

    You could test if the labeled character is still alive and then let a new alternatively labeled character spawn.










  19. #19
    w.wallace61's Avatar Civis
    Join Date
    May 2009
    Location
    Where Another Bagpipe is Being played :)
    Posts
    132

    Default Re: The placement of units, Coded and Scripted - using various commands

    Yea I tested it..Killed the character in a battle but no new character appeared..the label prevents any new spawning even if the character is killed... When I remove the label it works fine..but no cammand works for the character, because of their random name...There must be a way to reset the labeled character spawning to enable it to spawn again.

  20. #20
    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: The placement of units, Coded and Scripted - using various commands

    I think you are approaching it from the wrong angle.

    1. First make sure your monitor doesn't terminate.
    2. Put in an IF condition which tests if the character already exists
    3. Create a second monitor in case the first character still lives.

    create_counter new_spawn

    ;---regular spawn
    monitor_event ....
    condition .....
    IF character [labelname1] exists
    set_counter new_spawn 1
    end_if
    IF not character [label_name1] exists
    set_counter new_spawn 0
    spawn_army [label_name1]
    end_if
    end_monitor

    ;---alternate spawn
    monitor_event...
    I_CompareCounter new_spawn = 1
    spawn_army [label_name2]
    set_counter new_spawn 0
    end_monitor
    The whole lot obviously needs the correct commands and spelling.
    Last edited by Gigantus; February 12, 2011 at 09:24 PM.










Page 5 of 6 FirstFirst 123456 LastLast

Posting Permissions

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