Results 1 to 6 of 6

Thread: Mysterious faulty scripts, help needed

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    /|\/|\/|\/|\/|\/|\/
    Join Date
    Jun 2005
    Posts
    10,770

    Default Mysterious faulty scripts, help needed

    There are 2 scripts in DLV which sometimes don't work.

    This is a script for reconciling or imprisoning a rebellious family member:
    Code:
    ;------------------------------------Dungeon--------------------------------------
    monitor_event CharacterTurnEnd FactionIsLocal
    and not IsFactionLeader
    and Trait Disobedient >= 1
    and Trait Reconciled_to_his_King < 1
    and Trait Thrown_in_Dungeon < 1
    and FactionLeaderTrait Seat_of_Power > 0
    and EndedInSettlement
    and SettlementBuildingExists >= dungeon
    	historic_event dungeon_prepare
    end_monitor
    
    monitor_event CharacterSelected CharacterIsLocal 
    and not IsFactionLeader
    and Trait Disobedient >= 1
    and Trait Reconciled_to_his_King < 1
    and Trait Thrown_in_Dungeon < 1
    and FactionLeaderTrait Seat_of_Power > 0
    and EndedInSettlement
    and I_EventCounter dungeon_prepare = 1
    	historic_event dungeon true
    set_event_counter dungeon_prepare 0
    set_counter dungeon_decided 1
    end_monitor
    
    monitor_conditions I_EventCounter dungeon_accepted = 1
    and I_CompareCounter dungeon_decided = 1
    e_select_character 
    	console_command give_trait this Thrown_in_Dungeon 1
    	inc_counter gov_points -1
    set_counter dungeon_decided 0
    end_monitor
    
    monitor_conditions I_EventCounter dungeon_declined = 1
    and I_CompareCounter dungeon_decided = 1
    e_select_character 
    	console_command give_trait this Reconciled_to_his_King 1
    	console_command add_money -3000
    set_counter dungeon_decided 0
    end_monitor
    This one is to retire a career general so he can become a governer:

    Code:
    ;------------------------------------Retire General to Governor--------------------------------------
    monitor_event CharacterTurnEnd FactionIsLocal
    and not IsFactionLeader
    and Trait Not_Retired < 1
    and Trait Retired < 1
    and Trait Path_General >= 1
    and FactionLeaderTrait Seat_of_Power > 0
    and CharacterAge > 59
    and EndedInSettlement
    and SettlementBuildingExists >= town_hall
    	historic_event retire_prepare
    end_monitor
    
    monitor_event CharacterSelected CharacterIsLocal 
    and not IsFactionLeader
    and Trait Not_Retired < 1
    and Trait Retired < 1
    and Trait Path_General >= 1
    and FactionLeaderTrait Seat_of_Power > 0
    and CharacterAge > 59
    and EndedInSettlement
    and I_EventCounter retire_prepare = 1
    	historic_event retire true
    set_event_counter retire_prepare 0
    set_counter retire_decided 1
    end_monitor
    
    monitor_conditions I_EventCounter retire_accepted = 1
    and I_CompareCounter retire_decided = 1
    e_select_character 
    	console_command give_trait this Retired 1
    	console_command remove_trait this Path_General 1
    	console_command give_trait this Path_Governor 1
    	console_command add_money -1000
    set_counter retire_decided 0
    end_monitor
    
    monitor_conditions I_EventCounter retire_declined = 1
    and I_CompareCounter retire_decided = 1
    e_select_character 
    	console_command give_trait this Not_Retired 1
    set_counter retire_decided 0
    end_monitor
    Does anyone have any ideas why these might not work? Things to check?

  2. #2

    Icon1 Re: Mysterious faulty scripts, help needed

    Taiji: Try this.

    Code:
    ;------------------------------------Dungeon--------------------------------------
    monitor_event CharacterTurnEnd FactionIsLocal
    and not IsFactionLeader
    and Trait Disobedient >= 1
    and Trait Reconciled_to_his_King < 1
    and Trait Thrown_in_Dungeon < 1
    and FactionLeaderTrait Seat_of_Power > 0
    and EndedInSettlement
    and SettlementBuildingExists >= dungeon
    historic_event dungeon_prepare
    set_event_counter dungeon_prepare 1
    end_monitor
    
    monitor_event CharacterSelected CharacterIsLocal 
    and not IsFactionLeader
    and Trait Disobedient >= 1
    and Trait Reconciled_to_his_King < 1
    and Trait Thrown_in_Dungeon < 1
    and FactionLeaderTrait Seat_of_Power > 0
    and EndedInSettlement
    and I_EventCounter dungeon_prepare = 1
    historic_event dungeon true
    set_event_counter dungeon_prepare 0
    set_counter dungeon_decided 1
    end_monitor
    
    monitor_conditions I_EventCounter dungeon_accepted = 1
    and I_CompareCounter dungeon_decided = 1
    e_select_character 
    console_command give_trait this Thrown_in_Dungeon 1
    inc_counter gov_points -1
    set_counter dungeon_decided 0
    end_monitor
    
    monitor_conditions I_EventCounter dungeon_declined = 1
    and I_CompareCounter dungeon_decided = 1
    e_select_character 
    console_command give_trait this Reconciled_to_his_King 1
    console_command add_money -3000
    set_counter dungeon_decided 0
    end_monitor

  3. #3
    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: Mysterious faulty scripts, help needed

    Just as a note, it won't affect the working of the script, but you might want to change all the Trait XXX < 1 to Trait XXX = 0. Since you can't have negative trait levels, the only value less than one that a trait will have is 0 to show the trait is not present on the character, this will make it somewhat easier to read.
    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

  4. #4

    Default Re: Mysterious faulty scripts, help needed

    isnt the command 'e_select_character' faulty? In that the character has to be already selected for it to actually work. According to your script, the last thing the player did in game prior to the line of the script 'e_select_character' was click accept on an interactive event... therefore, no character was recently selected and e_select_character has nothing to work on. I do realise that the character was selected during the process of that script, but not at the time e_select_character attempts to fire... if you know what i mean.

    I could be wrong, and would hate to lead you on a wild goose chase. But i would definatly be testing the e_select_character a little more indepthly because last i heard the character has to be selected in the current monitor for it to work... i believe the example in docudemons is a little misleading.

    The other possibility is the phrasing...
    e_select_character
    console_command give_trait this Not_Retired 1

    should be all on one line and add a ',' after e_slect_character...
    e_select_character, console_command give_trait this Not_Retired 1

    Unfortunatly, i have never actually used that command so i cant give you a very accurate answer... thats all i got for this problem im afraid
    ...longbows, in skilled hands, could reach further than trebuchets...

  5. #5
    Userpro's Avatar =RAE= HostedMod Creator
    Join Date
    Jul 2008
    Location
    regno germanicum, teutonical forest
    Posts
    1,673

    Default Re: Mysterious faulty scripts, help needed

    never mind
    Last edited by Userpro; November 09, 2009 at 12:47 AM.
    Visit our TWC M2TW-Kingdoms Hosted Mods Forum for...

    !!! RAE Development stopped --- read last Statement here !!!
    M2TW-Kingdoms Mod Creator REDEO AD EXORDIUM ( RAE )
    Progress: 95% internal final beta release - 85% official release
    RAE TWC-Wiki Eagle Standard interview ... RAE.net Homepage ... RAE TWZ-Germany
    Proudly Sega & Steam Boycotter since ETW! See why here or this petition
    Sorry for bad english here, there and in my tutorials > advanced horde invasion & hide/unhide stratmap-ui & Beginners modding



  6. #6
    /|\/|\/|\/|\/|\/|\/
    Join Date
    Jun 2005
    Posts
    10,770

    Default Re: Mysterious faulty scripts, help needed

    Thanks to everyone for your answers, these 2 scripts seem to be the only dodgy bits of DLV.

    I will try the suggested solutions

Posting Permissions

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