Results 1 to 30 of 82

Thread: alpaca's Script-O-Rama

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #31
    Notepad user Member Red Spot's Avatar
    Join Date
    Apr 2007
    Location
    The Netherlands
    Posts
    491

    Default Re: alpaca's Script-O-Rama

    I pretty much did the script and more, I'll just go and double post again to show it to whoever wants to read it, imo it uses some nice trickery that could be usefull to others ...

    it uses some trickerey to figure out if a faction exists or not, basicly it just resets a variable(counter) and sets it when the faction has a turn(and thus exists) and so knows that every faction that did not set the var. does not exist ..

    Code:
    ;SET FOLLOWING EVENT IN DESCR_EVENTS TO KICK-START THE RESPAWNING!!!
    ;faction_respawn_trigger
    
    ;Interval set at 40-80 years -> 80-160 turns.
    ;faction_respawn_event  ==> global spawn starter event
    
    ;faction_respawn_england  ==> per faction spawn event
    
    ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
    ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
    ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
    script
    
    declare_counter faction_exists_england
    
    ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
    ;;;COPY FOR OTHER FACTIONS!!!
    	monitor_event FactionTurnStart FactionType england
    		and Treasury <= 10000
    
    		if I_LocalFaction england
    			terminate_monitor
    		end_if
    		console_command add_money england, 12000
    	end_monitor
    ;;;
    ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
    ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
    ;;;COPY FOR OTHER FACTIONS!!!
    	monitor_event FactionTurnStart FactionType england
    		and I_EventCounter faction_respawn_event == 1
    
    		set_counter faction_exists_england 1
    	end_monitor
    ;;;
    ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
    ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
    ;;;COPY FOR OTHER FACTIONS!!!
    	monitor_event EventCounter EventCounterType faction_respawn_england
    		and EventCounter >= 1
    
    		spawn_army 
    			faction england
    			character	William, named character, age 30, x 100, y 150, family
    			traits GoodCommander 2 , Loyal 2
    			unit		NE Bodyguard			exp 2 armour 1 weapon_lvl 1
    		end
    		spawn_character england Laurence Bidell, diplomat, age 42, x 101, y 150
    		spawn_character england Richard, spy, age 36, x 99, y 150
    	end_monitor
    ;;;
    ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
    ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
    	monitor_event EventCounter EventCounterType faction_respawn_trigger
    		and EventCounter >= 1
    
    		add_events
    			event	counter	faction_respawn_event
    			date	2
    		end_add_events
    			terminate_monitor
    	end_monitor
    ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
    ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
    	monitor_event EventCounter EventCounterType faction_respawn_event
    		and EventCounter >= 1
    
    		if I_EventCounter faction_respawn_event == 1
    ;;;
    ;;;COPY FOR OTHER FACTIONS!!!
    			set_counter faction_exists_england 0
    ;;;
    ;;;
    			add_events
    				event	counter	faction_respawn_event
    				date	2
    			end_add_events
    		end_if
    
    		if I_EventCounter faction_respawn_event == 2
    ;;;
    ;;;COPY FOR OTHER FACTIONS!!!
    			if I_CompareCounter faction_exists_england == 0
    				add_events
    					event	counter	faction_respawn_england
    					date	3 25
    				end_add_events
    			end_if
    ;;;
    ;;;
    		set_event_counter faction_respawn_event 0
    		add_events
    			event	counter	faction_respawn_event
    			date	38 78
    		end_add_events
    		end_if
    	end_monitor
    ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
    	wait_monitors
    
    end_script
    ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
    ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
    ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

    G
    Last edited by Red Spot; 08-13-2007 at 15:34.

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Single Sign On provided by vBSSO