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

Thread: Can we put Kings and Generals on Trial ?

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Gorrrrrn's Avatar Citizen
    Join Date
    Jan 2007
    Location
    here
    Posts
    5,546

    Default Can we put Kings and Generals on Trial ?

    In my 2TPY/all town/PSF mod for latest RC/RR for SS6 I've created four Government buildings.

    Of those, one is Parliament and another The Law Courts.

    We all know the grief that having Kings with offend the nobility give and how, annoying having rebel generals are in ones own faction. So perhaps we can have a legal way of getting rid of them.

    I would like to create some form of interactive event which gives the human player the choice of whether to put king who has Offensive2 trait or general with trait Disobedient2 on trial at the Law Courts.

    Now I'm still at learning stage for coding this so if anyone has ways of implementing this do post.
    If the project is finished we can stick in tutorials or make it a mini-mod for general usage.

    These would be for the human player only. (er as interactive events they'd have to be.)

    --

    I understand there is a way of selecting a character based on a trait:
    CharacterSelected Disobedient2

    and the FactionLeader is well, the faction leader.

    I presume if we monitor the FactionLeader every turn with a
    IsPlayerLocal = 1
    Is FactionLeader Disobedient2 (or whatever it should be)
    we can generate an event "King_on_Trial"
    (need to do text and picture etc)

    do an event_counter kingontrial = 1
    and increment it so next turn

    event_counter
    kingontrial = 2

    we have the result:

    random 20

    King executed for treason
    kill_character FactionLeader

    (new FL would be chosen and all the gubbins with ancilliaries sorted out.)

    or King found not guilty and the trait Offensive2 is reset to Offensive0

    Perhaps enclosed in some form of monitor that checks when FactionLeader first gets the trait and waits a random number of turns before deciding to have a trial.

    -------------------------------------------------------

    As for Generals perhaps something similar triggered by king first getting Offensive2.

    once triggered any general with Disobedient2 gets put on trial
    (don't know if the command CharacterSelected Disobedient2
    collects everyone with it, or just the first?)

    Rather than faff around the interactive part would be a simple Y/N -
    do you want to put this general on trial for treason?

    there's a chance 50 that said general gets the kill_character treatment.
    If found not guilty, he gets the Disobedient2 reset to Obedient1

    if found guilty he gets the chop.
    (or maybe exile to some remote island?)

    Need to rest counter when king no longer has trait?
    ----------------------------------------------------------

    That's about as far as I've got so far.
    I've no idea if it's do-able.
    I don't expect other people to do everything, but a nudge or two in the right direction would be appreciated. (if only to say - no can do.)

  2. #2
    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: Can we put Kings and Generals on Trial ?

    kill_character FactionLeader
    That's were the problem is = you need a name for the kill_character command.










  3. #3
    Germanicu5's Avatar Will buy spare time...
    Join Date
    Feb 2009
    Location
    Not Zee Germany
    Posts
    2,101

    Default Re: Can we put Kings and Generals on Trial ?

    I haven't tested it, but what if we had an event that exports character record and used "e_select_character" and then "kill_character this" ?

    Regards
    I have no memory of this place.

  4. #4
    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: Can we put Kings and Generals on Trial ?

    worth a try, no idea if it would work.










  5. #5
    Germanicu5's Avatar Will buy spare time...
    Join Date
    Feb 2009
    Location
    Not Zee Germany
    Posts
    2,101

    Default Re: Can we put Kings and Generals on Trial ?

    It sounded all too easy, it doesn't work.

    @Roz
    Maybe you can just emulate it by adding terrible negative attributes connected to traits (like -zillion command etc) - you can check Byg's defied orders for reference.

    Regards
    Last edited by Germanicu5; February 06, 2010 at 07:29 AM.
    I have no memory of this place.

  6. #6
    Swagger's Avatar Imperial Coffee-Runner
    Join Date
    Apr 2007
    Location
    Portugal
    Posts
    12,453

    Default Re: Can we put Kings and Generals on Trial ?

    the kill_character command requires the character export, meaning it's name or the label
    Under the Patronage of the Dreadful cedric37!
    Ancs Guide, Emergent Factions , Yes/No Events |L'Outremer for Modders| Swagger's Skymod


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

    Default Re: Can we put Kings and Generals on Trial ?

    tx for comments -been busy with the main mod.

    will get back to this tomorrow.

    all still rather new territory.

  8. #8

    Default Re: Can we put Kings and Generals on Trial ?

    Can you give each faction leader of the player's faction a label?
    Morning Sun (adds Korea and China to the Shogun 2 map)
    http://www.twcenter.net/forums/forum...28-Morning-Sun

    Expanded Japan mod (97 new regions and 101 new factions)
    http://www.twcenter.net/forums/showt...ew-factions%29

    How to split a region in TWS2
    http://www.twcenter.net/forums/showt...split-a-region

    Eras Total Conquest 2.3 (12 campaigns from 970-1547)

  9. #9
    konny's Avatar Artifex
    Join Date
    Jul 2007
    Location
    Germania Inferior
    Posts
    3,631

    Default Re: Can we put Kings and Generals on Trial ?

    ASFAIK, there is no command to label a character; so: No.

    Team member of: Das Heilige Römische Reich, Europa Barbarorum, Europa Barbarorum II, East of Rome
    Modding help by Konny: Excel Traitgenerator, Setting Heirs to your preference
    dHRR 0.8 beta released! get it here
    New: Native America! A mini-mod for Kingdoms America

  10. #10
    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: Can we put Kings and Generals on Trial ?

    You can only give labels through the script when a character gets spawned.










  11. #11
    Opifex
    Join Date
    Feb 2005
    Location
    New York, USA
    Posts
    15,154

    Default Re: Can we put Kings and Generals on Trial ?

    However, you can make an auxiliary script, which kills the new faction leader and generates another one but with a label (e.g. EnglandFactionLeader).


    "If ye love wealth greater than liberty,
    the tranquility of servitude greater than
    the animating contest for freedom, go
    home from us in peace. We seek not
    your counsel, nor your arms. Crouch
    down and lick the hand that feeds you,
    and may posterity forget that ye were
    our countrymen."
    -Samuel Adams

  12. #12
    konny's Avatar Artifex
    Join Date
    Jul 2007
    Location
    Germania Inferior
    Posts
    3,631

    Default Re: Can we put Kings and Generals on Trial ?

    But how would you kill the old one without label?


    Another thing: Has anyone so far worked with spawning heirs and leaders for a faction with a "Teutonic" family tree (i.e. without tree)?

    Team member of: Das Heilige Römische Reich, Europa Barbarorum, Europa Barbarorum II, East of Rome
    Modding help by Konny: Excel Traitgenerator, Setting Heirs to your preference
    dHRR 0.8 beta released! get it here
    New: Native America! A mini-mod for Kingdoms America

  13. #13

    Default Re: Can we put Kings and Generals on Trial ?

    I'm setting up a Teutonic tree for a couple factions in the Frontier, but I've not really worked much with it yet. What specifically did you need to know?
    Son of PW

  14. #14
    konny's Avatar Artifex
    Join Date
    Jul 2007
    Location
    Germania Inferior
    Posts
    3,631

    Default Re: Can we put Kings and Generals on Trial ?

    Quote Originally Posted by Theodotos I View Post
    I'm setting up a Teutonic tree for a couple factions in the Frontier, but I've not really worked much with it yet. What specifically did you need to know?
    The idea is to split a larger faction into a "Parent Faction" and a "Child Faction". The "Parent" would have a normal family tree, while the "Child" would have a Teutonic family tree. The faction leader of the "Child" would be someone who was sent there from the "Parent". In our example I wish to split the Rus into Kiev, as "Parent" and Novgorod as "Child", with the Prince of Novgorod being someone who was sent to the north from Kiev.

    To simulate that, I thought of spawning a character for faction Novgorod with the Heir- or Leader-Tag. While that would be possible technically, the question would be how that would work for the game?

    Team member of: Das Heilige Römische Reich, Europa Barbarorum, Europa Barbarorum II, East of Rome
    Modding help by Konny: Excel Traitgenerator, Setting Heirs to your preference
    dHRR 0.8 beta released! get it here
    New: Native America! A mini-mod for Kingdoms America

  15. #15
    Opifex
    Join Date
    Feb 2005
    Location
    New York, USA
    Posts
    15,154

    Default Re: Can we put Kings and Generals on Trial ?

    Quote Originally Posted by konny View Post
    But how would you kill the old one without label?
    Something like this:

    CharacterTurnStart IsFactionLeader

    e_select_character
    "do something to kill him", e.g. "kill_character this" or something else

    end


    "If ye love wealth greater than liberty,
    the tranquility of servitude greater than
    the animating contest for freedom, go
    home from us in peace. We seek not
    your counsel, nor your arms. Crouch
    down and lick the hand that feeds you,
    and may posterity forget that ye were
    our countrymen."
    -Samuel Adams

  16. #16
    konny's Avatar Artifex
    Join Date
    Jul 2007
    Location
    Germania Inferior
    Posts
    3,631

    Default Re: Can we put Kings and Generals on Trial ?

    Quote Originally Posted by SigniferOne View Post
    Something like this:

    CharacterTurnStart IsFactionLeader

    e_select_character
    "do something to kill him", e.g. "kill_character this" or something else

    end
    I thought "kill_character" does not work in conjunction with "this"?

    Anyways, e_select is rather tricky to use because it might be superseded by physical selcetion, for example a character the player had selected when hitting EndTurn.

    Team member of: Das Heilige Römische Reich, Europa Barbarorum, Europa Barbarorum II, East of Rome
    Modding help by Konny: Excel Traitgenerator, Setting Heirs to your preference
    dHRR 0.8 beta released! get it here
    New: Native America! A mini-mod for Kingdoms America

  17. #17
    Germanicu5's Avatar Will buy spare time...
    Join Date
    Feb 2009
    Location
    Not Zee Germany
    Posts
    2,101

    Default Re: Can we put Kings and Generals on Trial ?

    I'm always too lazy to post this "find", because I wanted to write a tutorial first, I actually managed to produce a properly working script back in February.

    I was able to create a character-name-based script that works for player's faction and settlements. Since it was inspired by Roz's idea, a simplified version puts kings on trial, kills characters suspected of betrayal and puts units in chosen settlements, it can also give traits to some characters or remove them. It's also no problem to send character off map in this case.

    The script uses all character names available in a mod, so it's large.

    It's an integral part of my Interactive Gameplay Mod for TATW 2.1.

    Thread HERE.

    Code inside attached txt file.

    Main part:
    Spoiler Alert, click show to read: 

    monitor_event CharacterTurnStart CharacterIsLocal ;just one of possible monitors, more in .txt file
    and I_EventCounter no_trial = 0
    and IsFactionLeader
    and Attribute Authority < 5

    set_counter transgression_trial 1
    end_monitor

    monitor_conditions I_CompareCounter transgression_trial = 1

    set_counter transgression_trial 0

    if I_NumberOfHeirs byzantium > 1
    and I_LocalFaction byzantium
    inc_event_counter put_on_trial 2
    set_event_counter fire_trial 1
    historic_event king_trial_rumours
    end_if
    ;other factions underneath
    end_monitor

    monitor_event CharacterSelected CharacterIsLocal
    and I_EventCounter fire_trial = 1
    and IsFactionLeader
    and CharacterAge >= 24

    if I_EventCounter no_instigator = 0
    and RandomPercent < 34
    historic_event kill_instigator true
    set_event_counter fire_trial 0
    end_if

    if I_EventCounter fire_trial = 1
    if I_EventCounter put_on_trial < 5
    and RandomPercent < 10
    set_counter apply_command 1
    set_event_counter kill_him 1
    set_event_counter put_on_trial 0
    historic_event king_executed
    set_event_counter no_instigator 0
    end_if

    if I_EventCounter put_on_trial > 4
    and RandomPercent < 15
    set_counter apply_command 1
    set_event_counter kill_him 1
    set_event_counter put_on_trial 0
    historic_event king_executed
    set_event_counter no_instigator 1
    end_if
    set_event_counter fire_trial 0
    end_if
    end_monitor

    monitor_event CharacterSelected CharacterIsLocal
    and I_EventCounter fire_trial = 1
    and IsFactionLeader
    and CharacterAge >= 24

    if I_EventCounter no_instigator = 0
    and RandomPercent < 34
    historic_event kill_instigator true
    set_event_counter fire_trial 0
    end_if

    if I_EventCounter fire_trial = 1
    if I_EventCounter put_on_trial < 5
    and RandomPercent < 10
    set_counter apply_command 1
    set_event_counter kill_him 1
    set_event_counter put_on_trial 0
    historic_event king_executed
    set_event_counter no_instigator 0
    end_if

    if I_EventCounter put_on_trial > 4
    and RandomPercent < 15
    set_counter apply_command 1
    set_event_counter kill_him 1
    set_event_counter put_on_trial 0
    historic_event king_executed
    set_event_counter no_instigator 1
    end_if
    set_event_counter fire_trial 0
    end_if
    end_monitor

    monitor_event EventCounter EventCounterType kill_instigator_accepted
    and I_EventCounter kill_instigator_accepted = 1

    set_event_counter kill_instigator_accepted 0
    set_event_counter put_on_trial 0
    set_event_counter kill_random_char 1
    if RandomPercent < 10
    set_event_counter fire_trial 1
    set_event_counter no_instigator 1
    end_if
    end_monitor

    monitor_event EventCounter EventCounterType kill_instigator_declined
    and I_EventCounter kill_instigator_declined = 1

    set_event_counter kill_instigator_declined 0
    set_event_counter fire_trial 1
    set_event_counter no_instigator 1
    end_monitor

    monitor_event CharacterSelected CharacterIsLocal
    and I_EventCounter kill_random_char = 1
    and ! IsFactionLeader
    and ! IsFactionHeir
    and ! AgentType general

    set_event_counter kill_random_char 0
    historic_event kill_instigator_confirm true
    end_monitor

    monitor_event EventCounter EventCounterType kill_instigator_confirm_accepted
    and I_EventCounter kill_instigator_confirm_accepted = 1

    set_event_counter kill_instigator_confirm_accepted 0

    generate_random_counter kill_or_not 1 4
    if I_EventCounter kill_or_not > 1
    set_counter apply_command 1
    set_event_counter kill_random_char 2
    set_event_counter no_trial 1
    set_event_counter no_instigator 0
    end_if
    if I_EventCounter kill_or_not = 1
    set_event_counter fire_trial 1
    set_event_counter no_instigator 1
    end_if
    end_monitor

    monitor_event EventCounter EventCounterType kill_instigator_confirm_declined
    and I_EventCounter kill_instigator_confirm_declined = 1

    set_event_counter kill_instigator_confirm_declined 0
    set_event_counter kill_random_char 1
    end_monitor

    monitor_conditions I_CompareCounter apply_command = 1 ;could also be monitor_event, but I was getting CTDs with it
    e_select_character ; not really necessary
    if I_CharacterSelected Abaan
    console_command kill_character "Abaan"
    set_counter kill_him 0
    end_if
    if I_CharacterSelected Adanion
    console_command kill_character "Adanion"
    set_counter kill_him 0
    end_if
    if I_CharacterSelected Adnan
    console_command kill_character "Adnan"
    set_counter kill_him 0
    end_if
    ;all characters underneath
    end_monitor

    ;or this
    e_select_character
    if I_CharacterExists Varaible
    and I_CharacterSelected Varaible
    if I_CompareCounter kill_him = 1
    console_command kill_character "Varaible"
    set_counter kill_him 0
    set_counter apply_punishment 0
    end_if
    if I_CompareCounter send_off_map = 1
    console_command give_trait this CharacterAway ;just some trait to be given
    send_character_off_map Varaible
    set_counter send_off_map 0
    set_counter apply_punishment 0
    end_if
    end_if


    Regards

    P.S. Initial SS 6.2 script version (larger) was 249 MB for all factions, here's a "demo" I uploaded on 02 March (maybe it'll be of some use). It didn't start on my 2GB memory PC due to too large memory consumption. Any cs file above 30 MB was causing it, so it may just be some engine limitation.
    http://www.megaupload.com/?d=1PXYWJ7G
    Last edited by Germanicu5; September 16, 2010 at 01:22 AM.
    I have no memory of this place.

  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: Can we put Kings and Generals on Trial ?

    How often did dark thoughts roam through your head when you were writing that script? Must have been madness testing all that. Just as well that GED wrote his script replicator.










  19. #19
    Germanicu5's Avatar Will buy spare time...
    Join Date
    Feb 2009
    Location
    Not Zee Germany
    Posts
    2,101

    Default Re: Can we put Kings and Generals on Trial ?

    Yeah, I had to ask GED to update his replicator in order to produce such scripts (they seemingly exceeded 32,767 entries limit), big thanks to him for this effort. Surely I wouldn't even try to be so "fruitful" without it.

    The replicator itself accepts 2 Million lines now, so we can implement any crazy scripts we can imagine.

    Regards

    P.S. That code I presented could also be combined with traits, but after considering possible amount of monitors\triggers and their combination, I went for scripts mostly.

    P.S.2. Testing battle AI is madness, this I do for fun .
    Last edited by Germanicu5; September 15, 2010 at 10:02 AM.
    I have no memory of this place.

  20. #20
    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: Can we put Kings and Generals on Trial ?

    I only caught this thread because my name was mentioned, but I am glad I did.

    Its an interesting idea, but I have a simple question...

    What happens when there are 2 characters with the same name?

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
  •