I’m trying to learn Verse scripting for UEFN and right now I’m trying to create a new resource-giving prop/actor/object (let’s just call it a prop). What I wonder is what a good way to go about it is, and how using devices on your object works.
First of all, which of these is better: to have “manager devices” that handles specific event types, like a device/script that collects all objects with a specific tag OnBegin and adds a listener for each object and then handles the signals. Or is it better to have a script on each prop and let it handle it’s own logic?
I’m also wondering how I’m supposed to reference the prop_manipulation_device from my own verse script?
My in-editor structure is that I have a prop and then I drag a script into the level and then drag it under my prop to attach it, then I do the same with a promp_manipulation_device. Am I supposed to make an editable reference in my own verse script and then select the prop_manipulation_device in order to reference it?
The code I’ve tried is:
mining_node := class(creative_device):
# Runs when the device is started in a running game
@editable
PropMan:prop_manipulator_device = prop_manipulator_device {}OnBegin<override>()<suspends>:void= PropMan.DamagedEvent.Subscribe(OnDamaged) OnDamaged(Agent : agent) : void= Print("damaged")
But that doesn’t seem to work at all. Could someone give me a heads up on this? Also even with the prop_manipulation_device it doesn’t seem as if I can destroy the prop.