Results 1 to 30 of 82

Thread: alpaca's Script-O-Rama

Threaded View

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

    Default Re: alpaca's Script-O-Rama

    Post 2: Scripting Challenges

    Allright people, this post is for now reserved for what I'd like to call scripting challenges.
    I'll issue these from time to time to instigate research and thoughts about certain scripting problems, or simply to show off when I found out something cool and want to tell everyone how good a scripter I am

    Anyways, here we go with the first challenge:

    Scripting Challenge #1: Re-Emergent factions
    issued on May, 20th 2007

    The task is simple: Create re-emergent factions similar to those you know from the original MTW. I didn't try to do that myself, yet, so I'm not sure if it's possible. If you have a proposition, simply post it in this here thread.
    The best one will be put into the script-o-rama, and I will participate, too.

    Solution:
    alpaca


    The solution to this problem involves two basic steps. The first is to make the would-be emergent faction horde, and the second is to spawn it an army.


    1. Hording

    To make a faction horde, all you have to do is open descr_sm_factions and add some entries that look like those of the Mongols or Timurids:
    Code:
    horde_min_units				10
    horde_max_units				20
    horde_max_units_reduction_every_horde 10
    horde_unit_per_settlement_population	250
    horde_min_named_characters	2
    horde_max_percent_army_stack 80
    horde_disband_percent_on_settlement_capture	0
    horde_unit					Mongol Infantry
    horde_unit					Mongol Foot Archers
    horde_unit					Mongol Heavy Archers
    horde_unit					Mongol Heavy Lancers
    horde_unit					Mongol Light Lancers
    horde_unit					Mongol Horse Archers
    These determine what happens after your faction loses their last settlement, and more importantly, allows it to remain in the code after it died. These are pretty self-explanatory, so let's get to step 2:


    2. Army Spawning

    First of all, you'll find a how-to about spawning above, so I won't explain the code here. What you have to do to have a re-emergent faction is to spawn it an army somewhere on the map with a family member which will re-introduce them to the game. You can see a good example of that by looking at how the guys at CA OZ did it for the Mongols and Tims:
    Code:
    spawn_army 
    			faction mongols
    			character	Jebe, named character, age 30, x 292, y 166, family	;command 8, dread 9, loyalty 7, piety 1
    			traits EasternWarlord 3 , GoodCommander 2 , Bloodthirsty 2 , BattleDread 4 , StrategyDread 2 , PublicFaith 1 , Loyal 2 , ContentGeneral 3	;command 8, dread 9, loyalty 7, piety 1
    			unit		Mongol Bodyguard		exp 6 armour 0 weapon_lvl 0
    			...
    		end
    Notice the bolded "family" keyword which will allow you to set up a faction tree again.

    Ok, that's basically it. Easy, huh?
    There are two main problems with this: Firstly, you will somehow have to determine where to spawn (or move) the faction, unless you want to always spawn them in the same place and secondly, the family members will always have the same names. You can add a bit of randomization which will of course increase the complexity of the code by a fair margin.

    Well, have fun with your newly re-emerging factions




    Scripting Challenge #2: Attrition
    issued on August, 30th 2007

    This one is a very open challenge. I think a large part of the community is looking for the best way to simulate the effect that prolonged campaigns and diseases have on an army (especially a medieval one which would certainly live off the land in a very ruinous fashion). So, let's hear your suggestions! The best propositions will be put in here and if it makes sense I'll write a how-to or an article about it, combining them in some way.
    Last edited by alpaca; 08-30-2007 at 12:49.

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