Page 2 of 6 FirstFirst 123456 LastLast
Results 21 to 40 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

    Default Re: The placement of units, Coded and Scripted. ## Using commands 'garrisoned_army / spawn_army' with siege_equipment! ## How to spawn a navy through scripts! ## How to spawn an agent through scripts

    Nice stuff but HouseofHam had already found out most stuff (for RTW though) :

    http://www.twcenter.net/forums/showt...21#post3803021
    http://www.twcenter.net/forums/showt...43#post3734343

    He also found out something bout ambush parameter , perhaps you could test that out in MTW2 ?

  2. #2
    Augustus Lucifer's Avatar Life = Like a beanstalk
    Patrician Citizen

    Join Date
    Aug 2006
    Location
    Mote of Dust
    Posts
    10,725

    Default Re: The placement of units, Coded and Scripted. ## Using commands 'garrisoned_army / spawn_army' with siege_equipment! ## How to spawn a navy through scripts! ## How to spawn an agent through scripts

    No need to despair, there's no mention of quite a few of the commands listed, and fortification as well as ambush have not been made to have appreciable effects, so there's still plenty of things to figure out. But that's helpful since it narrows down the things which need figuring.

    Oh, and do make sure to update your OP with the information in those threads, as it's easier when it's all in one central location rather than dispersed across Rome and M2 forums. I'm sure if we were to look on heavengames or a russian TW site we'd likely be rediscovering the wheel in some cases, that's the nature of people working in a bunch of places on the same thing in isolation. That should never stop us from trying to broaden our knowledge.
    Last edited by Augustus Lucifer; September 27, 2009 at 05:38 AM.

  3. #3
    Augustus Lucifer's Avatar Life = Like a beanstalk
    Patrician Citizen

    Join Date
    Aug 2006
    Location
    Mote of Dust
    Posts
    10,725

    Default Re: The placement of units, Coded and Scripted. ## Using commands 'garrisoned_army / spawn_army' with siege_equipment! ## How to spawn a navy through scripts! ## How to spawn an agent through scripts

    Does spawn_character accept script labels? I'm trying to figure out how to get names I can reference for agents without having the names factor into the 'names pool' for the faction.

    Or, alternatively, does anyone know of a so-called 'name trick'? This is gleaned from alpaca's City View script:
    Code:
    	; Catch settlement and spawn rebel with a unique name (male/female name trick) accordingly, then tell him to attack
    	if I_SettlementSelected Miccosukee
    		and not I_SettlementUnderSiege Miccosukee
            siege_settlement Primus Branka, Miccosukee, attack
    	end_if
    Primus appears to be a slave male name, and Branca a Portugese female name(the spawned agent is a slave named character). What's this about? Furthermore, is a name defined under slave used anywhere, or only when referenced like in the descr_strat or campaign_script?

  4. #4
    **Retired**
    Join Date
    Aug 2006
    Location
    Detroit, MI
    Posts
    2,365

    Default Re: The placement of units, Coded and Scripted. ## Using commands 'garrisoned_army / spawn_army' with siege_equipment! ## How to spawn a navy through scripts! ## How to spawn an agent through scripts

    Archaon,

    what versions of the game (reg/King) and patch did you test these scripts on?

    Good summary.

    (S)

  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 commands 'garrisoned_army / spawn_army' with siege_equipment! ## How to spawn a navy through scripts! ## How to spawn an agent through scripts

    Labelling: You van also label several characters with the same label and then use this. Example:

    In TATW they have several IF for a situation where an army gets spawned (armies of different factions). Each army's leader has a different name but the same label. In the Effect of the IF they have the labeled character then siege a settlement. - One skript only!










  6. #6

    Default Re: The placement of units, Coded and Scripted. ## Using commands 'garrisoned_army / spawn_army' with siege_equipment! ## How to spawn a navy through scripts! ## How to spawn an agent through scripts

    Hey guys, was playing around with some more things, and came up with one more step for this tutorial...

    The final step, to make this complex and more like a proper siege.
    At the end of this we will be able to make this spawned army wait another 2 turns after being spawned then attack, with the entire stack replenished.

    First lets check if the spawned character is still alive, if he is alive we check if he succeeded in the attack, if the settlement is not taken we check if he is still sieging or not, if he is not sieging we move him back and tell him to lay siege again.
    Code:
    monitor_event FactionTurnStart FactionType england
        and not I_SettlementOwner London = england
        and I_CharacterExists Invade_London
        if I_SettlementUnderSiege London
        siege_settlement Invade_London, London, maintain
        replenish_units Invade_London
        end_if
        if not I_SettlementUnderSiege London
        reposition_character Invade_London, 290, 134
        siege_settlement Invade_London, London, maintain
        replenish_units Invade_London
        end_if
    end_monitor
    Finally to ensure the army stays and attacks on the second turn we need to use a counter and increment it each turn.
    This is the full code using all the features described above;
    Code:
    declare_counter delayattack001
    monitor_event FactionTurnStart FactionType england
        and I_SettlementOwner London = france
        and not I_CharacterExists Invade_London
                spawn_army 
                faction england
                    character random_name, named character, family, age 32, x 290, y 134, label Invade_London, direction N
                    unit NE bodyguard       exp 0 armour 1 weapon_lvl 0
                    unit Levy Spearmen            exp 0 armour 1 weapon_lvl 0
                    unit Levy Spearmen           exp 0 armour 1 weapon_lvl 0
                    unit Levy Spearmen        exp 0 armour 1 weapon_lvl 0
                    sieging
            siege_settlement Invade_London, London, maintain
        set_counter delayattack001 1
    end_monitor
    
    monitor_event FactionTurnStart FactionType england
        if not I_SettlementOwner London = england
        and I_CharacterExists Invade_London
        if I_SettlementUnderSiege London
        and I_CompareCounter delayattack001 = 1
        siege_settlement Invade_London, London, maintain
        replenish_units Invade_London
        inc_counter delayattack001 1
        end_if
        if not I_SettlementUnderSiege London
        and I_CompareCounter delayattack001 = 1
        reposition_character Invade_London, 290, 134
        siege_settlement Invade_London, London, maintain
        replenish_units Invade_London
        inc_counter delayattack001 1
        end_if
        if I_SettlementUnderSiege London
        and I_CompareCounter delayattack001 > 1
        siege_settlement Invade_London, London, attack
        replenish_units Invade_London
        inc_counter delayattack001 1
        end_if
        if not I_SettlementUnderSiege London
        and I_CompareCounter delayattack001 > 1
        reposition_character Invade_London, 290, 134
        siege_settlement Invade_London, London, attack
        replenish_units Invade_London
        inc_counter delayattack001 1
        end_if
        end_if
        if I_SettlementOwner London = england
        and I_CompareCounter delayattack001 > 0
        set_counter delayattack001 0
        end_if
    end_monitor

  7. #7
    =NF= Vasileios_the2nd's Avatar Semisalis
    Join Date
    Sep 2008
    Location
    Athens.Greece
    Posts
    404

    Default Re: The placement of units, Coded and Scripted. ## Using commands 'garrisoned_army / spawn_army' with siege_equipment! ## How to spawn a navy through scripts! ## How to spawn an agent through scripts

    Some questions...
    1. Why are you talking about descr_strat? Is it the very same thing with campaign_script as well?
    2. The spawn navy part doesn't work properly when in campaign_script. Is it only meant to be used in descr_strat.

    Note that I am talking about the med2TW .exe vanilla and only this. Not the kingdoms.

    edit:
    And can "label" be used in campaign_script of vanilla med2?
    Last edited by =NF= Vasileios_the2nd; September 20, 2009 at 02:49 PM.
    "Greeks dont mod like modders, modders mod like greeks." -PorkyJack
    10 new captain models (campaign map) to download

  8. #8

    Default Re: The placement of units, Coded and Scripted. ## Using commands 'garrisoned_army / spawn_army' with siege_equipment! ## How to spawn a navy through scripts! ## How to spawn an agent through scripts

    no, descr_strat is a text file, CS allows scripting, the first alows an army to start the game seiging a settlement, the CS can do this and more!

    spawn navy works perfectly. check my sig. (code words for m2tw.exe also)
    Corsair Invasions mini-mod [TATW 1.2]

    everything can be used in vanilla, but the term vanilla refers to the game unmodded so as soon as you apply a script it is no longer vanilla..



  9. #9
    =NF= Vasileios_the2nd's Avatar Semisalis
    Join Date
    Sep 2008
    Location
    Athens.Greece
    Posts
    404

    Default Re: The placement of units, Coded and Scripted. ## Using commands 'garrisoned_army / spawn_army' with siege_equipment! ## How to spawn a navy through scripts! ## How to spawn an agent through scripts

    Quote Originally Posted by Archaon View Post
    no, descr_strat is a text file, CS allows scripting, the first alows an army to start the game seiging a settlement, the CS can do this and more!
    Yes, i was asking if everything that can be done with descr_strat, can also be done with CS.
    Ie, can I put all your OP examples that refer to descr_strat, into the CS and still work properly?


    spawn navy works perfectly. check my sig. (code words for m2tw.exe also)
    Corsair Invasions mini-mod [TATW 1.2]
    As you can see in this thread
    http://www.twcenter.net/forums/showthread.php?t=294687,
    I cannot get proper admirals and ship units on the original exe med2.
    I keep getting this, no matter what I try:


    And from what I see, you haven't done anything different than what I did:
    Code:
    spawn_army
                    faction        scotland
                    character    Lulach Cullane, admiral, age 42, x 30, y 307
                    unit        cog                exp 0 armour 0 weapon_lvl 0
                end
    What I am doing wrong here?

    everything can be used in vanilla, but the term vanilla refers to the game unmodded so as soon as you apply a script it is no longer vanilla..
    yea. I was trying to explain that I am not working on the kingdoms.exe, but on the original one, the medieval2.exe, which has some limitations, compared to the first.

    Thank you for any answer and your care.
    "Greeks dont mod like modders, modders mod like greeks." -PorkyJack
    10 new captain models (campaign map) to download

  10. #10

    Default Re: The placement of units, Coded and Scripted. ## Using commands 'garrisoned_army / spawn_army' with siege_equipment! ## How to spawn a navy through scripts! ## How to spawn an agent through scripts

    @=NF= Vasileios_the2nd,

    Sorry i have not had a chance to check this for you yet, i am sure it works like i explained.
    I have been busy checking PI beta, Helping Icedie with scripts, and maintaining DaC..

    Which lead me to continue my search into the kingdoms.exe..

    @gigantus, While looking into the .exe further i see possible options to use in the descr_strat or maybe in CS for spawn_army..

    we have these;
    ambush – set the spawn_army to ambush stance… or in the desc_strat make it ambush on first turn.
    sec_weapon – maybe used with weapon_lvl ???
    pri_weapon – as above.
    soldiers – if this is what I think it is! We can set a unit of 4 men to 1 man (quarter strength)!
    Level 1 – there is a 3 digit variable following, not sure what this is. Requires testing.
    quantity – might be related getting to siege_equiptment working in CS or it might be something completely unrelated to siege_equiptment…

    Also I see the section for spawn_army that tells you you need to have an army for the general and finish with ‘end’ then it has ‘none’ and ‘relative ‘ but this may relate to the descr_strat

    And to my amazement I see things I didn’t conceive possible!

    reinforcement_time
    supporting_armies
    no_withdraw
    battle_pos
    turns_owned

    Have no clue how to use them yet, but I am going to try everything I can think of !!!

  11. #11
    Augustus Lucifer's Avatar Life = Like a beanstalk
    Patrician Citizen

    Join Date
    Aug 2006
    Location
    Mote of Dust
    Posts
    10,725

    Default Re: The placement of units, Coded and Scripted. ## Using commands 'garrisoned_army / spawn_army' with siege_equipment! ## How to spawn a navy through scripts! ## How to spawn an agent through scripts

    Quote Originally Posted by Archaon View Post
    And to my amazement I see things I didn’t conceive possible!

    reinforcement_time
    supporting_armies
    no_withdraw
    battle_pos
    turns_owned

    Have no clue how to use them yet, but I am going to try everything I can think of !!!
    Keep in mind that the descr_strat has a lot in common with the descr_battle. I also saw those and a couple others, but they struck me as something which would go in a custom battle file. It's entirely possible they will work though.

    battle_pos reminded me of setting the location of the settlement with respect to where the playable map area is on the battle map. I recall something to this effect with custom tiles that didn't get resolved for M2.

    reinforcement_time might impact the time it takes in a siege before they appear, though it seems again rather weird outside of the context of a custom battle.

    Some other irregulars:

    card
    rand_seed
    settlement_tax
    triumph
    tile
    founding_faction
    capital

    Those may not all be lines but they were in a similar context, so worth a look. There's also plan_set and package_path which we know what does but aren't really well documented, and the former we have no idea how to change for M2 as far as I know.

  12. #12

    Default Re: The placement of units, Coded and Scripted. ## Using commands 'garrisoned_army / spawn_army' with siege_equipment! ## How to spawn a navy through scripts! ## How to spawn an agent through scripts

    Quote Originally Posted by Augustus Lucifer View Post

    Some other irregulars:

    card
    rand_seed
    settlement_tax
    triumph
    tile
    founding_faction
    capital

    Those may not all be lines but they were in a similar context, so worth a look. There's also plan_set and package_path which we know what does but aren't really well documented, and the former we have no idea how to change for M2 as far as I know.
    I saw 'some' of these but thought they not as notable.
    Capital could just be legacy code, also founding faction could be legacy as we know the faction owner in descr_strat can be different from the actual owner. tile i saw but couldn't place how to use it in my mind. settlement_tax i completely missed!

  13. #13
    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 commands 'garrisoned_army / spawn_army' with siege_equipment! ## How to spawn a navy through scripts! ## How to spawn an agent through scripts

    no_withdraw
    I thought this was in context with the EDU attributes = fight to the last man, no withdrawal\routing










  14. #14
    Augustus Lucifer's Avatar Life = Like a beanstalk
    Patrician Citizen

    Join Date
    Aug 2006
    Location
    Mote of Dust
    Posts
    10,725

    Default Re: The placement of units, Coded and Scripted. ## Using commands 'garrisoned_army / spawn_army' with siege_equipment! ## How to spawn a navy through scripts! ## How to spawn an agent through scripts

    Quote Originally Posted by gigantus View Post
    I thought this was in context with the EDU attributes = fight to the last man, no withdrawal\routing
    There's an EDU Attribute called can_withdraw, similar but not the same.

  15. #15

    Default Re: The placement of units, Coded and Scripted. ## Using commands 'garrisoned_army / spawn_army' with siege_equipment! ## How to spawn a navy through scripts! ## How to spawn an agent through scripts

    Have either of you Script Masters looked into RTW BI or ALEX.exe extensively? i no longer have any of these installed and am reluctant to install anything unnecessary on my system so close to an upgrade..
    I want to learn which of these are introduced in M2 or kingdoms.exe but not used..

  16. #16
    Augustus Lucifer's Avatar Life = Like a beanstalk
    Patrician Citizen

    Join Date
    Aug 2006
    Location
    Mote of Dust
    Posts
    10,725

    Default Re: The placement of units, Coded and Scripted. ## Using commands 'garrisoned_army / spawn_army' with siege_equipment! ## How to spawn a navy through scripts! ## How to spawn an agent through scripts

    I've not looked into either of them, but I don't think figuring out which are added and unused will necessarily help to pinpoint which will work. Remember triumph has been in since Rome and I've yet to find a use for it, it shows up in descr_regions, descr_triumphs, descr_sm_factions, and possibly descr_strat so the logical usage would have been a Civ-style victory where you pass a triumph threshold(like the three 'boundaries' in descr_triumphs), and each owned region as well as each defeated faction gives triumph points equal to their value, though there's been nothing to show it can actually be used.

  17. #17

    Default Re: The placement of units, Coded and Scripted. ## Using commands 'garrisoned_army / spawn_army' with siege_equipment! ## How to spawn a navy through scripts! ## How to spawn an agent through scripts

    there goes the wind from my sails..
    How come my TWC searches came up with no hits?..

  18. #18

    Default Re: The placement of units, Coded and Scripted. ## Using commands 'garrisoned_army / spawn_army' with siege_equipment! ## How to spawn a navy through scripts! ## How to spawn an agent through scripts

    I'll thoroughly look another time, right now i am summoned by the missus.
    I guess i'll have to speak to HoH as well, Never contacted him before..
    Thanks guys, g'Night.

  19. #19

    Default Re: The placement of units, Coded and Scripted. ## Using commands 'garrisoned_army / spawn_army' with siege_equipment! ## How to spawn a navy through scripts! ## How to spawn an agent through scripts

    Well , search isn't really good in TWC , so ..

    And you found out bout the fleets etc. , so you still have "wind on your sails"
    Last edited by Killerbee; September 27, 2009 at 06:34 AM. Reason: Major typo

  20. #20
    Augustus Lucifer's Avatar Life = Like a beanstalk
    Patrician Citizen

    Join Date
    Aug 2006
    Location
    Mote of Dust
    Posts
    10,725

    Default Re: The placement of units, Coded and Scripted. ## Using commands 'garrisoned_army / spawn_army' with siege_equipment! ## How to spawn a navy through scripts! ## How to spawn an agent through scripts

    The range of things being looked into is starting to exceed the scope of this tutorial, so it'd be better to do research in another thread and append any applicable things here.

    I've made a thread here, perhaps we should stick it in the non-tutorial Text Editing & Scripting and use it to discuss new discoveries and research into various files.

Page 2 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
  •