treebeard Nemisis
Posts : 740 Join date : 2010-09-12 Age : 51 Location : CA
| Subject: Coding Assignments Thu Jun 02, 2011 6:36 pm | |
|
Last edited by Timaaagh on Fri Jun 10, 2011 8:24 am; edited 6 times in total (Reason for editing : updated nohseru tree) | |
|
Timaaagh Thought Warden
Posts : 143 Join date : 2010-06-08 Location : Muskegon, Michigan
| Subject: Re: Coding Assignments Wed Jun 08, 2011 12:59 pm | |
| What do you mean by defs? The ID, "p4_nohseru_warden", or the other things that I don't know what to call, tf_mounted|tf_guarantee_horse|tf_guarantee_awsomeness...etc? | |
|
treebeard Nemisis
Posts : 740 Join date : 2010-09-12 Age : 51 Location : CA
| Subject: Re: Coding Assignments Wed Jun 08, 2011 8:40 pm | |
| - Timaaagh wrote:
- What do you mean by defs? The ID, "p4_nohseru_warden", or the other things that I don't know what to call, tf_mounted|tf_guarantee_horse|tf_guarantee_awsomeness...etc?
Oh, I meant troop definitions as in the whole troop declaration. It includes all the fields of the troop. We may want to update them even if they are listed as finished (- reagrding what they wear and their attributes, skills and weapon proficiencies. I'd like to use the wpe (for regular troops, lors and leaders) and wpex functions (for companions, because the companions can be freely equipped by the player). To accommodate Mordred's base tier + faction modifier + troop line modifier there is a new function in the SVN module troops that I uploaded. It looks like this (thanks MV for helping): - Code:
-
def add_attr(x,y,z): n=0 totalstr = x[0] + y[0] + z[0] totalagi = x[1] + y[1] + z[1] totalint = x[2] + y[2] + z[2] totalcha = x[3] + y[3] + z[3] totallevel = x[4] + y[4] + z[4] n|= strength(totalstr) n|= agility(totalagi) n|= intelligence(totalint) n|= charisma(totalcha) n|= level(totallevel) return n To use it we create lists like for example: - Code:
-
#new attribute list: [str,agi,int,cha,lvl]: tier_10_base_attr = [30,24,12,12,40]
#new faction modifiers lists [str,agi,int,cha,lvl]: melitine_attr_modifiers = [-1,1,0,0,0]
#new line modifiers lists [str,agi,int,cha,lvl]: rollingthunder_attr_modifiers = [2,0,3,3,5] and then in the troop's definition where it says for example: sold_attrib_8 we can instead use: add_attr(tier_10_base_attr,melitine_attr_modifiers,rollingthunder_attr_modifiers) This can be applied to troops that need this kind of definition. In header_troops we add this: - Code:
-
def strength(x): return (((bignum | x) & 0xFF) << 0)
def agility(x): return (((bignum | x) & 0xFF) << 8)
def intelligence(x): return (((bignum | x) & 0xFF) << 16)
def charisma(x): return (((bignum | x) & 0xFF) << 24) In the add_attr(x,y,z) function we could also add cap values so that minimum can't be lower than 3 and maximum can't be higher than 30. This code is a bit tentative currently because I'm not sure if we will benefit from using it. But it perhaps allows for easier troop defining and easier balancing. Also it would allow for making changes in one place that subsequently affects a whole faction (if the faction modifier constant list is changed for example). | |
|
Timaaagh Thought Warden
Posts : 143 Join date : 2010-06-08 Location : Muskegon, Michigan
| Subject: Re: Coding Assignments Thu Jun 09, 2011 9:50 am | |
| Ah, that's nifty. That will definitly make troop attributes easy.
As for the troops. I have done the renames and troop trees for ashenborn, melitine, and nohseru (this included some changes in scripts and party templates b/c of the name change). So should I change the coding status back to "nearly finished", since I didn't do equipment and stats? | |
|
treebeard Nemisis
Posts : 740 Join date : 2010-09-12 Age : 51 Location : CA
| Subject: Re: Coding Assignments Thu Jun 09, 2011 1:38 pm | |
| - Timaaagh wrote:
- Ah, that's nifty. That will definitly make troop attributes easy.
As for the troops. I have done the renames and troop trees for ashenborn, melitine, and nohseru (this included some changes in scripts and party templates b/c of the name change). So should I change the coding status back to "nearly finished", since I didn't do equipment and stats? Yeah, let's have the status at nearly finished. | |
|
Sponsored content
| Subject: Re: Coding Assignments | |
| |
|