Original autoloot thread by fisheye:
http://forums.taleworlds.net/index.php/topic,50883.0.html I had adjusted autoloot. Reorganized how NPCs will choose their loots, they will accord to the
performance instead of the
price.
source:
http://www.mbrepository.com/modules/PDdownloads/singlefile.php?cid=4&lid=1163Updated on 3-25, 2009:
Minor fix on judgement of Two-handed/One-handed weapons.
10:41:46 pm
Minor fix on judgement of Two-handed/One-handed weapons again.
Updated on 3-24, 2009:
Create a independent classified for Two-handed/One-handed weapons. They didn't subordinate to Two-handed weapons any more.
Well, I also did some necessary additions in module_dialogs.py and module_strings.py this time.
Now,The archive only contains 5 files, we need not to change module_items.py and process_items.py any more, so there is no need to include them. module_dialogs.py, module_game_menus.py and module_strings.py are the same as fisheye's. The most great changes by me is in module_scripts.py, in addition module_constants.py contains some slots definitions by me.
I used some actual PYTHON code. Such as:
def set_item_difficulty():
item_difficulty = [] # create an empty list: item_difficulty
for i_item in xrange(len(items)): # do a loop in the list items
item_difficulty.append((item_set_slot, i_item, slot_item_difficulty, get_difficulty(items[i_item][6]))) # append Module System sentences to the list
return item_difficulty[:] # return the whole list with all Module System sentences above
# the function get_difficulty is already defined in header_items.py, I just call it here.
It was used to set items' difficulties. Then we can use (item_get_slot,<destination>, <item_id>, slot_item_difficulty) to get items' difficulties easily.
Of course we also need to add some code to call this PYTHON function.
First we need to add the flowing script to call it.
("init_item_difficulties", set_item_difficulty()),
Then add the flowing to the script of game_start to call the script of init_item_difficulties.
(call_script, "script_init_item_difficulties"),
I almost forget that, you must define slot_item_difficulty in module_constants.py before you use it.
Well, I will start a new topic to discuss how to use some simple PYTHON functions in MNB Module System later, I think it will be a great help to your MOD development.