Tristan Administrator
Posts : 306 Join date : 2011-08-03 Location : Liverpool, UK
| Subject: How to equip weapons? Tue 13 Mar - 5:40 | |
| I've used Sampleworld as a basis for my own world, so it should all be configured - if you have a sword in your inventory, how do you equip it, so that it's in the players hand?
| |
|
Delurin Head of Platform Development
Posts : 424 Join date : 2011-08-03
| Subject: Re: How to equip weapons? Tue 13 Mar - 8:51 | |
| (I assume you mean other than the player clicks on the Icon in the backpack) You need to make sure that the Player Model has an entry in the weapon definition - Code:
-
dc = DisplayContext("sword.mesh") dc.setAttachInfo(DisplayState.IN_COMBAT, MarsEquipSlot.PRIMARYWEAPON, MarsAttachSocket.PRIMARYWEAPON) dc.setAttachInfo(DisplayState.NON_COMBAT, MarsEquipSlot.PRIMARYWEAPON, MarsAttachSocket.PRIMARYWEAPON) dcMap = DCMap() dcMap.add(human_female_fantasy_DC, dc) tmpl = Template("Longsword2") tmpl.put(InventoryClient.ITEM_NAMESPACE, InventoryClient.TEMPL_ICON, "Interface\FantasyWorldIcons\WEAPON_sword_A") tmpl.put(InventoryClient.ITEM_NAMESPACE, InventoryClient.TEMPL_ACTIVATE_HOOK, EquipActivateHook()) tmpl.put(InventoryClient.ITEM_NAMESPACE, InventoryClient.TEMPL_EQUIP_INFO, equipInfo) tmpl.put(InventoryClient.ITEM_NAMESPACE, InventoryClient.TEMPL_DCMAP, dcMap) ObjectManagerClient.registerTemplate(tmpl) you need to make sure that for every charater model you have there is: - Code:
-
dcMap.add(human_female_fantasy_DC, dc) it does not have to be the same display context for each one. That way you can have an item that looks different for each character model i.e. dress versus pants if you want | |
|
Tristan Administrator
Posts : 306 Join date : 2011-08-03 Location : Liverpool, UK
| Subject: Re: How to equip weapons? Sat 24 Mar - 3:24 | |
| Ah yeah, I forgot to add the player model to the weapon's template entry! | |
|
Sponsored content
| Subject: Re: How to equip weapons? | |
| |
|