mortenbroesby Posted July 22, 2014 Share Posted July 22, 2014 Has anyone figured out how to check which item is active / ready to be placed?I am trying to check if the held item has the tag "wallbuilder", but all my testing either crashes the game or does not register true... Link to comment https://forums.kleientertainment.com/forums/topic/38804-check-active-held-item/ Share on other sites More sharing options...
Heavenfall Posted July 22, 2014 Share Posted July 22, 2014 inst.components.inventory:GetEquippedItem(var) var must equal one of global EQUIPSLOTS Link to comment https://forums.kleientertainment.com/forums/topic/38804-check-active-held-item/#findComment-514506 Share on other sites More sharing options...
mortenbroesby Posted July 22, 2014 Author Share Posted July 22, 2014 Thank you HeavenFall In the end, the following worked:local active_item = GLOBAL.GetPlayer().components.inventory:GetActiveItem()if active_item thenif active_item:HasTag("wallbuilder") then... Link to comment https://forums.kleientertainment.com/forums/topic/38804-check-active-held-item/#findComment-514559 Share on other sites More sharing options...
mortenbroesby Posted July 22, 2014 Author Share Posted July 22, 2014 What about hiding the shown hover icon when a placable item is active? For example when a wall is held (active), it shows the wall icon on the cursor. I have been searching the prefabs dry for the base code :/ Link to comment https://forums.kleientertainment.com/forums/topic/38804-check-active-held-item/#findComment-514588 Share on other sites More sharing options...
Heavenfall Posted July 22, 2014 Share Posted July 22, 2014 It is defined in the prefab file using the MakePlacer() function Link to comment https://forums.kleientertainment.com/forums/topic/38804-check-active-held-item/#findComment-514590 Share on other sites More sharing options...
mortenbroesby Posted July 22, 2014 Author Share Posted July 22, 2014 Just to be clear, I am talking about the image that shows here: Not the green silhuette. Sure it's still the MakePlacer I need to look into? Link to comment https://forums.kleientertainment.com/forums/topic/38804-check-active-held-item/#findComment-514613 Share on other sites More sharing options...
Heavenfall Posted July 22, 2014 Share Posted July 22, 2014 Ah no, the makeplacer is for the green thingy. No idea about icon. Link to comment https://forums.kleientertainment.com/forums/topic/38804-check-active-held-item/#findComment-514647 Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now