Results 1 to 7 of 7

Thread: Help: Preventing strat_model change

  1. #1

    Default Help: Preventing strat_model change

    Hi guys and girls,

    I am beginning to learn the M2TW scripts and trying to diversify the campaign strat models for my generals.

    What I know:

    - the interactions between descr_character.txt, descr_model_strat.txt & export_descr_character_traits.txt to assign unique strat models for my generals

    What I achieved:

    - got unique models for my starting generals

    My problem:

    - when the faction leader or faction heir dies and a new faction member becomes one of those two, their model changes (obviously because the "FactionLeader" and "FactionHeir" trait include "Effect Level" 1 & 2)
    - e.g. I got a starting general with a female model and it changes to a male one, when becoming Leader or Heir, which is not really what I wanted to achieve

    What I want:

    - I would like my starting generals to never change their model, but at the same time keep the Effect Level in the FactionLeader and FactionHeir traits, so those two keep their unique appearance.


    Would be very grateful, if anyone has an idea how to achieve this via a script in the campaign_script.txt or triggers in export_descr_character_traits.txt

    Cheers
    Dampfy

  2. #2
    Withwnar's Avatar Script To The Waist
    Join Date
    Oct 2008
    Location
    Earth
    Posts
    6,329

    Default Re: Help: Preventing strat_model change

    Nice mission brief. A couple of ideas...

    Create a new hidden trait named FixedModel. Give it to every character whose model you do not want to change when they become leader/heir. That would be your "starting characters" you mentioned and could also be given to characters who are spawned later in the game.

    In your faction leader/heir trait triggers, only give them to those who do not have FixedModel...

    Code:
    ;------------------------------------------
    Trigger FactionLeader_trigger1
      WhenToTest BecomesFactionLeader
    
      Condition Trait FixedModel = 0
    
      Affects FactionLeader 1 Chance 100
    
    ;------------------------------------------
    Trigger FactionHeir_trigger1
      WhenToTest BecomesFactionHeir
    
      Condition Trait FixedModel = 0
    
      Affects FactionHeir 1 Chance 100
    Alternatively, if you want these guys to still get the leader/heir traits, just not change their model, then expand on that a little...

    Remove the Level effect from the leader and heir traits. Create two new hidden traits: FactionLeaderModel and FactionHeirModel. Put the Level effect in those traits instead.

    Use triggers to give the leader/heir trait to anybody. Use triggers to only give these new Model traits to those who do not have the FixedModel trait...

    Code:
    ;------------------------------------------
    Trigger FactionLeader_trigger1
      WhenToTest BecomesFactionLeader
    
      Affects FactionLeader 1 Chance 100
    
    ;------------------------------------------
    Trigger FactionHeir_trigger1
      WhenToTest BecomesFactionHeir
    
      Affects FactionHeir 1 Chance 100
      
    ;------------------------------------------
    Trigger FactionLeaderModel_trigger1
      WhenToTest BecomesFactionLeader
    
      Condition Trait FixedModel = 0
    
      Affects FactionLeaderModel 1 Chance 100
    
    ;------------------------------------------
    Trigger FactionHeirModel_trigger1
      WhenToTest BecomesFactionHeir
    
      Condition Trait FixedModel = 0
    
      Affects FactionHeirModel 1 Chance 100
    That's "fixed" as in "unchanging", not "repaired". Maybe not the best name for it.
    Last edited by Withwnar; April 18, 2019 at 10:39 PM.

  3. #3

    Default Re: Help: Preventing strat_model change

    Thank you very much for your ideas! I can see that working and will try it later
    In the meantime I tried something different. I made 9 "level traits" that each look like the following one:

    Code:
    ;------------------------------------------
    Trait level1
        Characters family, general
        NoGoingBackLevel 1
        AntiTraits Factionleader, Factionheir
    
        Level level1
            Description level1_desc
            EffectsDescription none_desc
            GainMessage level1_gain_desc
            LoseMessage level1_lose_desc
            ;Epithet level1_epithet_desc
            Threshold 1
    
            Effect Level 1
    These have no triggers and are assigned to the aforementioned starting generals. All seems to be working fine, but I can't stop but thinking some new problems will arise with me fiddling with the infamous NoGoBackLevel and AntiTraits Any words of wisdom?

    Cheers
    Dampfy

  4. #4

    Default Re: Help: Preventing strat_model change

    Btw the descriptions are just debug messages, so please ignore. If these level traits work fine, I will eventually make them hidden altog..

  5. #5
    Withwnar's Avatar Script To The Waist
    Join Date
    Oct 2008
    Location
    Earth
    Posts
    6,329

    Default Re: Help: Preventing strat_model change

    The "level" traits are a good idea. I use one too and it has been very helpful. Mine is just one trait of nine trait levels each with the corresponding Level effect, which makes it easier to remove from somebody and to test whether he has one. Applying a Level (e.g. 3) to a character becomes "LevelTrait 3" in his traits line instead of (your way) "level3 1".

    You may as well make it "Characters all" so you can use it on agents too.

    I don't see the point of AntiTraits and NoGoingBackLevel here. If anything they're just going to interfere in annoying ways, so get rid of them I say. Does script-giving a trait even make it apply its AntiTraits rules? Not sure but I don't think so. If not then AntiTraits would only come into play when this trait gets points via triggers, which it doesn't have, so no point in AntiTraits.

    I suggest persevering with the level trait(s) and just use that for the leader/heir model traits too. No need for my FactionLeaderModel and FactionHeirModel.

    By the way, the FactionHeir trait should also be removed from anybody who becomes leader, and so should the heir model level trait. To use my earlier example...

    Code:
    ;------------------------------------------
    Trigger FactionLeader_trigger1
      WhenToTest BecomesFactionLeader
    
      Affects FactionLeader 1 Chance 100
      Affects FactionHeir -1 Chance 100
    
    ;------------------------------------------
    Trigger FactionHeir_trigger1
      WhenToTest BecomesFactionHeir
    
      Affects FactionHeir 1 Chance 100
      
    ;------------------------------------------
    Trigger FactionLeaderModel_trigger1
      WhenToTest BecomesFactionLeader
    
      Condition Trait FixedModel = 0
    
      Affects FactionLeaderModel 1 Chance 100
      Affects FactionHeirModel -1 Chance 100
    
    ;------------------------------------------
    Trigger FactionHeirModel_trigger1
      WhenToTest BecomesFactionHeir
    
      Condition Trait FixedModel = 0
    
      Affects FactionHeirModel 1 Chance 100
    How to remove them when using level traits instead of FactionLeaderModel and FactionHeirModel depends on whether they are implemented as multiple traits (your way) or multiple levels of one trait (my way).

  6. #6

    Default Re: Help: Preventing strat_model change

    You accidentally taught me something new. I did not even consider to use it on agents, oh the possibilities! So you can have 9 stratmap model levels for each type of agent as well?

    I agree and changed my system to 9 levels of one trait. To be honest... I don't see the point of AntiTraits and NoGoingBackLevel either, but it had the effect I wanted for the moment.

    I love how "new" people like me can get into M2TW modding by reading through TWC forum articles and solve their problems by talking to more experienced people on here. Many thanks!

  7. #7
    Withwnar's Avatar Script To The Waist
    Join Date
    Oct 2008
    Location
    Earth
    Posts
    6,329

    Default Re: Help: Preventing strat_model change

    So you can have 9 stratmap model levels for each type of agent as well?
    10 including the level 0 default one. Per faction. You could literally have 2000+ unique strat models in the game if you wanted to : 10 x 30 factions x 8 (at least) character types.

Posting Permissions

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