Here's a little piece of
useless crap code for anyone interested.
I am a weird person, and I mostly want my items' codes to fit on one line. But long
Code:
[color=navy]head_armor(0)|body_armor(26)|leg_armor(14)[/color]
definitions ruin everything. That's why I used by pathetic Python skills to make myself a custom function that shortens it up. Here it is.
To use, dump this near the top of module_items (or header_items, but I won't recommend that) around the imodbits_* definitions. This is the real function.
Code:
def hbl_armor(x, y, z):
return head_armor(x)|body_armor(y)|leg_armor(z)
Now, everytime you want to use a shorter protection definition, you just use
Code:
[color=navy]hbl_armor(x, y, z)[/color]
, where x, y and z are the values for head armour, body armour and leg armour respectively.
And here's a working example from my own ModSys:
module_items.py said:
Code:
["sirath_lht_armor", "Sirathean Light Armour", [("heraldic_armor_new_b",0)], itp_sell|itp_armor|itp_covers_legs, 0, 1100, weight(12)|abundance(100)|[color=navy]hbl_armor(0,26,14)[/color]|difficulty(4), imod_lht_armor,[(ti_on_init_item, [(store_trigger_param_1, ":agent_no"),(store_trigger_param_2, ":troop_no"),(call_script, "script_shield_item_set_banner", "tableau_heraldic_armor_b", ":agent_no", ":troop_no")])]],
Yeah, I allow for heraldic placeholder-meshed items to occupy two lines of screen space. But no other exceptions!
Enjoy and have fun. If you even read/use this, which I doubt you will. The former you may do, but the latter? I wouldn't count on it.
P.S.: If, by any chance, you notice that there are
and
in the above code, that's because I defined them to be equal to itp_merchandise and itp_type_body_armor respectively. They were too long.