Results 1 to 19 of 19

Thread: Creating a World - Killing characters multiple ways

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    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 Creating a World - Killing characters multiple ways

    This is a tutorial building on an old thread of mine.

    The script allows us to kill individual characters at whim with the simple script command kill_character [character name]. This will result in the character disappearing from the game, should he be a family member then he will be marked as 'died peacefully' in the family tree.
    Note: as this can only be used with known characters it is advisable (to avoid possible errors) to label the character like this: character Robert, named character, male, age 24, x 104, y 134, label william1
    It is possible to let the character die in a variety of ways by adding definitions to the script command as listed below, eg kill_character DET_BATTLE [character name]. This will result in the 'Died a heroic Death' message and he will be listed in the family tree as 'died heroically'. Unfortunately this is the only type of death that gets an automatic message, others will have to use the 'historic_event' method.
    Underneath is a list of the 'kill options' with ingame message displayed and text used for entries in the family tree (see pic below).
    Code:
      campaign_script       text\event_title        text\strat
      script command        ingame message      family tree entry
            
    DET_BATTLE        {character_dies_heroic}    {SMT_DIED_BATTLE}
    DET_STARVATION             None        {SMT_DIED_TRAGIC}
    DET_PLAGUE                 None        {SMT_DIED_PLAGUE}
    DET_POISONED               None        {SMT_DIED_ASSASSINATED}
    DET_EXECUTED_PRISONER      None        {SMT_EXECUTED_PRISONER}
    DET_EXECUTED               None        {SMT_EXECUTED}
    DET_ASSASSINATED           None        {SMT_DIED_ASSASSINATED}
    DET_DISASTER               None        {SMT_DIED_TRAGIC}
    DET_NATURAL                None        {SMT_DIED}
    Family tree entry using DET_ASSASSINATED



    Sample script use:

    Code:
        monitor_event FactionTurnStart FactionIsLocal
                if I_TurnNumber = 0
                    and I_CharacterExists [character_label]
                        kill_character DET_ASSASSINATED [character_label]
                        historic_event [assassination event]
                end_if
        end_monitor
    .
    Last edited by Gigantus; June 30, 2017 at 07:19 AM. Reason: media updated










  2. #2

    Default Re: Creating a World - Killing characters multiple ways

    Strange that no one replied to this thread; however, excellent discovery, Gigantus.
    I would like to understand what do you mean by "use the 'historic_event' method"
    What do I have to put in [assassination event]?
    Thanks.

  3. #3
    Den Stark's Avatar Tiro
    Join Date
    May 2012
    Location
    Vladivostok
    Posts
    248

    Default Re: Creating a World - Killing characters multiple ways

    you create your own historic_event eg

    Code:
    monitor_event FactionTurnStart FactionIsLocal
        if I_TurnNumber = 0
        and I_CharacterExists william1
    
        kill_character DET_ASSASSINATED william1
        historic_event assassination_william1
        end_if
    end_monitor
    and in дата\text\historic_events.txt add the line as

    {assassination_william1_TITLE}William was killed!!!
    {assassination_william1_BODY}someone killed William....

  4. #4
    Den Stark's Avatar Tiro
    Join Date
    May 2012
    Location
    Vladivostok
    Posts
    248

    Default Re: Creating a World - Killing characters multiple ways

    Gigantus, can we do without "and"? or misprint? )
    Code:
        and I_CharacterExists william1
    Code:
        monitor_event FactionTurnStart FactionIsLocal
                 if I_TurnNumber = 0
                     I_CharacterExists [character_label]
                         kill_character DET_ASSASSINATED [character_label]
                         historic_event [assassination event]
                 end_if
         end_monitor
    .

  5. #5
    Den Stark's Avatar Tiro
    Join Date
    May 2012
    Location
    Vladivostok
    Posts
    248

    Default Re: Creating a World - Killing characters multiple ways

    Thank you,
    and is it possible? for example:
    Code:
        monitor_event FactionTurnStart FactionIsLocal
                 if I_TurnNumber = 0
                     I_CharacterExists [character_label]
                     I_SettlementOwner Edinburgh = scotland
                     I_CompareCounter counter = 0
                         kill_character DET_ASSASSINATED [character_label]
                         historic_event [assassination event]
                 end_if
         end_monitor

  6. #6

    Default Re: Creating a World - Killing characters multiple ways

    Quote Originally Posted by den5104 View Post
    you create your own historic_event eg

    Code:
    monitor_event FactionTurnStart FactionIsLocal
        if I_TurnNumber = 0
        and I_CharacterExists william1
    
        kill_character DET_ASSASSINATED william1
        historic_event assassination_william1
        end_if
    end_monitor
    and in дата\text\historic_events.txt add the line as

    {assassination_william1_TITLE}William was killed!!!
    {assassination_william1_BODY}someone killed William....
    Thanks (it was so easy )

  7. #7
    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: Creating a World - Killing characters multiple ways

    Because of the use of 'IF' you do not need to use 'AND' (see my example in post #1), should you write a monitor without the use of 'IF' then you will need to use the 'AND' (add the 'terminate_monitor' to avoid re-run of the monitor and free up memory).

    Code:
        monitor_event FactionTurnStart FactionIsLocal
                  and I_CharacterExists [character_label]
                        kill_character DET_ASSASSINATED [character_label]
                        historic_event [assassination event]
                  terminate_monitor
        end_monitor
    .










  8. #8
    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: Creating a World - Killing characters multiple ways

    The second and third condition will require the 'and' :

    Code:
        monitor_event FactionTurnStart FactionIsLocal
                 if I_TurnNumber = 0
                     I_CharacterExists [character_label]
                     and I_SettlementOwner Edinburgh = scotland
                     and I_CompareCounter counter = 0
                         kill_character DET_ASSASSINATED [character_label]
                         historic_event [assassination event]
                 end_if
         end_monitor










  9. #9

    Default Re: Creating a World - Killing characters multiple ways

    Is there a way to kill a charcter without knowing his name, or his label?

  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: Creating a World - Killing characters multiple ways

    Not possible










  11. #11
    Mhaedros's Avatar Brave Heart Tegan
    Content Emeritus

    Join Date
    Feb 2011
    Location
    Finland
    Posts
    8,764
    Blog Entries
    2

    Default Re: Creating a World - Killing characters multiple ways

    Code:
        monitor_event FactionTurnStart FactionIsLocal            if I_TurnNumber = 0
                    I_CharacterExists thror2
                        kill_character DET_ASSASSINATED thror2
                        historic_event assassination_thror1
                end_if
        end_monitor
    I get this error

    Code:
     14:01:09.949 [game.script] [error] Script parsing error at line 7, column 17 in mods/TheRoadToErebor/data/world/maps/campaign/imperial_campaign/campaign_script.txt
    don't recognise this token: I_CharacterExists
    14:01:09.949 [game.script] [error] Script parsing error at line 10, column 13 in mods/TheRoadToErebor/data/world/maps/campaign/imperial_campaign/campaign_script.txt
    Couldn't create a script from file mods/TheRoadToErebor/data/world/maps/campaign/imperial_campaign/campaign_script.txt
    I literally copy/pasted the example in the OP, so I don't know what's wrong :S I don't understand why it doesn't recognize I_CharacterExists.
    Under the patronage of Finlander. Once patron to someone, no longer.
    Content's well good, innit.


  12. #12
    Den Stark's Avatar Tiro
    Join Date
    May 2012
    Location
    Vladivostok
    Posts
    248

    Default Re: Creating a World - Killing characters multiple ways

    Maybe
    Code:
    monitor_event FactionTurnStart FactionIsLocal
                if I_TurnNumber = 0
                     and I_CharacterExists thror2
                        kill_character DET_ASSASSINATED thror2
                        historic_event assassination_thror1
                end_if
        end_monitor

  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: Creating a World - Killing characters multiple ways

    yup - 'and' is missing










  14. #14
    Mhaedros's Avatar Brave Heart Tegan
    Content Emeritus

    Join Date
    Feb 2011
    Location
    Finland
    Posts
    8,764
    Blog Entries
    2

    Default Re: Creating a World - Killing characters multiple ways

    No log report now, but nothing happens either. The only error reports in trace where some misplaced settlements.
    Under the patronage of Finlander. Once patron to someone, no longer.
    Content's well good, innit.


  15. #15
    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: Creating a World - Killing characters multiple ways

    Run it as an independent script, that way you can avoid getting tripped by other script errors.

    Code:
    script
    
        monitor_event FactionTurnStart FactionIsLocal
                if I_TurnNumber = 0
                   and I_CharacterExists thror2
                        kill_character DET_ASSASSINATED thror2
                        historic_event assassination_thror1
                end_if
        end_monitor
    
    wait_monitors
    
    end_script
    Obviously the character has to exist (thror2) and the historic_event text (assassination_thror1) has to be present for this to work.










  16. #16
    Mhaedros's Avatar Brave Heart Tegan
    Content Emeritus

    Join Date
    Feb 2011
    Location
    Finland
    Posts
    8,764
    Blog Entries
    2

    Default Re: Creating a World - Killing characters multiple ways

    Aah, thanks! I must've forgot to add wait_monitors or something, I don't know
    Under the patronage of Finlander. Once patron to someone, no longer.
    Content's well good, innit.


  17. #17
    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: Creating a World - Killing characters multiple ways

    One is glad to be of service










  18. #18
    bitterhowl's Avatar Campidoctor
    Join Date
    Feb 2011
    Location
    Russian Feodality
    Posts
    1,570

    Default Re: Creating a World - Killing characters multiple ways

    Is it possible to use this feature for family tree records in descr_strat?

    My sister, do you still recall the blue Hasan and Khalkhin-Gol?
    Russian warship is winning. Proofs needed? Go find yourself!

  19. #19
    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: Creating a World - Killing characters multiple ways

    Seeing that it displays in the family tree when a living character gets killed there should be a way - but I am not aware of it or have tried.










Tags for this Thread

Posting Permissions

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