Page 6 of 6 FirstFirst 123456
Results 101 to 112 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
    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

    Tnx a lot Gigantus I Started modding script for a week.. So dont know too much command or how to use them.. I will try These Commands..I tried '' set_counter'' commands in a simple way ,not worked again but not used ''IF'' condition so far. I must search how to use it properly first .. I hope yours work Thanks again Gigantus for your help..Most helpful.. and new questions may came again

  2. #2

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

    You also might wanna check out these threads:-
    alpaca's Script-O-Rama
    And TWC university look for scripting classes.

  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

    Could be because of the sap_point

    Edit: just tested - it works when spawning, but it doesn't in the descr_strat










  4. #4
    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
    Could be because of the sap_point
    No, I'm not using any siege "equipment", just "sieging" command...
    Quote Originally Posted by Gigantus View Post
    Edit: just tested - it works when spawning, but it doesn't in the descr_strat
    That's what I thought... Too bad.

    I guess the only thing one can do is to set all starting sieges on the north side of settlements, so it would look normally.

    Thanks for confirming this, Gigantus.

    Under the patronage of m_1512

  5. #5
    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

    One is glad to be of service










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

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

    +rep Archaon, this was really helpful.

    However, I can't seem to find any difference between using "sieging" and "end" in the campaign_script case. For me these two blocks have identical outcomes...
    Code:
        spawn_army 
        faction england
        character random_name, named character, age 32, x 290, y 134, label Invade_London, direction N
        unit unit_name        exp 3 armour 1 weapon_lvl 0
        unit unit_name        exp 3 armour 1 weapon_lvl 0
        unit unit_name        exp 3 armour 1 weapon_lvl 0
        unit unit_name        exp 3 armour 1 weapon_lvl 0
        sieging
        siege_settlement Invade_London, London, maintain
    
        spawn_army 
        faction england
        character random_name, named character, age 32, x 290, y 134, label Invade_London, direction N
        unit unit_name        exp 3 armour 1 weapon_lvl 0
        unit unit_name        exp 3 armour 1 weapon_lvl 0
        unit unit_name        exp 3 armour 1 weapon_lvl 0
        unit unit_name        exp 3 armour 1 weapon_lvl 0
        end
        siege_settlement Invade_London, London, maintain
    ..that is: in both cases the army sieges, and is just standing there if I remove the siege_settlement line.

    Am I missing something here? The position and direction are correct; I assume that the direction must be such that they are facing the settlement.

  7. #7
    Stylix's Avatar MOS Team Member
    Join Date
    Apr 2008
    Location
    Alabama, U.S.A.
    Posts
    2,263

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

    I am having trouble with the 'garrisoned_army' feature in the desc_strat.txt file. Here is my code:
    Spoiler for garrisoned_army

    Code:
     
    settlement
    {
     level town
     region Exeter_Province
     year_founded 0
     population 3000
     plan_set default_set
     faction_creator england
     garrisoned_army
     unit Archer Militia exp 0 armour 1 weapon_lvl 0
     unit Archer Militia exp 0 armour 1 weapon_lvl 0
     unit Spear Militia exp 0 armour 1 weapon_lvl 0
     unit Spear Militia exp 0 armour 1 weapon_lvl 0
     building
     {
      type core_building wooden_pallisade
     }
     building
     {
      type barracks town_watch
     }
     building
     {
      type market corn_exchange
     }
     building
     {
      type temple_catholic small_church
     }
     building
     {
      type smith leather_tanner
     }
     building
     {
      type hinterland_farms farms
     }
     building
     {
      type hinterland_roads roads
     }
    }

    The problem is the part of the code in red. If I omit it, the units appear and everything is fine, but if I try to improve the units with upgrades, it sends me back to the game selection menu.

    Any help would be greatly appreciated.
    MOS v1.6.2+ Bug fixer 30 Dec 2013

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

    What does it say in your log? Also are you using tabs or spaces between words?
    Last edited by Squid; July 02, 2011 at 04:18 PM.
    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

  9. #9
    Stylix's Avatar MOS Team Member
    Join Date
    Apr 2008
    Location
    Alabama, U.S.A.
    Posts
    2,263

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

    Quote Originally Posted by Squid View Post
    What does it say in your log? Also are you using tabs or spaces between words?
    I am using spaces. The last lines of my system log are (also attached whole log):
    Spoiler for system.log
    18:49:50.115 [game.script.trigger] [info] 002 triggers tested by event GeneralPrisonersRansomedCaptive
    18:49:50.115 [game.script.trigger] [info] 000 triggers tested by event BattleWinningPlaza
    18:49:50.115 [game.script.trigger] [info] 001 triggers tested by event PreBattleScrollAdviceRequested
    18:49:50.115 [game.script.trigger] [info] 001 triggers tested by event MultiTurnMove
    18:49:50.115 [game.script.trigger] [info] 000 triggers tested by event MessageClosed
    18:49:50.115 [game.script.trigger] [info] 004 triggers tested by event BrotherAdopted
    18:49:50.115 [game.script.trigger] [info] 001 triggers tested by event Demeanour
    18:49:50.115 [game.script.trigger] [info] 003 triggers tested by event AcquisitionMission
    18:49:50.115 [game.script.trigger] [info] 000 triggers tested by event ObjSeen
    18:49:50.115 [game.script.trigger] [info] 011 triggers tested by event IncomingMessage
    18:49:50.115 [game.script.trigger] [info] 000 triggers tested by event EventCounter
    18:49:50.116 [system.io] [info] exists: missing mods/kingdoms_grand_campaign_mod/preferences/player.txt

    Edit: I tried it with tabs after unit, <unit name>, exp etc. and the unit will appear, but with no upgrades.
    Last edited by Stylix; November 11, 2012 at 04:09 PM.
    MOS v1.6.2+ Bug fixer 30 Dec 2013

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

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

    Code:
    Line 55478: 18:49:45.415 [data.invalid] [error] World creation error: couldn't find unit description for unit type 'Archer Militia exp 0 armour 1 weapon_lvl 0'.
    Line 55478: 18:49:45.415 [data.invalid] [error] World creation error: couldn't find unit description for unit type 'Archer Militia exp 0 armour 1 weapon_lvl 0'.
    Is it possible that Archer Militia can't have armour upgrades?

    There's no mention of Spear Militia in the log but it could just be that the thing broke before it got to them. I would try swapping the order and see if it doesn't like the Spear Militia one either. If they're still not in the log then it's a problem only with the archers.

    Looking at an example that works... it uses the syntax:

    unit{tabs}Black Numenorians{tabs}exp 3 armour 1 weapon_lvl 0{line_feed}

    (Tabs only where it says "tabs"; the rest are spaces.)

  11. #11
    Stylix's Avatar MOS Team Member
    Join Date
    Apr 2008
    Location
    Alabama, U.S.A.
    Posts
    2,263

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

    @Withwnar

    Thank you for replying. I have tried your suggestion but it still will only create the unit, no upgrades. It seems that I can create the unit without any upgrades if I use tab after the unit name, but if a use a space it throws me back to the menu. I copied the code from another army that was placed by these lines of code:
    Code:
    character Christopher, general, male, age 34, x 162, y 231 
    army
    unit  Spear Militia    exp 0 armour 1 weapon_lvl 0
    unit  Spear Militia    exp 0 armour 1 weapon_lvl 0
    unit  Spear Militia    exp 0 armour 1 weapon_lvl 0
    unit  Archer Militia    exp 0 armour 1 weapon_lvl 0
    unit  Archer Militia    exp 0 armour 1 weapon_lvl 0
    This army appears correctly and has the upgrades. Maybe the garrison_army does not work with the latest version of M2TW and Kingdoms? Perhaps this is why I have it has not been used in this case. It seems like it would be easier to use since if you moved the settlement, the armies would follow and would not require the x,y coordinates or the creation of a 'dummy' general'.
    MOS v1.6.2+ Bug fixer 30 Dec 2013

  12. #12
    irishron's Avatar Cura Palatii
    Moderator Emeritus

    Join Date
    Feb 2005
    Location
    Cirith Ungol
    Posts
    47,023

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

    You move the settlement, you have to move the army yourself. I've had to more than a few times. The game engine is not as intuitive as you want to believe.

Page 6 of 6 FirstFirst 123456

Posting Permissions

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