Results 1 to 5 of 5

Thread: Weird thing

Hybrid View

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

    Default Weird thing

    I've added to buildings line in EDU line like this:
    and event_counter pagan_lithuania 1
    it's connected to the script:
    monitor_event FactionTurnStart
    add_events
    event counter litwa_conversion_accepted
    event counter litwa_conversion_declined
    date 0
    end_add_events
    terminate_monitor
    end_monitor
    ;XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
    monitor_event FactionTurnStart not FactionType lithuania
    set_event_counter pagan_lithuania 0
    set_event_counter not_pagan_lithuania 1

    terminate_monitor

    end_monitor

    monitor_event FactionTurnStart FactionType lithuania
    set_event_counter pagan_lithuania 1
    set_event_counter not_pagan_lithuania 0

    if I_EventCounter litwa_conversion_accepted = 1
    set_event_counter pagan_lithuania 0
    set_event_counter not_pagan_lithuania 1
    end_if

    terminate_monitor

    end_monitor
    ;XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
    monitor_event FactionTurnStart FactionType lithuania
    and I_TurnNumber = 4
    historic_event litwa_conversion true factions { lithuania, }
    terminate_monitor
    end_monitor
    monitor_conditions I_EventCounter litwa_conversion_accepted = 1
    set_religion lithuania catholic
    retire_characters lithuania priest
    destroy_buildings lithuania temple_perkunas true
    destroy_buildings lithuania temple_perkunas_castle true
    change_population_religion lithuania catholic 10 pagan
    spawn_character lithuania, Algirdas, priest, age 18, x 315, y 309
    terminate_monitor
    end_monitor
    Unfortunatel, if i want to build the structure using this condition, the game's starting building but never end this process. I belive there is something wrong. I suppose i misst something but i have no idea what. Maybe someone can find it?
    Last edited by attyla; March 11, 2011 at 02:51 PM.

  2. #2

    Icon1 Re: Weird thing

    attyla: Try this:
    Code:
    ;XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
    
    	monitor_event PreFactionTurnStart not FactionType lithuania
    		set_event_counter pagan_lithuania 0
    		set_event_counter not_pagan_lithuania 1
    	end_monitor
    
    	monitor_event PreFactionTurnStart FactionType lithuania
    		set_event_counter pagan_lithuania 1
    		set_event_counter not_pagan_lithuania 0
    
    		if I_EventCounter litwa_conversion_accepted = 1
    		set_event_counter pagan_lithuania 0
    		set_event_counter not_pagan_lithuania 1
    	end_if
    	end_monitor
    
    ;XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
    
    	monitor_event FactionTurnStart FactionType lithuania
    		and I_TurnNumber = 4
    		historic_event litwa_conversion true factions { lithuania, }
    	terminate_monitor
    	end_monitor
    
    	monitor_conditions I_EventCounter litwa_conversion_accepted = 1
    		set_religion lithuania catholic
    		retire_characters lithuania priest
    		destroy_buildings lithuania temple_perkunas true
    		destroy_buildings lithuania temple_perkunas_castle true
    		change_population_religion lithuania catholic 10 pagan
    		spawn_character lithuania, Algirdas, priest, age 18, x 315, y 309
    	terminate_monitor
    	end_monitor

  3. #3

    Default Re: Weird thing

    TNZ
    I don't understand what exactly you've changed but it works!

    Checking log file i found info about error in another script (this script should add costs of keeping units bying out of cities).
    Log says:
    08:32:02.375 [game.script] [error] Script execution error for <inc_counter>, at line 40, in mods/Deus_Vult/data/world/maps/campaign/imperial_campaign/campaign_script.txt:
    Counter field_cost doesn't exist
    and there is a script:
    monitor_event FuctionTurnStart
    set_event_counter field_costs 1
    terminate_monitor
    end_monitor

    monitor_event CharacterTurnEnd FactionIsLocal
    and I_EventCounter field_costs == 1
    and EndedInSettlement
    and not AgentType = admiral
    and not AgentType = spy
    and not AgentType = diplomat
    and not AgentType = assassin
    and not AgentType = priest
    and not AgentType = princess
    and not AgentType = merchant
    console_command add_money -700
    end_monitor
    Maybe should i change it like this:
    monitor_event PreFuctionTurnStart
    set_event_counter field_costs 1
    end_monitor
    ?

    I don't understand what this change makes, but it looks like a spell
    Last edited by attyla; March 12, 2011 at 01:50 AM.

  4. #4

    Default Re: Weird thing

    This time this spell was not helpfull

  5. #5

    Icon1 Re: Weird thing

    Quote Originally Posted by attyla View Post
    This time this spell was not helpfull
    The TWC University’s archive has some classes on writing scripts:

    Scripting 101

    Introduction to Scripting

Posting Permissions

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