Copying and move devices in verse code

Hello,

is there any verse functionality to copy devices at runtime, so that i have to create only one device and copy and move it to any position that i want it to be?
The reason is that i don’t want to create all these devices manually in the editor.

Does someone know more about it? :slight_smile:

1 Like

Hi.
I am not sure about copying, but you can certainly spawn in devices and props. You could program a trigger or button or action to do so by way of the devices themselves or by using Verse code.
Something like this:

And the devices or props could be teleported or moved or spawned to whatever location you wanted.

Could you clarify on what it is exactly that you want to achieve?

I want to do this same thing too! My example is I have set up one collectible device with its own mesh and parameters in the details tab. I also set up a custom sound effect upon collection. The collectible is serving as an item box and the player gets one random item when they collect it.

I would like to essentially reference that one collectible device already set up and place them around my map at positions I marked out with beacons (and I would use tags for those). The beacons act more or less like empty objects or visual placeholders since they won’t be seen by players in game.

This is doable through teleporting empty creative props that have Collectable devices attached to them, like this:
image

You can’t just reference one collectible device, you’ll need one for each teleporter. However, you can select all collectible devices at the same time to change all of their settings together.

If the beacons serve no purpose I recommend also using empty props for the locations you want the collectibles to teleport to

Tag all of your empty teleporter props with something like Collectible_Teleporter, and tag all your location props with collectible_location.

You can then FindCreativeObjectsWithTag for the teleporters and locations and cast them all to creative_prop so you can use TeleportTo. Now you have arrays of teleporters and locations, you can then iterate through and teleport each collectible to a location

thanks for the reply and thoughts! I started doing a compromise and doing a version of this; I made a set of 30 “normal” collectibles and 10 “special” collectible objects that will start out hidden and away from the active playing area. Then when I need them to “spawn” into the level, I teleport and unhide them, like you were kind of mentioning. In verse I am storing the object and original location info together with classes.

One question, do empty props have a visual to them in the editor, so we can click or interact with them in the editor only?

I still think it could be more modular and nice if we could issue one built-in Fortnite device as the ‘blueprint’ or like a class in verse, so if we need to make changes we only need to change that original blueprint instead of many copies. And then that blueprint/class device can instantiate that object throughout the level. It gets kind of messy when you have to copy their triggering events or stuff that don’t copy over from duplicating (onCollected event I think it was), but I’m learning to handle more of this through verse than the details interface tab.

empty props can be selected from the outliner and moved around the editor. The ultimate solution would be allowing us to dynamically spawn devices, but that still seems far out and I understand why they don’t let us right now, bad programming would lead to lots of crashes and memory leaks.

Also you can copy events! just right click on the event in details panel, copy, and select all the ones you’d like to apply to and paste. However, a better way would be subscribing to all tagged device events in Verse.

2 Likes

Omg I love this forum hahaha I learn something new every time I look!!! And there’s still so much more for me to learn. Thanks so much for sharing those tips! And yeah I imagine there would be potential for issues with letting us dynamically spawn and do our own garbage collection. Maybe with some good documentation and tutorials hopefully it can be reduced!