Results 1 to 7 of 7

Thread: Age trigger

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    caralampio's Avatar Magnificus
    Join Date
    Dec 2006
    Location
    Guatemala
    Posts
    1,809

    Default Age trigger

    I found these old age traits in export_descr_character: Beyond Battle and Senile. They are not active in the game. I want to experiment with using them, however I don't know how to create a trigger caused by character age. I've thought about making the triggers something like this ('...' is the missing condition I'm looking for):

    ;------------------------------------------
    Trigger Senility
    WhenToTest Character TurnEnd
    Condition IsGeneral
    and ... > 70
    Affects Senile 1 Chance 10

    ;------------------------------------------
    Trigger TooOldToFight
    WhenToTest Character TurnEnd
    Condition IsGeneral
    and ... > 70
    Affects TooOldToFight 1 Chance 100

    Any ideas?

  2. #2
    Augustus Lucifer's Avatar Life = Like a beanstalk
    Patrician Citizen

    Join Date
    Aug 2006
    Location
    Mote of Dust
    Posts
    10,725

    Default Re: Age trigger

    It isn't implemented because there isn't a condition to check for character age in M2TW. They added one in Kingdoms:

    CharacterAge > 70

    Only applicable on the strat map and with character_record exported from the event. There's no medieval equivalent, you'd have to create some archaic round-about way which is either entirely unspecific or has to many separate triggers for it to be useful, and would likely be inaccurate.

    Cheers,
    Augustus

  3. #3
    caralampio's Avatar Magnificus
    Join Date
    Dec 2006
    Location
    Guatemala
    Posts
    1,809

    Default Re: Age trigger

    That's OK because I'm planning it for Stainless Steel 6.1, which uses kingdoms. But what do you mean character_record exported from the event?

  4. #4
    Augustus Lucifer's Avatar Life = Like a beanstalk
    Patrician Citizen

    Join Date
    Aug 2006
    Location
    Mote of Dust
    Posts
    10,725

    Default Re: Age trigger

    An export is a trigger that is exported by an event which the condition reads to give it information, so that it can apply the condition to the situation. The two need to share and export/require or the condition needs to have no requirement, in order for it to get all the info it needs from the event and work.

    Code:
    Identifier:         PreBattle
    Event:              When a battle is about to start
    Exports:            nc_character_record, character_record, faction, region_id, character_type
    Class:              ET_PRE_BATTLE
    Author:             Lee
    Above you will see the Event "PreBattle" which lists character_record as an export and other exports. This is the event you're using:

    Code:
    Identifier:         CharacterTurnEnd
    Event:              A Character has finished its turn
    Exports:            nc_character_record, character_record, faction, region_id, character_type, settlement
    Class:              ET_CHARACTER_TURN_END
    Author:             Guy
    It lists the "character_record" as an export of the event. And the condition you want:

    Code:
    Identifier:	CharacterAge
    Trigger requirements: 	character_record
    Parameters:	logic token, age
    Sample use:	CharacterAge >= 75
    Description:	Test the age of a character
    Battle or Strat:	Strat
    Class:	CHARACTER_AGE
    Lists that as a requirement. So your current selection of event and condition work fine, but it's important to understand why they work fine and not just that they work fine, or you will try one later that doesn't match requirement to export and be confused as to why it won't seem to work.

    Your syntax is a bit off on the event as well, as you may be aware. CharacterTurnEnd needs to be one word, rather than Character TurnEnd. And the "Affects" line needs to be separated from the trigger lines by a space line.

    Cheers,
    Augustus

  5. #5
    caralampio's Avatar Magnificus
    Join Date
    Dec 2006
    Location
    Guatemala
    Posts
    1,809

    Default Re: Age trigger

    These are the triggers as I tested them:

    ;------------------------------------------
    Trigger Alzheimer
    WhenToTest CharacterTurnEnd

    Condition IsGeneral
    and CharacterAge > 65

    Affects Senile 1 Chance 10

    ;------------------------------------------
    Trigger TooOld
    WhenToTest CharacterTurnEnd

    Condition IsGeneral
    and CharacterAge > 65
    and Trait TooOldToFight = 0

    Affects TooOldToFight 1 Chance 100

    I also did these changes to the Too Old trait (it had no effect originally):

    ;------------------------------------------
    Trait TooOldToFight
    Characters family

    Level Beyond_Battle
    Description Beyond_Battle_desc
    EffectsDescription Beyond_Battle_effects_desc
    Threshold 1

    Effect HitPoints -4
    Effect MovementPoints -3
    Effect TroopMorale -1
    Effect Authority 1
    Effect LocalPopularity 1

    When I tested these, I got a lockup in the splash screen. But then I hadn't done the charactrer record thing. Which may I ask, is in which file?

    BTW how do I place text in that cool sliding window?

  6. #6
    Augustus Lucifer's Avatar Life = Like a beanstalk
    Patrician Citizen

    Join Date
    Aug 2006
    Location
    Mote of Dust
    Posts
    10,725

    Default Re: Age trigger

    The character record isn't in a file, it works in between the Condition and the Event used in the Script Trigger. Sort of like sending money at a bank, if you give them American Dollars to an American Bank, it works because they recognize the currency and have all the information they need to deposit the funds. This is like how the script triggers work, the event exports various things for the conditions file to be able to look for to insure it can identify with the event.

    It isn't written anywhere besides the DocuDemons, and you don't need to add it to any code, it is just how the event identifies with the condition and makes sure the processes exchange the necessary information. Character record is saying that the event will log all information about characters, so that conditions that need to look up information about characters have it to access. So it is just implied in working event-condition pairs, you don't write it in any file.

    What your problem likely is, probably is that you don't have strings for the traits in export_vnvs.txt in the Text files area, since they weren't in the vanilla came it might be missing the necessary entries there, like:

    Code:
    {Beyond_Battle}Beyond Battle
    {Beyond_Battle_desc}This man is no longer physically capable of taking the field of battle any longer.
    {Beyond_Battle_effects_desc}No Effects
    Those lines are in my file, but they might not be in yours for whatever reason. If that isn't the cause of the error, you'll need to look at a log and review any other changes you might have made. You make the "scroll box", which is called a Code box, by wrapping the text in code tags:

    [ CODE ]
    This is code text, but the tags are separated by spaces so it won't display.
    [ /CODE ]

    Code:
    This text is wrapped by non-spaced tags so that they display, quote the message to see how.
    Cheers,
    Augustus
    Last edited by Augustus Lucifer; September 25, 2008 at 12:54 AM.

Posting Permissions

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