ObieDwyer Posted July 25, 2014 Share Posted July 25, 2014 I'm working on a script that needs to know what kind of weapon a player is holding. I've tried using a formlist filled with keywords to determine if an equipped weapon is one-handed or not, but I think a simpler and more compatible method would be to determine whether the weapon uses 1 handed or 2 handed animations. I recall there being a condition that asks what kind of animations a weapon is using (something along the lines of GetWeaponAnimType) but I was wondering if there is a command (or at least some work around) that can be used in a script? Link to comment Share on other sites More sharing options...
IsharaMeradin Posted July 25, 2014 Share Posted July 25, 2014 SKSE function: GetWeaponType Link to comment Share on other sites More sharing options...
DDProductions83 Posted July 25, 2014 Share Posted July 25, 2014 Or if you dont want to slave it to skse O.o http://www.creationkit.com/GetEquippedItemType_-_Actor Sorry Ish not a fan of slaving to something if theres no need :P Link to comment Share on other sites More sharing options...
ObieDwyer Posted July 25, 2014 Author Share Posted July 25, 2014 (edited) I couldn't get either of those to work for some reason. It keeps saying that "(GetWeaponType/GetEquippedItemType) is not a function or does not exist" Script Fragment: Event OnObjectEquipped(form akBaseObject , ObjectReference player) if akBaseObject.GetWeaponType() == 1 Debug.MessageBox("1h weapon equip") else Debug.MessageBox("Untrue weapon equip") endif endevent I just get these two error messages: (10,16): GetWeaponType is not a function or does not exist(10,32): cannot compare a none to a int (cast missing or types unrelated) I still get those same messages if I use:if (player.GetEquippedItemType(1) == 1) Does it matter that the script is extending ReferenceAlias? Edited July 25, 2014 by Cdr248 Link to comment Share on other sites More sharing options...
DDProductions83 Posted July 25, 2014 Share Posted July 25, 2014 /facepalm the way you are defining player it is a OBJECTreference The command getequippeditemtype can only be ran on a ACTOR ------------- For instance, this compiles, dont know if it works correctly but it sure as hell compiles :P--- Event OnObjectEquipped(form akBaseObject , actor player) if (player.GetEquippedItemType(0) == 7) DO mah crap! endifendevent The more assured way is to run the function as ----if (game.getplayer().getequippeditemtype(1) ==1) Link to comment Share on other sites More sharing options...
IsharaMeradin Posted July 25, 2014 Share Posted July 25, 2014 The problem is that you are not using either function correctly Event OnObjectEquipped(form akBaseObject , ObjectReference player) if player.GetEquippedItemType() == 1 Debug.MessageBox("1h weapon equip") else Debug.MessageBox("Untrue weapon equip") endif endevent OR Event OnObjectEquipped(form akBaseObject , ObjectReference player) if (akBaseObject as Weapon).GetWeaponType() == 1 Debug.MessageBox("1h weapon equip") else Debug.MessageBox("Untrue weapon equip") endif endevent Link to comment Share on other sites More sharing options...
Recommended Posts