armors restrictions

正在查看此主题的用户

javico

Veteran
Hi everybody,

I want to know if there is any way to do restrictions for armors. Well, I have differents races that I modified with the gender flag (tf_dwarf, tf_elf, tf_minotaur) and if you are an elf and get a dwarf armor it looks strange, so I want to avoid that, something like skills restrictions.

Thanks
 
thank you for your answers, :roll:

I have write this trigger that check if you have equip the armor:
插入代码块:
(0.0, 0, 0.0, [], [	(try_for_range, ":cur_slot", 0, 8),
						(troop_get_inventory_slot, ":cur_item", "trp_player", ":cur_slot"),
						(eq, ":cur_item", itm_dwarf_armor),
						(display_message,"str_have_dwarf_armor"),
					(try_end),]),

But how can I unequip it?
 
Look in header_operations.py. There are more functions that you can use:

player_has_item
troop_has_item_equipped
troop_remove_items
troop_add_item
troop_equip_items

For battle/scene, there are functions for agent.

I have never done anything like this, so I don't know the details.
 
There are already restrictions for armors. Somewere there is a script that cheks the attributes. Maybe you can find it, and change it's conditions to troop flags.
 
I have do a trigger that unequip the armor but it doesnt work with the game in pause :neutral: I havent found tthe script that control those restrictions are you sure of that? If you have found it can you tell me where?
 
I am not a coder, so I will not serve you with scripts. All I know that you can not equip some armors, if you have not enough strenght. That is sure. If you find that code, probably you can change it to check the agent's troop flag, not the strenght. If it woks, it will not allow you to equip items of differing races, then there will no need to unequip them. Do not that what you need?

I would have a god use of that scipt too, so I will looking for that too.
 
Yes, that is what I want but I cant find that script. I continue serching if find it I will tell you
 
The strength requirement (difficulty) is in the module_items.py. It is assigned for each item. I believe that the item difficulty check is hard coded (not in a script).
 
That's what I though, so I was asking if there is another way to do that or it's only possible with triggers that work with game timer. I have seen that items have an optional argument that says trigger, do you know how it works?
插入代码块:
#  Each item record contains the following fields:
#  1) Item id: used for referencing items in other files.
#     The prefix itm_ is automatically added before each item id.
#  2) Item name. Name of item as it'll appear in inventory window
#  3) List of meshes.  Each mesh record is a tuple containing the following fields:
#    3.1) Mesh name.
#    3.2) Modifier bits that this mesh matches.
#     Note that the first mesh record is the default.
#  4) Item flags. See header_items.py for a list of available flags.
#  5) Item capabilities. Used for which animations this item is used with. See header_items.py for a list of available flags.
#  6) Item value.
#  7) Item stats: Bitwise-or of various stats about the item such as:
#      weight, abundance, difficulty, head_armor, body_armor,leg_armor, etc...
#  8) Modifier bits: Modifiers that can be applied to this item.
#  9) [Optional] Triggers: List of simple triggers to be associated with the item.
 
后退
顶部 底部