I’ve made a container added some functionnalities to it but i cannot figure how to make some work
i’ve got :
The engram entry
The primal Item
A primal Inventory as componenent
the BP Actor
an other static mesh as component
I wanted the structure to be build only if the player is in a tribe :
-i first try to do it in the BP “On Begin Play” but my cast to player state failed
then look for a way to disable the use of PrimalItem in inventory but no event seem to be called
i can toggle visibility of my supp mesh component through multiuse entry, but i wanted it to toggle when the inventory is empty or not
I can do it on “Tick Event” and get the length of the inventory but i’ld prefer to trigger it when there is a change in the inventory Add or Remove but I cannot find something like that
how can i add a prevent build reason? and what is the node that should be used to send notification to the player?
the 2 new reasons are “only one structure/tribe” and “Owner isn’t in tribe” (I put it in “prevent build structure reason string overrides” of BP options)
When we use the PrimalItem it spawn the “preview” i don’t know how to change the conditions of this one so I made a get all actor of class, get length and destroy actor (that destroy the preview actor) if length>1
doing so i get the “only one structure/tribe” notification but i don’t really understand why
You can hide this inside of BPGetMultiUseEntries. This ticks like every frame and executes on the client. Just throw the check in there for an empty inventory inside of the BP Actor. Also, how are you going to add more items to an empty inventory if it’s hidden?
2)the inventory is always visible, my dev kit is not lunch yet, i’ll add some pictures, but only some components are hidden/visible depending on inventory
i can do this like this : Event Tick → get PrimalInventory → get length → Branch =0 → Get my component → set visibility hidden/visible
but it will be better to trigger it when an item is add or remove from inventory then check every frame
This way you’re just checking two variables per frame, and not actually changing anything except for that 1 frame that it changes. Something to note: this might only work outside of the inventory, so you won’t see the change when you’re remote viewing.