Results 1 to 12 of 12

Thread: Custom Campaign_script whit events

Hybrid View

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

    Default Custom Campaign_script whit events

    hi

    I made a script whit event which enable the player to customize certain options like no mongols, no timurids, more rebels in settlements, restric buildings whit year events.

    It works like this, firts it show to the firts human faction a true event asking him if he want to set certain options, if he ask yes the events whit the options appear, if he say no everything is on the same if he ignore the event. EDIT: I tested it and you cant pass turn if you dont answer it.

    here is the script, the tiers are barracks level.
    Spoiler Alert, click show to read: 

    Code:
    monitor_event FactionTurnStart
            
            add_events
                event    counter    introduction_accepted
                event    counter    introduction_declined
                 date    0
             end_add_events
            
            add_events
                event    counter    tiers_accepted
                event    counter    tiers_declined
                 date    0
             end_add_events
    
            set_event_counter introduction_accepted 0
            set_event_counter introduction_declined 0
            set_event_counter tiers_accepted 0
            set_event_counter tiers_declined 0
    
            terminate_monitor
        
        end_monitor
    ;----- event for settings
        monitor_event FactionTurnStart
        
            if I_LocalFaction england
        
                historic_event introduction true factions { england, }
                
            end_if
    
                
        terminate_monitor
        end_monitor
    
        monitor_event EventCounter EventCounterType introduction_accepted
            and EventCounter > 0    
    
        historic_event tiers true factions { england, }
    
        terminate_monitor
        end_monitor
    
    ;########################## Activate Tiers ############################
    
    
    monitor_event FactionTurnStart FactionIsLocal
        and I_TurnNumber = 60
        and I_EventCounter tiers_accepted = 0
    
        set_event_counter tier3_on 1
        
         add_events
            event historic tier3_on
            date 0 0
        end_add_events
        
    terminate_monitor
    end_monitor
    
    monitor_event FactionTurnStart FactionIsLocal
        and I_TurnNumber = 110
        and I_EventCounter tiers_accepted = 0
        
        set_event_counter tier4_on 1
        
         add_events
            event historic tier4_on
            date 0 0
        end_add_events
        
    terminate_monitor
    end_monitor
    
    monitor_event FactionTurnStart FactionIsLocal
        and I_TurnNumber = 160
        and I_EventCounter tiers_accepted = 0
    
        set_event_counter tier5_on 1
        
         add_events
            event historic tier5_on
            date 0 0
        end_add_events
        
    terminate_monitor
    end_monitor
    
    monitor_event EventCounter EventCounterType tiers_accepted
        and EventCounter > 0
    
        set_event_counter tier3_on 1
        set_event_counter tier4_on 1
        set_event_counter tier5_on 1
    
        
    terminate_monitor
    end_monitor


    the problem is to shot the events only to the firts faction, I think something like this
    Code:
      monitor_event FactionTurnStart
        
            if I_LocalFaction england
                historic_event introduction true factions { england, }
            end_if
            if I_LocalFaction france
                 historic_event introduction true factions { france, }
             end_if
    
                
        terminate_monitor
        end_monitor
    
        monitor_event EventCounter EventCounterType introduction_accepted
            and EventCounter > 0    
    
            if I_LocalFaction england
            historic_event tiers true factions { england, }
            end_if
    
            if I_LocalFaction france
             historic_event tiers true factions { france, }
             end_if
    
        terminate_monitor
        end_monitor
    this will make the script long if you have lot of factions, I only ask if someone can think of another way if not is fine .

    sorry for my english.
    Last edited by wolf-yop; November 16, 2010 at 05:26 PM.

  2. #2
    Aikanár's Avatar no vaseline
    Join Date
    Mar 2009
    Location
    Sanctuary
    Posts
    12,516
    Blog Entries
    3

    Default Re: Custom Campaign_script whit events

    Just use the condition FactionIsLocal hence the script will only fire for the playerfaction.
    And if you're scripting for Kingdoms, you can skip the "add events" section all together


    Son of Louis Lux, brother of MaxMazi, father of Squeaks, Makrell, Kaiser Leonidas, Iskar, Neadal, Sheridan, Bercor and HigoChumbo, house of Siblesz

    Not everything that counts can be counted, and not everything that can be counted counts.

  3. #3

    Default Re: Custom Campaign_script whit events

    Quote Originally Posted by Aikanár View Post
    Just use the condition FactionIsLocal hence the script will only fire for the playerfaction.
    the player is always the first faction. The reason is the historic_event need a faction or it will fire for all human factions.

  4. #4
    Aikanár's Avatar no vaseline
    Join Date
    Mar 2009
    Location
    Sanctuary
    Posts
    12,516
    Blog Entries
    3

    Default Re: Custom Campaign_script whit events

    Quote Originally Posted by wolf-yop View Post
    the player is always the first faction. The reason is the historic_event need a faction or it will fire for all human factions.
    Uhm, you've always one player faction, which is the local faction and all others are AI controled, hence if you want the script to only fire for the faction a human player is playing, regardless of which faction that might be, you only need the condition FactionIsLocal and no further definitions of the faction.
    The other simple way is to use "not IsFactionAIControlled"


    Son of Louis Lux, brother of MaxMazi, father of Squeaks, Makrell, Kaiser Leonidas, Iskar, Neadal, Sheridan, Bercor and HigoChumbo, house of Siblesz

    Not everything that counts can be counted, and not everything that can be counted counts.

  5. #5

    Default Re: Custom Campaign_script whit events

    Quote Originally Posted by Aikanár View Post
    Uhm, you've always one player faction, which is the local faction and all others are AI controled, hence if you want the script to only fire for the faction a human player is playing, regardless of which faction that might be, you only need the condition FactionIsLocal and no further definitions of the faction.
    The other simple way is to use "not IsFactionAIControlled"

    you dont understand, the AI have nothing to do whit the event they ignore it but if you play hotseat and there are more humans they will see the event if you put
    historic_event introduction true , but its only need to work whit the first human faction(ignore AI) how you know what faction you need to put in the historic_event introduction true factions { x, } , what I ask if the way im doing it its the only way cause this way works fine.
    Last edited by wolf-yop; November 16, 2010 at 05:18 PM.

  6. #6
    Aikanár's Avatar no vaseline
    Join Date
    Mar 2009
    Location
    Sanctuary
    Posts
    12,516
    Blog Entries
    3

    Default Re: Custom Campaign_script whit events

    Ah ok hotseat
    So how about making sure it only fires in the first turn?
    I_TurnNumber == 1


    Son of Louis Lux, brother of MaxMazi, father of Squeaks, Makrell, Kaiser Leonidas, Iskar, Neadal, Sheridan, Bercor and HigoChumbo, house of Siblesz

    Not everything that counts can be counted, and not everything that can be counted counts.

  7. #7

    Default Re: Custom Campaign_script whit events

    Quote Originally Posted by Aikanár View Post
    Ah ok hotseat
    So how about making sure it only fires in the first turn?
    I_TurnNumber == 1
    it already works like that, the script terminate in the first player turn but for the event to only fire for the first human faction this is the only way I know to work.

    TNZ: I dont understand what you try to say.

  8. #8

    Icon1 Re: Custom Campaign_script whit events

    Code:
    	monitor_event FactionTurnStart FactionIsLocal
    		and I_TurnNumber = 0
    		historic_event introduction true
       	terminate_monitor
        	end_monitor
    
    	monitor_conditions I_EventCounter introduction_accepted = 1
            	historic_event tiers true
    		set_event_counter introduction_accepted 0 
        	terminate_monitor
        	end_monitor
    
    	monitor_conditions I_EventCounter tiers_accepted = 1
          	 	if I_LocalFaction england
    		add_money england 500
    	end_if
            	if I_LocalFaction france
    		add_money france 500
    	end_if
    		set_event_counter tiers_accepted 0
        	terminate_monitor
        	end_monitor
    
    	monitor_conditions I_EventCounter introduction_declined = 1
    		set_event_counter introduction_declined 0 
        	terminate_monitor
        	end_monitor
    
    	monitor_conditions I_EventCounter tiers_declined = 1
    		set_event_counter tiers_declined 0 
        	terminate_monitor
        	end_monitor

  9. #9
    Aikanár's Avatar no vaseline
    Join Date
    Mar 2009
    Location
    Sanctuary
    Posts
    12,516
    Blog Entries
    3

    Default Re: Custom Campaign_script whit events

    He just posted you, in a way more deliberate way than I did (note to myself: I should do that again, too), the instruction of how you can achieve your goal by adopting your script to his scheme.


    Son of Louis Lux, brother of MaxMazi, father of Squeaks, Makrell, Kaiser Leonidas, Iskar, Neadal, Sheridan, Bercor and HigoChumbo, house of Siblesz

    Not everything that counts can be counted, and not everything that can be counted counts.

  10. #10

    Default Re: Custom Campaign_script whit events

    Quote Originally Posted by Aikanár View Post
    He just posted you, in a way more deliberate way than I did (note to myself: I should do that again, too), the instruction of how you can achieve your goal by adopting your script to his scheme.
    ah, i didnt read it well , but in his way the problem of the event popup to all human faction still do I want to only need to be modified by the first human faction in the first turn.


    say like if you want no mongols in the game you dont need all player to accept this to work.
    Last edited by wolf-yop; November 16, 2010 at 06:17 PM.

  11. #11

    Icon1 Re: Custom Campaign_script whit events

    wolf-yop: Try this:

    Code:
    declare_counter introduction
    
    	monitor_event FactionTurnStart FactionType england
    		and FactionIsLocal
    		and I_CompareCounter introduction = 0
    		historic_event introduction true factions { england, }
    		set_counter introduction 1
       	terminate_monitor
        	end_monitor
    
    	monitor_event FactionTurnStart FactionType france
    		and FactionIsLocal
    		and I_CompareCounter introduction = 0
    		historic_eventintroduction true factions { france, }
    		set_counter introduction 1
       	terminate_monitor
        	end_monitor
    Last edited by TNZ; November 17, 2010 at 05:51 AM.

  12. #12

    Default Re: Custom Campaign_script whit events

    Quote Originally Posted by TNZ View Post
    wolf-yop: Try this:

    Code:
    declare_counter introduction
    
        monitor_event FactionTurnStart FactionType england
            and FactionIsLocal
            and I_CompareCounter introduction = 0
            historic_event introduction true factions { england, }
            set_counter introduction 1
           terminate_monitor
            end_monitor
    
        monitor_event FactionTurnStart FactionType france
            and FactionIsLocal
            and I_CompareCounter introduction = 0
            historic_eventintroduction true factions { france, }
            set_counter introduction 1
           terminate_monitor
            end_monitor
    
        monitor_conditions I_EventCounter introduction_accepted = 1
                historic_event tiers true factions { england, }
            terminate_monitor
            end_monitor
    
        monitor_conditions I_EventCounter introduction_accepted = 1
                historic_event tiers true factions { france, }
            terminate_monitor
            end_monitor
    thanks, then the way I made it its the shortest. I wanted to be sure.

    Code:
        monitor_event FactionTurnStart
    
            set_event_counter introduction_accepted 0
            set_event_counter introduction_declined 0
            set_event_counter tiers_accepted 0
            set_event_counter tiers_declined 0
            
            if I_LocalFaction england
                historic_event introduction true factions { england, }
            end_if
            if I_LocalFaction france
                historic_event introduction true factions { france, }
            end_if
            if I_LocalFaction hre
                historic_event introduction true factions { hre, }
            end_if
            if I_LocalFaction spain
                historic_event introduction true factions { spain, }
            end_if
            if I_LocalFaction venice
                historic_event introduction true factions { venice, }
            end_if
            if I_LocalFaction sicily
                historic_event introduction true factions { sicily, }
            end_if
            if I_LocalFaction milan
                historic_event introduction true factions { milan, }
            end_if
            if I_LocalFaction scotland
                historic_event introduction true factions { scotland, }
            end_if
            if I_LocalFaction byzantium
                historic_event introduction true factions { byzantium, }
            end_if
            if I_LocalFaction russia
                historic_event introduction true factions { russia, }
            end_if
            if I_LocalFaction lithuania
                historic_event introduction true factions { lithuania, }
            end_if
            if I_LocalFaction moors
                historic_event introduction true factions { moors, }
            end_if
            if I_LocalFaction turks
                historic_event introduction true factions { turks, }
            end_if
            if I_LocalFaction egypt
                historic_event introduction true factions { egypt, }
            end_if
            if I_LocalFaction denmark
                historic_event introduction true factions { denmark, }
            end_if
            if I_LocalFaction portugal
                historic_event introduction true factions { portugal, }
            end_if
            if I_LocalFaction poland
                historic_event introduction true factions { poland, }
            end_if
            if I_LocalFaction hungary
                historic_event introduction true factions { hungary, }
            end_if
            if I_LocalFaction aztecs
                historic_event introduction true factions { aztecs, }
            end_if
            if I_LocalFaction papal_states
                historic_event introduction true factions { papal_states, }
            end_if
            
        terminate_monitor
        end_monitor
    
        ;tier rule option
        monitor_event EventCounter EventCounterType introduction_accepted
            and EventCounter > 0    
            
            if I_LocalFaction england
                historic_event tiers true factions { england, }
            end_if
            if I_LocalFaction france
                historic_event tiers true factions { france, }
            end_if
            if I_LocalFaction hre
                historic_event tiers true factions { hre, }
            end_if
            if I_LocalFaction spain
                historic_event tiers true factions { spain, }
            end_if
            if I_LocalFaction venice
                historic_event tiers true factions { venice, }
            end_if
            if I_LocalFaction sicily
                historic_event tiers true factions { sicily, }
            end_if
            if I_LocalFaction milan
                historic_event tiers true factions { milan, }
            end_if
            if I_LocalFaction scotland
                historic_event tiers true factions { scotland, }
            end_if
            if I_LocalFaction byzantium
                historic_event tiers true factions { byzantium, }
            end_if
            if I_LocalFaction russia
                historic_event tiers true factions { russia, }
            end_if
            if I_LocalFaction lithuania
                historic_event tiers true factions { lithuania, }
            end_if
            if I_LocalFaction moors
                historic_event tiers true factions { moors, }
            end_if
            if I_LocalFaction turks
                historic_event tiers true factions { turks, }
            end_if
            if I_LocalFaction egypt
                historic_event tiers true factions { egypt, }
            end_if
            if I_LocalFaction denmark
                historic_event tiers true factions { denmark, }
            end_if
            if I_LocalFaction portugal
                historic_event tiers true factions { portugal, }
            end_if
            if I_LocalFaction poland
                historic_event tiers true factions { poland, }
            end_if
            if I_LocalFaction hungary
                historic_event tiers true factions { hungary, }
            end_if
            if I_LocalFaction aztecs
                historic_event tiers true factions { aztecs, }
            end_if
            if I_LocalFaction papal_states
                historic_event tiers true factions { papal_states, }
            end_if
    
        terminate_monitor
        end_monitor
    Last edited by wolf-yop; November 18, 2010 at 12:46 PM.

Posting Permissions

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