Page 1 of 8 12345678 LastLast
Results 1 to 20 of 142

Thread: *Update* 5-24-12 Sauron in Campaign & Sauron in Siege Battles. Now in single unit general format usable with own Strat Model

  1. #1
    Moneybags14's Avatar Ordinarius
    Join Date
    May 2010
    Location
    United States
    Posts
    709

    Default *Update* 5-24-12 Sauron in Campaign & Sauron in Siege Battles. Now in single unit general format usable with own Strat Model

    Ok, this thread is for those scripters/coders out there who are interested in trying to get a SINGLE UNIT of Sauron into the campaign on Huge settings. I have been working on it myself and have a sort of beta way of doing it but it doesn't work all the time, I am also new to scripting so I'm sure someone else could do better then me.


    OLD METHOD, cannot be used on characters!!!
    Spoiler Alert, click show to read: 
    Here is the coding for spawning Sauron in the campaign as a SINGLE model(thanks to Baron Samedi!)

    Post of Baron's Regarding the Matter
    Quote Originally Posted by Baron Samedi View Post
    Spoiler Alert, click show to read: 

    Code:
     
    monitor_event PreFactionTurnStart FactionType england
    and I_TurnNumber = 0
    create_unit Gorgoroth, Sauron Elephants, num 1, exp 2, arm 0, wep 0
    terminate_monitor
    end_monitor
    Screenshots of Sauron in Siege
    And here is the coding in the EDU for Sauron Able to be used in Sieges. (nevermind the stats, I have made him stronger)
    Spoiler Alert, click show to read: 
    Code:
    type             Sauron Elephants
    dictionary       Sauron_Elephants      ; "**"Sauron Elephants
    category         cavalry
    class            heavy
    voice_type       Heavy
    banner faction   main_cavalry
    banner holy      crusade_cavalry
    soldier          Elephant_Crew4, 6, 1, 1
    mounted_engine   elephant_serpentine
    mount            sauron
    attributes  very_hardy, frighten_foot, frighten_mounted
    formation  3, 3, 6, 6, 1, horde
    stat_health  15, 15
    ;stat_pri  0, 0, no, 0, 0, no, no, no, none, 0, 1
    stat_pri  1, 1, stone, 240, 2, missile, missile_mechanical, piercing, none, 0, 1 ; The projectile could be anything, I was just experimenting.
    stat_pri_attr  no 
    stat_sec  55, 25, no, 0, 0, melee, melee_simple, piercing, sword, 0, 1
    stat_sec_attr  launching, bp, ap, area
    stat_pri_armour  5, 5, 5, metal
    stat_sec_armour  27, 35, metal
    stat_heat  0
    stat_ground  0, 0, -5, 5
    stat_mental  18, disciplined, highly_trained, lock_morale
    stat_charge_dist 30
    stat_fire_delay  0
    stat_food  60, 300
    stat_cost  1, 3500, 1000, 500, 500, 3250, 1, 100000
    armour_ug_levels 4
    armour_ug_models Elephant_Crew4 ; This change prevents CTD from fire ballista
    ownership        england
    era 0            england
    era 1            england
    era 2            england


    FINAL method!!!
    Spoiler Alert, click show to read: 
    After a LONG time without doing anything with this, I decided to try and get an actual general into a single unit form on the battlefield. Meaning Sauron could actually have his strat_map model along with being a single soldier in fights. *Also balrog,treebeard etc...

    I believe I have finally gotten both to work fluently with each other. Alot of various different tries and many hours of research later, I present to you, the final necessary steps for having Sauron in the campaign for both humans and AI! Also, it is the edition that Sauron is not a ranged unit either so no ugly ammo bar.

    Here is the EDU that is necessary for this action, along with what I had in the campaign script to spawn him.

    EDU:
    Spoiler Alert, click show to read: 
    Code:
    type             Sauron Elephants
    dictionary       Sauron_Elephants      ; "**"Sauron Elephants
    category         cavalry
    class            heavy
    voice_type       Heavy
    banner faction   main_cavalry
    banner holy      crusade_cavalry
    soldier          Elephant_Crew4, 100, 1, 1
    mount            sauron
    attributes	 very_hardy, frighten_foot, frighten_mounted
    formation	 3, 3, 6, 6, 1, square
    stat_health	 1, 15
    stat_pri	 0, 0, no, 0, 0, no, no, no, none, 0, 1
    stat_pri_attr	 no
    stat_sec	 55, 25, no, 0, 0, melee, melee_simple, piercing, sword, 0, 1
    stat_sec_attr	 launching, bp, ap, area
    stat_pri_armour	 5, 5, 5, metal
    stat_sec_armour	 27, 35, metal
    stat_heat	 0
    stat_ground	 0, 0, -5, 5
    stat_mental	 18, disciplined, highly_trained, lock_morale
    stat_charge_dist 30
    stat_fire_delay	 0
    stat_food	 60, 300
    stat_cost	 1, 3500, 1000, 500, 500, 3250, 1, 100000
    armour_ug_levels 0
    armour_ug_models Elephant_Crew3
    ownership        england
    era 0            england
    era 1            england
    era 2            england


    Script: If you want to test. *This does not have sauron's strat model trait because I have done that in one other version of the mod and I cant find the file, and I don't feel like dealing with it.
    Spoiler Alert, click show to read: 
    Code:
    monitor_event FactionTurnStart FactionType england
    if I_TurnNumber = 1 ;note that this wont spawn sauron till turn 2
    
    				spawn_army
    				faction england
    				character	random_name, named character, age 18, x 262, y 126
    				traits LoyaltyStarter 1 , GoodCommander 1 ;doesn't matter if you dont use sauron strat model
    					unit		Sauron Elephants	soldiers 1	exp 0 armour 0 weapon_lvl 0
    				end
    end_if
    end_monitor


    *Note: I tested this up in multiple scenario's
    Leaving the character in a base for 20 turns, sauron starts with 100 numbers in the campaign card. However it is only 1 in fights. If Sauron gets into a fight and loses numbers(only happens in auto resolve) it raised the campaign numbers up to 77(77 seems to be the max for the mounted_engine line method also...)

    All had ONE SINGLE MODEL in actual fights regardless of what the unit card says in campaign. The unit card says 3 in fighting.

    The actual way I beat the hardcode was fighting it with another hardcode . So fight the power of hardcodes!


    P.S. Hopefully you guys will have fun with this, it's just a huge weight of my back to finally finish this deal



    *Note to self*
    "monitor_event FactionTurnEnd FactionType slave" is the moment right before replenishing bodyguard unit occurs
    Last edited by Moneybags14; August 11, 2012 at 07:27 PM. Reason: Finally put the correct way to do this in the first post.

  2. #2
    Dustindesrctin's Avatar Decanus
    Join Date
    Jul 2011
    Location
    Indiana, United States
    Posts
    512

    Default Re: Sauron in Campaign

    Hasn't this already been done by Baron and is in his submod and in MOS and released as a seperate submod?

  3. #3
    Moneybags14's Avatar Ordinarius
    Join Date
    May 2010
    Location
    United States
    Posts
    709

    Default Re: Sauron in Campaign

    I believe he uses Sauron in the campaign but I'm not sure if he got him down to 1 unit? I could be wrong though.

  4. #4
    Dustindesrctin's Avatar Decanus
    Join Date
    Jul 2011
    Location
    Indiana, United States
    Posts
    512

    Default Re: Sauron in Campaign

    Quote Originally Posted by Moneybags14 View Post
    I believe he uses Sauron in the campaign but I'm not sure if he got him down to 1 unit? I could be wrong though.
    Im pretty sure he does, and sorry I misread your post. I thought that you just added him to the campaign not attempting to change him to 1 unit also

  5. #5
    Moneybags14's Avatar Ordinarius
    Join Date
    May 2010
    Location
    United States
    Posts
    709

    Default Re: Sauron in Campaign

    Quote Originally Posted by Dustindesrctin View Post
    Im pretty sure he does, and sorry I misread your post. I thought that you just added him to the campaign not attempting to change him to 1 unit also
    Haha well I know he uses him in the campaign but he tells the users to play on small settings.

  6. #6

    Default Re: Sauron in Campaign

    In custom battles Sauron is unique, I guess it's because he is not general and he is not faction leader. We already have Sauron as the Dark Lord the Pope, with Baron Samedi we have him as general, he may easily be made faction leader for Mordor, the problem is the number of 'elephants' and the siege battles.

    We might perhaps spawn Sauron as battle unit, the one from custom battles, on the world map, under given conditions. Sauron-general in Barad Dûr would not be represented by Sauron's model... we might use for him a unit of Black Numenoreans, and for him personally the Black Numenorean model... in combination with the Sauron unit these two would make the real Sauron, completed by the Dark Lord in SHOULD NOT BE SEEN. We would have a single figure of Sauron on the battlefield, independent from his bodyguard... Not sure what this solution would lead to with the AI, but it could be scripted in a different way for it. We'd change UI icon for the general (we might use the Eye motive for example), keep the Sauron's portrait for the unit... it might work even for huge size units ?

    ?

    And another idea : when the ring gets destroyed and Mordor surrenders it's regions (like in the custom campaign), we might change the religion of the other surviving evil faction to something else, not followers of Melkor, so the Dark Lord wold loose all his influence on them...

  7. #7
    Senator
    Join Date
    Dec 2008
    Location
    Finland
    Posts
    1,055

    Default Re: Sauron in Campaign

    I think some time ago someone made Sauron and Barlog recruitable from building and with original TATW single man settings (custom battles) and even in huge they appeared as single man in campaign.

    I haven't tried it myself so I can't say if it really work but you might want to do some investigations on this

    Also those who tried this said that the problem was when you script unit to spawn with single man script it wouldn't work and he would appear with multiple man in unit.

  8. #8

    Default Re: Sauron in Campaign

    There is some black magic in that... in custom battle unit selection it says those elephants are 6, in battle they are 3 (one figure), and in campaign they are 9 (3 figures)... huge size for custom and for the campaign.

    If we could set the coefficients for small/normal/large/huge size units to 1 for all of them and get the numbers in EDU real for all units, removing the unit size selection effect... but as this is not done, it is probably not possible

    If I change the number of soldiers to 5 in EDU, I get two figures and there are 6 soldiers on the unit card... when they are 6 in EDU, there is 1 figure, and the unit card says there are 3 soldiers. This really is some sort of Morgul magic that a mortal man cannot understand...

    Edit: it seems there is a conflict between the Sauron Elephants and Germanicu5 script, I get a long list of these in my log :

    13:11:37.286 [game.script] [error] Script execution error for <label_unit>, at line 3226, in mods/Third_Age/data/world/maps/campaign/imperial_campaign/campaign_script.txt:
    label_unit referenced non-existent unit

    ending with 13:11:37.382 [game.script] [error] Script execution error for <set_counter>, at line 3359, in mods/Third_Age/data/world/maps/campaign/imperial_campaign/campaign_script.txt:
    Counter label_ready doesn't exist

    Edit2 : it seems the script problem is off... with v5.0 beta
    Last edited by Adjudant-Major; September 19, 2011 at 06:44 AM.

  9. #9
    Baron Samedi's Avatar Citizen
    Join Date
    Apr 2009
    Location
    The Netherlands
    Posts
    1,414

    Default Re: Sauron in Campaign

    It has been some time since I worked on the Sauron project, but here are some small remarks:

    You can use Sauron in different ways in your campaign:

    In my submods compilation
    How:General = named character
    Name:Sauron
    Portrait:Sauron
    Strat map model:Sauron
    Possible to track/edit in campaign via scripts:Yes
    Number of units on huge unit settings:>1

    Recruitable in campaign
    How:General = named character
    Name:Random name
    Portrait:Random character
    Strat map model:Captain
    Possible to track/edit in campaign via scripts:no
    Number of units on huge unit settings:>1

    Recruitable in campaign
    How:normal unit
    Name:Random captain name
    Portrait:None
    Strat map model:Captain
    Possible to track/edit in campaign via scripts:no
    Number of units on huge unit settings:1

    Btw: custom battles v.s. campaign are two entirely different things. The engine is unfortunately just not build for 1-man units. For those of you saying: ''but you have him as a single unit for RTW'', I can say the following: not all features from RTW are incorporated into M2TW.
    Last edited by Baron Samedi; September 19, 2011 at 06:43 AM. Reason: spelling
    Under the patronage of MasterBigAb

  10. #10

    Default Re: Sauron in Campaign

    Recruitable in campaign as normal unit, that's what I would like to work with. The problem is that I still get 3 figures of Sauron in the unit. For initial testing I've just put him in the descr_strat

    Possible to track/edit in campaign via scripts:no
    But we should still be able to spawn him and to kill him I think, right ?
    Last edited by Adjudant-Major; September 19, 2011 at 06:50 AM.

  11. #11
    Baron Samedi's Avatar Citizen
    Join Date
    Apr 2009
    Location
    The Netherlands
    Posts
    1,414

    Default Re: Sauron in Campaign

    Quote Originally Posted by Adjudant-Major View Post
    Recruitable in campaign as normal unit, that's what I would like to work with. The problem is that I still get 3 figures of Sauron in the unit. For initial testing I've just put him in the descr_strat
    Just add another recruitmentpool-line in EDB (export_descr_buildings.txt in:...\Medieval II Total War\mods\Third_Age\data).

    Example: I made Sauron recruitable (for one time) through Barad Dur:
    Spoiler Alert, click show to read: 

    Code:
    building barad
    {
        levels barad 
        {
            barad castle requires factions { england, }  and hidden_resource barad_dur
            {
                capability
                {
                    law_bonus bonus 2
                    tower_level 2
                    retrain_cost_bonus bonus 2
    recruit_pool "Sauron Elephants"  1   0.00001   1  0  requires factions { england, }  and region_religion catholic 15
                }
                material wooden
                construction  15
                cost  16000
                settlement_min large_city
                upgrades
                {
                }
            }
        }
        plugins 
        {
        }
    }

    Look at the screenshots for proof.

    But we should still be able to spawn him and to kill him I think, right ?
    As a matter of fact: yes. You can use this command for instance in the campaign script:
    Spoiler Alert, click show to read: 

    Code:
    destroy_units england Sauron Elephants

    Under the patronage of MasterBigAb

  12. #12

    Default Re: Sauron in Campaign

    Sure... the thing is I don't want to make him recruitable, I want to spawn him when specific conditions are met, and kill him when other conditions are met, and I think it's possible and not difficult. But that's not the point, the point is that even if I add him to my campaign as a normal unit, I get the strenght of the unit (at huge size) 9, and as each of the elephants is ridden by three riders, I see three elephants in battle

    You said their number should be 1 in this case, and I see you have the strenght of 3 and 1 figure. What are the stats of your Sauron Elephants than ? If you add those Sauron Elephants of yours to the descr_strat, to an already existing army of a general, so you begin the campaing with them, do you still get the strenght of three ?
    Last edited by Adjudant-Major; September 19, 2011 at 08:11 AM.

  13. #13
    Baron Samedi's Avatar Citizen
    Join Date
    Apr 2009
    Location
    The Netherlands
    Posts
    1,414

    Default Re: Sauron in Campaign

    Quote Originally Posted by Adjudant-Major View Post
    Sure... the thing is I don't want to make him recruitable, I want to spawn him when specific conditions are met, and kill him when other conditions are met, and I think it's possible and not difficult. But that's not the point, the point is that even if I add him to my campaign as a normal unit, I get the strenght of the unit (at huge size) 9, and as each of the elephants is ridden by three riders, I see three elephants in battle
    I can confirm this with the following script:
    Spoiler Alert, click show to read: 

    Code:
    monitor_event PreFactionTurnStart FactionType england
     and I_TurnNumber = 0
     spawn_army 
     faction england
     character Sauron, general, age 28, x 244, y 126
       unit Sauron Elephants  exp 1 armour 0 weapon_lvl 0
     end
    terminate_monitor
    end_monitor
     
    monitor_event PreFactionTurnStart FactionType england
     and I_TurnNumber = 1
     destroy_units england Sauron Elephants
    terminate_monitor
    end_monitor

    See screenshots.

    You said their number should be 1 in this case, and I see you have the strenght of 3 and 1 figure. What are the stats of your Sauron Elephants than ? If you add those Sauron Elephants of yours to the descr_strat, to an already existing army of a general, so you begin the campaing with them, do you still get the strenght of three ?
    No I clearly explained a recruitable Sauron (through EDB) is a one-man unit not a spawnable Sauron (through script). Reason must be game limitations. EDU-stats of Sauron are the same as vanilla.
    Under the patronage of MasterBigAb

  14. #14

    Default Re: Sauron in Campaign

    I see it also now... a recruitable Sauron stays at 3 with 1 figure, a spawned Sauron gets to 6 (with 2 riders and 4 soldiers in the unit) or 9 (with 3 riders and 6 soldiers) both resulting in 3 figures.

    What the hell... I don't think this happens to any other unit, we may spawn units at their given strengts or recruit them, there's no difference.

    But fine... let's make him recruitable with an event_counter, and we may have another event_counter that will disable his recruitement... I hope so basically, my idea with 3 Saurons in the game might be tested now : 1st Sauron = The Dark Lord, the pope, 2nd Sauron = Faction leader of Mordor with proper portrait and name, with his mace ancillary, etc., locked in Barad Dûr, with his strat model, and with a battle model of a Black Numenorean, 3rd Sauron - recruitable once the Ring is acquired by the 2nd Sauron.

    The problem is that we are unable to remove the 2nd Sauron from the map once the 3rd Sauron gets killed. We only may remove the 3rd Sauron, once the 2nd Sauron gets killed. It's still better than nothing... not 100% great, but 75% perhaps ?

  15. #15
    Baron Samedi's Avatar Citizen
    Join Date
    Apr 2009
    Location
    The Netherlands
    Posts
    1,414

    Default Re: Sauron in Campaign

    I did some more testing and it seems I can produce a different outcome if I change the script a bit. Here it goes:
    Spoiler Alert, click show to read: 

    monitor_event PreFactionTurnStart FactionType england
    and I_TurnNumber = 0
    create_unit Gorgoroth, Sauron Elephants, num 1, exp 2, arm 0, wep 0
    terminate_monitor
    end_monitor

    This will make Sauron spawn in Barad Dur. He turns out to be a one-man unit. Try it. Proof is in screenshots.
    Under the patronage of MasterBigAb

  16. #16

    Default Re: Sauron in Campaign

    now THIS is what we needed... I suppose you don't have any better idea how to link the 2nd and the 3rd Sauron to make the 2nd one removed if the 3rd one gets killed...

  17. #17
    Baron Samedi's Avatar Citizen
    Join Date
    Apr 2009
    Location
    The Netherlands
    Posts
    1,414

    Default Re: Sauron in Campaign

    Quote Originally Posted by Adjudant-Major View Post
    now THIS is what we needed... I suppose you don't have any better idea how to link the 2nd and the 3rd Sauron to make the 2nd one removed if the 3rd one gets killed...
    I searched docudemon quickly and I found the following condition: ''I_UnitExists''. The only thing we are absolutely sure about regarding the 3rd Sauron, is that it will be always the same unit type that gets spawned (Sauron Elephants). The name on the campaign map will appear randomly as I explained earlier.

    So we can let the game search for this specific unit type constantly (after a certain counter --> ring acquired) and once our 3rd Sauron dies, we can use the destroy-script (the one I demonstarted earlier in this thread) to kill the 2nd Sauron. This means you will have to create another unit entry in EDU, so that the two Sauron's don't share the same entry. If it is too complicated for you, I can demonstrate it later in this thread with some screenshots.
    Under the patronage of MasterBigAb

  18. #18

    Default Re: Sauron in Campaign

    2nd Sauron is named character, so he can be killed or sent off map, there's no problem... I_UnitExists is exactly what we need to do it ...in combination with other conditions of course.

    We don't need any special unit entry in EDU, as the 2nd Sauron is not going to have any elephants

    Theoretically I see only one problem for the AI - it won't keep both Saurons (2nd and 3rd) in the same stack. Two solutions : 1) we don't care 2) AI won't have the 2nd Sauron, it's faction leader will be the Witch King... when the AI acquired the One Ring, it would 'only' get the 3rd Sauron... (in a much easier way than a human player... no delivery of the Ring to Barad Dûr, as the AI would not make it I think )
    Last edited by Adjudant-Major; September 19, 2011 at 10:05 AM.

  19. #19

    Default Re: Sauron in Campaign

    The AI is retarded, plan the use of this MOD for the player and leave the retarded AI to play as it will
    You can drop humans anywhere and they'll thrive-only the rat does as well.Jeannette Desor

    Man in Black: [as he is unsuccessfully fighting Fezzik] Look, are you just fiddling around with me or what?
    Fezzik: I just want you to feel you're doing well. I hate for people to die embarrassed.

  20. #20
    Moneybags14's Avatar Ordinarius
    Join Date
    May 2010
    Location
    United States
    Posts
    709

    Default Re: Sauron in Campaign

    wow! I was not expecting 2 scripters to respond so quickly! Especially you Baron

    My hope from this thread looks like it will be able to come true(in a certain way) using certain conditions/commands.

    Glad you found out that create_unit command only spawns 1 sauron baron good stuff. This definately looks like the legit way to spawn sauron with conditions.

    Rep to both of you for contributing to this discussion while I was sleeping

Page 1 of 8 12345678 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
  •