Results 1 to 30 of 82

Thread: alpaca's Script-O-Rama

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Harbinger of... saliva Member alpaca's Avatar
    Join Date
    Aug 2003
    Location
    Germany
    Posts
    2,767

    Default Re: alpaca's Script-O-Rama

    Quote Originally Posted by BozosLiveHere
    ER said that there is a destroy_unit command in Kingdoms, maybe now the problem will become trivial.
    Which problem? Being able to destroy buildings doesn't help us in the least with attrition

  2. #2

    Default Re: alpaca's Script-O-Rama

    destroy_unit - but as you mentioned that takes out an entire unit rather than reducing the number of men in a unit (which would be the desired result).
    Epistolary Richard's modding Rules of Cool
    Cool modders make their mods with the :mod command line switch
    If they don't, then Cool mod-users use the Mod Enabler (JSGME)
    Cool modders use show_err
    Cool modders use the tutorials database Cool modders check out the Welcome to the Modding Forums! thread Cool modders keep backups Cool modders help each other out

  3. #3
    Harbinger of... saliva Member alpaca's Avatar
    Join Date
    Aug 2003
    Location
    Germany
    Posts
    2,767

    Default Re: alpaca's Script-O-Rama

    Whoops sorry I was overjoyed at the prospect of being able to destroy buildings so I misread it

  4. #4

    Default Re: alpaca's Script-O-Rama

    Re-Emergent factions
    I realize this thread (on this site at least) is pretty much dead, but I figured I'd still put this out there.

    A problem (depending on the intentions of the script writer of course) with your solution is that a random horde will spawn when the last city is captured if any family member still lives.

    If you only want your scripted army to appear at your designated time change
    horde_min_units 10
    horde_max_units 20
    horde_max_units_reduction_every_horde 10
    horde_min_named_characters 2
    to
    horde_min_units 0
    horde_max_units 0
    horde_max_units_reduction_every_horde 0
    horde_min_named_characters 0
    I'm not sure if they all have to be 0, but I know this works.
    This way the faction will die normally, but still remain in the code to be revived at a later date.

    This will record as an error in the log
    14:56:45.739 [script.err] [error] Script Error in medimod/data/descr_sm_factions.txt, at line 22, column 32
    file: "descr_sm_factions.txt": horde_min_units should be nonzero!
    but otherwise causes no problems.

    It is also a good idea to script in neutrality with all factions at the point of death as, because they are still present, thier relations (stance and faction standing) prior to death is still remembered by other AI factions. Thus, if you kill a factions you will always be considered 'AtWar' with them even though they are dead. This also causes some complications on re-birth as the horde AI is uncontrolable and will not consider previous relations until a setlment is occupied.

  5. #5
    CeltiberoRamiroI Member Monkwarrior's Avatar
    Join Date
    Apr 2004
    Location
    Salduie/Caesaraugusta/ Sarakusta/Saragossa
    Posts
    828

    Default Re: alpaca's Script-O-Rama

    Just in case it is useful for somebody, I report here a method to start the campaign in the middle of the initial year, instead of at the beginning.

    Let's say we want a 12 turns per year campaign, but it must start in September of 1212.

    We use alpaca's script modified in this way:
    Code:
    declare_counter season_counter
    		set_counter season_counter 9
    
    monitor_event FactionTurnStart FactionIsLocal
    	inc_counter season_counter 1
    	
    	; 0 equals winter
    	if I_CompareCounter season_counter == 0
    		console_command season winter
    	end_if
    	if I_CompareCounter season_counter > 0
    		console_command season summer
    	end_if
    	; Reset the counter on the autumn turn so that it'll be 0 next turn
    	if I_CompareCounter season_counter == 11
    		set_counter season_counter -1
    	end_if
    end_monitor
    But the year (seen using show_hud_date = true configuration option) will change in turn 12, not in turn 4. For this purpose we must add new options:
    Code:
    declare_counter season_counter
    		set_counter season_counter 9
    declare_counter year_counter
    		set_counter year_counter 0
    
    monitor_event FactionTurnStart FactionIsLocal
    	inc_counter season_counter 1
    	
    	; 0 equals winter
    	if I_CompareCounter season_counter == 0
    		console_command season winter
    	end_if
    	if I_CompareCounter season_counter > 0
    		console_command season summer
    	end_if
    	; Reset the counter on the autumn turn so that it'll be 0 next turn
    	if I_CompareCounter season_counter == 11
    		set_counter season_counter -1
    	end_if
    
    		if I_CompareCounter season_counter == 0
    			inc_counter year_counter 1
    		end_if
    
    		if I_CompareCounter year_counter == 1
    			console_command date 1213
    		end_if
    
    		if I_CompareCounter year_counter == 2
    			console_command date 1214
    		end_if
    ; more lines are needed depending on the duration of the campaign.
    
    end_monitor
    I've used this system in the first tests of a campaign with 50 turns per year, beginning in the 34 turn of the first year, and it works (only tested the first "New Year Event").

  6. #6
    Member Member anweRU's Avatar
    Join Date
    Jan 2009
    Location
    Bangor, ME
    Posts
    342

    Default Re: alpaca's Script-O-Rama

    I'd like to set a script similar to the very first script in this thread, i.e. adding money to a faction that captures a settlement. However, I want to add a different set of conditions:

    For example, consider Jerusalem:
    If a Catholic faction captures Jerusalem from a Muslim faction, it gets bonus money.
    Otherwise, it doesn't.
    If a Muslim faction captures Jerusalem from a Christian faction, it gets bonus money.
    Otherwise, it doesn't.

    So I need to check the faction that owned the settlement before its capture. Also, would I need to repeat this script for every faction, i.e. Moors, Egypt & Turks for the Muslims, and England, etc. for the Catholic?
    Ancestry: Turkish & Irish. Guess my favorite factions!

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