Official Community Forums
 
HomeHome  FAQFAQ  SearchSearch  MemberlistMemberlist  UsergroupsUsergroups  RegisterRegister  Log in  The Wiki  Website  github Project  

Share | 
 

 How to equip weapons?

View previous topic View next topic Go down 
AuthorMessage
Tristan
Administrator
Administrator
avatar

Posts : 306
Join date : 2011-08-03
Location : Liverpool, UK

PostSubject: 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?
Back to top Go down
http://www.3dmodeller.info
Delurin
Head of Platform Development


Posts : 424
Join date : 2011-08-03

PostSubject: 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
Back to top Go down
Tristan
Administrator
Administrator
avatar

Posts : 306
Join date : 2011-08-03
Location : Liverpool, UK

PostSubject: 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!
Back to top Go down
http://www.3dmodeller.info
Sponsored content




PostSubject: Re: How to equip weapons?   

Back to top Go down
 
How to equip weapons?
View previous topic View next topic Back to top 
Page 1 of 1
 Similar topics
-
» Secondary weapons for hammerhead
» Heavy Close Combat weapons
» Fallout:NV favorite weapons
» Devastator squad weapons
» Castle Hollermann - Weapons Sprites

Permissions in this forum:You cannot reply to topics in this forum
 :: Development :: Client Scripting and Development-
Jump to: