SandMouseAnarchy Posted February 21, 2019 Share Posted February 21, 2019 (edited) Im trying to get a script to find if the player has grenades equipped, and if so - which type of grenade.But i cant really figure it out. im testing this bit of script at the moment but it isnt recognising when grenades are equipped... Scriptname Grenade_SM_Equip extends ObjectReference Event OnEquipped(Actor akActor) if akActor == Game.GetPlayer() if (akActor.GetEquippedItemType(0) == 11) debug.notification("grenades equipped 0") elseif (akActor.GetEquippedItemType(1) == 11) debug.notification("grenades equipped 1") else debug.notification("cant find grenades slot") endif endif endevent Right now in game I equip grenades but I only get the last debug notification. Can anyone help with this one? Edited February 22, 2019 by SandMouseAnarchy Link to comment Share on other sites More sharing options...
DieFeM Posted February 22, 2019 Share Posted February 22, 2019 Use string concatenation to get the values: Event OnEquipped(Actor akActor) If akActor == Game.GetPlayer() Int i = 0 Int last = 15 String ResultMessage = "" While i <= last ResultMessage += "akActor.GetEquippedItemType(" + i + ") == " + akActor.GetEquippedItemType(i) + "\n" i += 1 EndWhile Debug.MessageBox(ResultMessage) EndIf Endevent Link to comment Share on other sites More sharing options...
SandMouseAnarchy Posted February 22, 2019 Author Share Posted February 22, 2019 Thankyou DieFeM!! thats really helpfull, i didnt even realise there were 15 equip slots hahaha, thankyou very much mate :) Link to comment Share on other sites More sharing options...
DieFeM Posted February 22, 2019 Share Posted February 22, 2019 I do not know how many slots there are so I've used 15 just to make sure it shows every slot it might have.You can check for whatever slot number you want. Link to comment Share on other sites More sharing options...
SandMouseAnarchy Posted February 22, 2019 Author Share Posted February 22, 2019 Ah I see, thanks mate :) I think I read on a wiki that there are just 2 slots (0 and 1) but I've just ran your script and it turns out frag grenades atleast are in slot 2, that same wiki said grenades were type 11, but after running your script it turns out that grenades are type 10. So who knows ^.^ Thanks again DieFeM Link to comment Share on other sites More sharing options...
DieFeM Posted February 22, 2019 Share Posted February 22, 2019 I guess 0 and 1 are for left and right hand respectively (or vice versa) and 2 is for both. Note that the engine has the ability to equip 2 weapons at the same time, but that's only used in TES, not in Fallout. But there are weapons that use both hands, so you can know in what hand you equipped the weapon, or if it needs both hands to equip it. About the index for the weapon type, maybe it was borrowed directly from TES wiki, who knows... Link to comment Share on other sites More sharing options...
SandMouseAnarchy Posted February 22, 2019 Author Share Posted February 22, 2019 Ah, a 2 hand slot, Yeh that makes a lot of sense ^.^ and Yeh I'm also thinking it must have been leftover info from TES Link to comment Share on other sites More sharing options...
Recommended Posts