Page 1 of 2 12 LastLast
Results 1 to 20 of 30

Thread: scripting randomize start garrison units+settlement ownership in a new campaign

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Userpro's Avatar =RAE= HostedMod Creator
    Join Date
    Jul 2008
    Location
    regno germanicum, teutonical forest
    Posts
    1,673

    Icon1 scripting randomize start garrison units+settlement ownership in a new campaign

    Someone with suggestions or ideas on, if and how it was possible to make a script that randomize the amount of garrison units (mostly Rebells) in the beginning of a new campaign? :hmmm:
    Last edited by Userpro; September 11, 2008 at 10:10 PM.
    Visit our TWC M2TW-Kingdoms Hosted Mods Forum for...

    !!! RAE Development stopped --- read last Statement here !!!
    M2TW-Kingdoms Mod Creator REDEO AD EXORDIUM ( RAE )
    Progress: 95% internal final beta release - 85% official release
    RAE TWC-Wiki Eagle Standard interview ... RAE.net Homepage ... RAE TWZ-Germany
    Proudly Sega & Steam Boycotter since ETW! See why here or this petition
    Sorry for bad english here, there and in my tutorials > advanced horde invasion & hide/unhide stratmap-ui & Beginners modding



  2. #2
    GrnEyedDvl's Avatar Liberalism is a Socially Transmitted Disease
    Artifex Technical Staff

    Join Date
    Jan 2007
    Location
    Denver CO
    Posts
    23,851
    Blog Entries
    10

    Default Re: scripting randomize start garrison units in a new campaign

    Sure, thats not hard at all, just long. Use the generate_random_counter command if you are using Kingdoms, use Alpacas fallthrough method if you are using M2. Both methods can be seen in this thread.


    Do a FactionTurnStart FactionIsLocal, create an if statement that includes the random selector and various armies for each settlement you want this to happen in.

  3. #3

    Default Re: scripting randomize start garrison units in a new campaign

    if you have kinhgdoms follow the british isles campaign script Edward crusade part this make use of randomized numbers.

    edit: to late i have been beat here.


  4. #4
    GrnEyedDvl's Avatar Liberalism is a Socially Transmitted Disease
    Artifex Technical Staff

    Join Date
    Jan 2007
    Location
    Denver CO
    Posts
    23,851
    Blog Entries
    10

    Default Re: scripting randomize start garrison units in a new campaign

    Quote Originally Posted by J@mes View Post
    edit: to late i have been beat here.

  5. #5
    Userpro's Avatar =RAE= HostedMod Creator
    Join Date
    Jul 2008
    Location
    regno germanicum, teutonical forest
    Posts
    1,673

    Default Re: scripting randomize start garrison units in a new campaign

    Thanks to both. The thread linked from GrnEyedDvl i remember i've read in the past. But i'm not beeing able to find it anymore with the search function.

    Seems to be simple to scripting this. Yes, there are many lines to write, but the most are copy & paste.

    if you have kinhgdoms follow the british isles campaign script Edward crusade part this make use of randomized numbers.
    Wouw, i didn't know that.
    Last edited by Userpro; September 08, 2008 at 06:00 PM.
    Visit our TWC M2TW-Kingdoms Hosted Mods Forum for...

    !!! RAE Development stopped --- read last Statement here !!!
    M2TW-Kingdoms Mod Creator REDEO AD EXORDIUM ( RAE )
    Progress: 95% internal final beta release - 85% official release
    RAE TWC-Wiki Eagle Standard interview ... RAE.net Homepage ... RAE TWZ-Germany
    Proudly Sega & Steam Boycotter since ETW! See why here or this petition
    Sorry for bad english here, there and in my tutorials > advanced horde invasion & hide/unhide stratmap-ui & Beginners modding



  6. #6
    Userpro's Avatar =RAE= HostedMod Creator
    Join Date
    Jul 2008
    Location
    regno germanicum, teutonical forest
    Posts
    1,673

    Default Re: scripting randomize start garrison units in a new campaign


    Please can anybody confirm (or not) that the command spawn_army not accept settlements coordinates? Even with the correct settlement coordinates, they spawn only one square near a settlement. In the example below they spawn on x188,y261!


    How can i activate a spoiler alert box here???

    EDIT:
    Okay i want explain me better (with my bad english). I hoped
    that with the command "spawn_army" i could not only randomize the unit amount of a garrison, but also randomize the faction owner of a settlement.
    To
    randomize the unit amount of a garrison the "create_unit London...." command work fine!
    But what about randomizing settlement ownership?

    Last edited by Userpro; September 11, 2008 at 10:08 PM.
    Visit our TWC M2TW-Kingdoms Hosted Mods Forum for...

    !!! RAE Development stopped --- read last Statement here !!!
    M2TW-Kingdoms Mod Creator REDEO AD EXORDIUM ( RAE )
    Progress: 95% internal final beta release - 85% official release
    RAE TWC-Wiki Eagle Standard interview ... RAE.net Homepage ... RAE TWZ-Germany
    Proudly Sega & Steam Boycotter since ETW! See why here or this petition
    Sorry for bad english here, there and in my tutorials > advanced horde invasion & hide/unhide stratmap-ui & Beginners modding



  7. #7

    Default Re: scripting randomize start garrison units in a new campaign

    Quote Originally Posted by userprobe View Post

    Please can anybody confirm (or not) that the command spawn_army not accept settlements coordinates? Even with the correct settlement coordinates, they spawn only one square near a settlement. In the example below they spawn on x188,y261!

    Spoiler Alert, click show to read: 
    generate_random_counter random_money 1 2
    if I_EventCounter random_money = 1
    spawn_army
    faction england
    character Garret, general, age 51, x 189, y 262
    unit Spear Militia exp 0 armour 1 weapon_lvl 0
    end
    end_if

    if I_EventCounter random_money = 2
    spawn_army
    faction england
    character Garret, general, age 51, x 189, y 262
    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 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
    end
    end_if

    How can i activate a spoiler alert box here???

    EDIT:
    Okay i want explain me better (with my bad english). I hoped
    that with the command "spawn_army" i could not only randomize the unit amount of a garrison, but also randomize the faction owner of a settlement.
    To
    randomize the unit amount of a garrison the "create_unit London...." command work fine!
    But what about randomizing settlement ownership?

    I heard around here somewhere from another modder that their had trouble spawning generals into settlements they ended up with some strange X and Y values the best thing is to use the create_unit like GED mentioned above.


  8. #8
    GrnEyedDvl's Avatar Liberalism is a Socially Transmitted Disease
    Artifex Technical Staff

    Join Date
    Jan 2007
    Location
    Denver CO
    Posts
    23,851
    Blog Entries
    10

    Default Re: scripting randomize start garrison units in a new campaign

    To use the spoiler type:

    [spoiler]This is the content of the spoiler[/spoiler]

    And it will look like this:
    Spoiler Alert, click show to read: 
    This is the content of the spoiler



    You have to use the create_unit to place a unit inside a city, like this:
    Code:
    create_unit London, Welsh Spearmen Mercs, num 2, exp 0, arm 0, wep 0
    You cannot use anything like this to determine the settlement owner. That is set in descr_strat.

  9. #9
    Userpro's Avatar =RAE= HostedMod Creator
    Join Date
    Jul 2008
    Location
    regno germanicum, teutonical forest
    Posts
    1,673

    Default Re: scripting randomize start garrison units in a new campaign

    Thanks for the spoiler tutorial!

    You have to use the create_unit to place a unit inside a city, like this:
    Yes, i've found that out, too.
    But can you realy confirm, that there is no way to change settlement ownership via script or randomize it in the descr_strat?
    Last edited by Userpro; September 10, 2008 at 02:12 AM.
    Visit our TWC M2TW-Kingdoms Hosted Mods Forum for...

    !!! RAE Development stopped --- read last Statement here !!!
    M2TW-Kingdoms Mod Creator REDEO AD EXORDIUM ( RAE )
    Progress: 95% internal final beta release - 85% official release
    RAE TWC-Wiki Eagle Standard interview ... RAE.net Homepage ... RAE TWZ-Germany
    Proudly Sega & Steam Boycotter since ETW! See why here or this petition
    Sorry for bad english here, there and in my tutorials > advanced horde invasion & hide/unhide stratmap-ui & Beginners modding



  10. #10
    Userpro's Avatar =RAE= HostedMod Creator
    Join Date
    Jul 2008
    Location
    regno germanicum, teutonical forest
    Posts
    1,673

    Default Re: scripting randomize -start garrison units/settlement ownership- in a new campaign

    The only idea i have at the moment is to assign a settlement as usual in the descr_strat without a garrison. Then via script randomizing how many garrison units to give to the owner, or giving them none, and placing another factions army near them, to take the empty settlement in the next turn.
    What you think about this solution?

    Example when assigned London as rebel settlement in descr_strat:
    Spoiler Alert, click show to read: 
    ;;;;;;;;;;;; random starting garrison - England-London ;;;;;;;;;;;;;;

    declare_counter random_garrison

    generate_random_counter random_garrison 1 5
    if I_EventCounter random_garrison > 3
    spawn_army
    faction england
    character Garret, general, age 51, x 189, y 262
    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 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
    end
    end_if

    if I_EventCounter random_garrison < 4
    create_unit London, Spear Militia, num 4, exp 1, arm 1, wep 2
    create_unit London, Archer Militia, num 2, exp 1, arm 1, wep 2
    end_if

    ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
    Last edited by Userpro; September 10, 2008 at 12:56 AM.
    Visit our TWC M2TW-Kingdoms Hosted Mods Forum for...

    !!! RAE Development stopped --- read last Statement here !!!
    M2TW-Kingdoms Mod Creator REDEO AD EXORDIUM ( RAE )
    Progress: 95% internal final beta release - 85% official release
    RAE TWC-Wiki Eagle Standard interview ... RAE.net Homepage ... RAE TWZ-Germany
    Proudly Sega & Steam Boycotter since ETW! See why here or this petition
    Sorry for bad english here, there and in my tutorials > advanced horde invasion & hide/unhide stratmap-ui & Beginners modding



  11. #11
    GrnEyedDvl's Avatar Liberalism is a Socially Transmitted Disease
    Artifex Technical Staff

    Join Date
    Jan 2007
    Location
    Denver CO
    Posts
    23,851
    Blog Entries
    10

    Default Re: scripting randomize -start garrison units/settlement ownership- in a new campaign

    Maybe. Use the siege command to tell them to attack.

  12. #12
    Userpro's Avatar =RAE= HostedMod Creator
    Join Date
    Jul 2008
    Location
    regno germanicum, teutonical forest
    Posts
    1,673

    Default Re: scripting randomize -start garrison units/settlement ownership- in a new campaign

    Wouw, this work perfectly! Great idea!!! +rep
    This was the start for the first (semi-)randomized campaign map!!! You know????
    Last edited by Userpro; September 10, 2008 at 02:13 AM.
    Visit our TWC M2TW-Kingdoms Hosted Mods Forum for...

    !!! RAE Development stopped --- read last Statement here !!!
    M2TW-Kingdoms Mod Creator REDEO AD EXORDIUM ( RAE )
    Progress: 95% internal final beta release - 85% official release
    RAE TWC-Wiki Eagle Standard interview ... RAE.net Homepage ... RAE TWZ-Germany
    Proudly Sega & Steam Boycotter since ETW! See why here or this petition
    Sorry for bad english here, there and in my tutorials > advanced horde invasion & hide/unhide stratmap-ui & Beginners modding



  13. #13
    Userpro's Avatar =RAE= HostedMod Creator
    Join Date
    Jul 2008
    Location
    regno germanicum, teutonical forest
    Posts
    1,673

    Default Re: scripting randomize start garrison units+settlement ownership in a new campaign

    Create_unit working fine, but only to spawn as garrison in a friendly settlement. spawn_army (even on enemy settlement coord. because thy spawn adjacment the settlement) with a following siege command, is it the proper and only way (from what i know) to conquer a ungarrised enemy settlement at the start of a campaign.
    Last edited by Userpro; September 10, 2008 at 05:02 PM.
    Visit our TWC M2TW-Kingdoms Hosted Mods Forum for...

    !!! RAE Development stopped --- read last Statement here !!!
    M2TW-Kingdoms Mod Creator REDEO AD EXORDIUM ( RAE )
    Progress: 95% internal final beta release - 85% official release
    RAE TWC-Wiki Eagle Standard interview ... RAE.net Homepage ... RAE TWZ-Germany
    Proudly Sega & Steam Boycotter since ETW! See why here or this petition
    Sorry for bad english here, there and in my tutorials > advanced horde invasion & hide/unhide stratmap-ui & Beginners modding



  14. #14

    Default Re: scripting randomize start garrison units+settlement ownership in a new campaign

    Quote Originally Posted by userprobe View Post
    Create_Army
    Create_Army is not a valid command.


  15. #15
    Userpro's Avatar =RAE= HostedMod Creator
    Join Date
    Jul 2008
    Location
    regno germanicum, teutonical forest
    Posts
    1,673

    Default Re: scripting randomize start garrison units+settlement ownership in a new campaign

    Quote Originally Posted by J@mes View Post
    Create_Army is not a valid command.
    Uppps, sorry i mean spawn_army!!!! EDITED
    Last edited by Userpro; September 10, 2008 at 05:03 PM.
    Visit our TWC M2TW-Kingdoms Hosted Mods Forum for...

    !!! RAE Development stopped --- read last Statement here !!!
    M2TW-Kingdoms Mod Creator REDEO AD EXORDIUM ( RAE )
    Progress: 95% internal final beta release - 85% official release
    RAE TWC-Wiki Eagle Standard interview ... RAE.net Homepage ... RAE TWZ-Germany
    Proudly Sega & Steam Boycotter since ETW! See why here or this petition
    Sorry for bad english here, there and in my tutorials > advanced horde invasion & hide/unhide stratmap-ui & Beginners modding



  16. #16

    Default Re: scripting randomize start garrison units+settlement ownership in a new campaign

    so your spawned army is not showing inside the settlement?


  17. #17
    Userpro's Avatar =RAE= HostedMod Creator
    Join Date
    Jul 2008
    Location
    regno germanicum, teutonical forest
    Posts
    1,673

    Default Re: scripting randomize start garrison units+settlement ownership in a new campaign

    No, it was only adjacent to the settlement. But with the following siege command it's inside, and the new ownership of settlement.
    Last edited by Userpro; September 10, 2008 at 02:25 PM.
    Visit our TWC M2TW-Kingdoms Hosted Mods Forum for...

    !!! RAE Development stopped --- read last Statement here !!!
    M2TW-Kingdoms Mod Creator REDEO AD EXORDIUM ( RAE )
    Progress: 95% internal final beta release - 85% official release
    RAE TWC-Wiki Eagle Standard interview ... RAE.net Homepage ... RAE TWZ-Germany
    Proudly Sega & Steam Boycotter since ETW! See why here or this petition
    Sorry for bad english here, there and in my tutorials > advanced horde invasion & hide/unhide stratmap-ui & Beginners modding



  18. #18

    Default Re: scripting randomize start garrison units+settlement ownership in a new campaign

    Quote Originally Posted by userprobe View Post
    No, it was only adjacent to the settlement. But with the following siege command it's inside, and the new ownership of settlement.
    have you checked for the correct X and Y?


  19. #19
    Userpro's Avatar =RAE= HostedMod Creator
    Join Date
    Jul 2008
    Location
    regno germanicum, teutonical forest
    Posts
    1,673

    Default Re: scripting randomize start garrison units+settlement ownership in a new campaign

    have you checked for the correct X and Y?
    spawn_army into coordinates of an enemy settlement, caused that they spawn adjacement to the settlement.
    Visit our TWC M2TW-Kingdoms Hosted Mods Forum for...

    !!! RAE Development stopped --- read last Statement here !!!
    M2TW-Kingdoms Mod Creator REDEO AD EXORDIUM ( RAE )
    Progress: 95% internal final beta release - 85% official release
    RAE TWC-Wiki Eagle Standard interview ... RAE.net Homepage ... RAE TWZ-Germany
    Proudly Sega & Steam Boycotter since ETW! See why here or this petition
    Sorry for bad english here, there and in my tutorials > advanced horde invasion & hide/unhide stratmap-ui & Beginners modding



  20. #20

    Default Re: scripting randomize start garrison units+settlement ownership in a new campaign

    Quote Originally Posted by userprobe View Post
    Spawn_Army into enemy settlement coordinates, caused that they spawn adjacement to the settlement.
    I have heard of this before so you will just have to use the create_unit command.


Page 1 of 2 12 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
  •