Results 1 to 4 of 4

Thread: EDCT/Script Issue

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1

    Default EDCT/Script Issue

    Okay, here’s the situation. I’m working the integration of a 4tpy script. The script itself is working fine, however its interface with the EDCT is not.
    The trait is defined thus:

    Code:
     
                ;------------------------------------------
    Trait SeasonsCounter
        Characters all
     
        Level Spring
            Description Spring_desc
            EffectsDescription Spring_effects_desc
            Threshold 1
     
     
        Level Summer
            Description Summer_desc
            EffectsDescription Summer_effects_desc
            Threshold 2
     
     
        Level Autumn
            Description Autumn_desc
            EffectsDescription Autumn_effects_desc
            Threshold 3
     
     
        Level Winter
            Description Winter_desc
            EffectsDescription Winter_effects_desc
            Threshold 4
     
     
        Level SeasonUpper
            Description SeasonUpper_desc
            EffectsDescription SeasonUpper_effects_desc
            Threshold 5

    The rotation of seasons works fine, for existing characters. It’s the triggers for adoption that I’m having problems with.

    Code:
     
    ;------------------------------------------
    Trigger Seasons_Initial_ofa_1
                WhenToTest OfferedForAdoption
                
                Condition I_EventCounter season_spring = 1
                
                Affects SeasonsCounter 2 Chance 100
                
    ;------------------------------------------
    Trigger Seasons_Initial_ofa_2
                WhenToTest OfferedForAdoption
                
                Condition I_EventCounter season_summer = 1
                
                Affects SeasonsCounter 3 Chance 100
                
    ;------------------------------------------
    Trigger Seasons_Initial_ofa_3
                WhenToTest OfferedForAdoption
                
                Condition I_EventCounter season_autumn = 1
                
                Affects SeasonsCounter 4 Chance 100
                
    ;------------------------------------------
    Trigger Seasons_Initial_ofa_4
                WhenToTest OfferedForAdoption
                
                Condition I_EventCounter season_winter = 1
                
                Affects SeasonsCounter 5 Chance 100

    All of these work fine, assigning the appropriate trait, except the one for spring. For whatever reason, a character coming available for adoption in the spring bears the Winter trait. Is there any reason you can see for that? Thanks in advance for the help.
    Son of PW

  2. #2
    Squid's Avatar Opifex
    Patrician Artifex Technical Staff

    Join Date
    Feb 2007
    Location
    Frozen waste lands of the north
    Posts
    17,751
    Blog Entries
    3

    Default Re: EDCT/Script Issue

    I'm surprised any are working correctly, since the points you're assigning for each season don't match the points expected for the correcponding level. For example the level Summer has a threshold of 2 and Autumn has a threshold of 3, but when the summer season event kicks in your giving 3 points towards the trait, which should give the Autumn level not the summer level. Of course that sort of depends on when the values for the seasons are set, if season_spring = 1 event counter means that spring was the last turn then you're fine, but your winter trigger should give 1 point instead of 5, if that isn't what the event counter is supposed to mean, then you likely have an issue with which counters are active at any point in time, in which case this is actually a scripting issue. To be able to accurately diagnose the problem we'd need the script that sets the counters.
    Under the patronage of Roman_Man#3, Patron of Ishan
    Click for my tools and tutorials
    "Two things are infinite: the universe and human stupidity; and I'm not sure about the universe." -----Albert Einstein

  3. #3

    Default Re: EDCT/Script Issue

    I will try to upload the script--when I set them for the correct values they failed to work at all. I didn't write the original script, so it's baffling me.

    EDIT: So, no, I did not start with these admittedly odd values, I started with what should have been correct and then started tweaking till something worked.
    Last edited by Theodotos I; November 24, 2009 at 11:17 AM.
    Son of PW

  4. #4
    Squid's Avatar Opifex
    Patrician Artifex Technical Staff

    Join Date
    Feb 2007
    Location
    Frozen waste lands of the north
    Posts
    17,751
    Blog Entries
    3

    Default Re: EDCT/Script Issue

    Your script should to change the events should look something like this:

    Code:
    declare_counter season_counter
    monitor_event PreFactionTurnStart FactionIsLocal
        inc_counter season_counter 1
        if I_EventCounter season_counter = 1 then
            set_event_counter season_spring = 1
            set_event_counter season_winter = 0
        end_if
        if I_EventCounter season_counter = 2 then
            set_event_counter season_summer = 1
            set_event_counter season_spring = 0
        end_if
         if I_EventCounter season_counter = 3 then
            set_event_counter season_autumn = 1
            set_event_counter season_summer = 0
        end_if
        if I_EventCounter season_counter = 4 then
            set_event_counter season_winter = 1
            set_event_counter season_autumn = 0
            set_event_counter season_counter = 0
        end_if
    Your triggers should then look something like:

    Code:
    ;------------------------------------------
    Trigger Seasons_Initial_ofa_1
                WhenToTest OfferedForAdoption
                
                Condition I_EventCounter season_spring = 1
                
                Affects SeasonsCounter 1 Chance 100
                
    ;------------------------------------------
    Trigger Seasons_Initial_ofa_2
                WhenToTest OfferedForAdoption
                
                Condition I_EventCounter season_summer = 1
                
                Affects SeasonsCounter 2 Chance 100
                
    ;------------------------------------------
    Trigger Seasons_Initial_ofa_3
                WhenToTest OfferedForAdoption
                
                Condition I_EventCounter season_autumn = 1
                
                Affects SeasonsCounter 3 Chance 100
                
    ;------------------------------------------
    Trigger Seasons_Initial_ofa_4
                WhenToTest OfferedForAdoption
                
                Condition I_EventCounter season_winter = 1
                
                Affects SeasonsCounter 4 Chance 100
    ;------------------------------------------
    Trigger Seasons_Change_1
                WhenToTest CharacterTurnStart
                
                Condition Trait SeasonsCounter >= 1
                       and Trait SeasonsCounter < 4 ;i.e. isn't the winter season
                
                Affects SeasonsCounter 1 Chance 100
    ;------------------------------------------
    Trigger Seasons_Change_2
                WhenToTest CharacterTurnStart
                
                Condition Trait SeasonsCounter = 4
                
                Affects SeasonsCounter -4 Chance 100
    This also means you don't need the top level of the trait.
    Under the patronage of Roman_Man#3, Patron of Ishan
    Click for my tools and tutorials
    "Two things are infinite: the universe and human stupidity; and I'm not sure about the universe." -----Albert Einstein

Posting Permissions

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