Teleport Device

Hello, I am currently working on a map and was wondering how to make a device (Barrier and spawn pads) be spawned/teleport to where a player is eliminated.

Thank you.

    OnPlayerEliminated(Agent:agent):void=
        if(FortCharacter:=Agent.GetFortCharacter[]):
            if(Barrier.TeleportTo[FortCharacter.GetTransform()]):
                Print("Barrier Teleported")
            if(Spawner.TeleportTo[FortCharacter.GetTransform()]):
                Print("PlayerSpawner Teleported")
1 Like

Hello, thank you i really appreciate your help. I have one question? Is there anything i have to change in the code like the name of the device Ex) Barrier Device 2. same for spawn pad. and do i just place this in a verse device? Thank you so much

@Mineblo

OK so I need to get in a mind frame for heading towards verse learnage…

Do we use @editables to put these devices into the verse code to use them.
and if we use an array with this the naming relates to the position in the array the device is at ?

1 Like

ok so to “connect” devices with your code you need to use either editables or gameplay tags.

When you make an @editable it will show on your device like this,


On the left it’s the name that they use/I’ll have to use in the code to refer to them.
on the right you pick the value/device and in the case of arrays device(s)

If it’s a singular device you can just straight up call it and run functions on it.
But if it’s an array you need to either do something like

if(MYTELEPORTER:=T1Teleporters[0]):
    MYTELEPORTER.Disable()

In this ^ one it will only disable the teleporter thats on the first index of the array and will only run IF a teleporter is there

for(MYTELEPORTER:T1Teleporters): 
    MYTELEPORTER.Disable()

This ^ will run for every teleporter placed in the array and disable it

1 Like

Excellent, that makes sense, much appreciated

1 Like

Gameplay tags are great instead of arrays but they are not guaranteed to be ordered like an array is. ie an array index 0 is always index 0 a tag list could change but if you don’t care about that its highly useful. One of the best uses i found is for calling other verse devices without the potential for any device infinity looping errors.

1 Like

hello, Thanks but im a little new. how exactly do i get a verse device or set up anything. thank you.

in verse it says theres a lot of errors

The errors are : Unknown identifier agent. Did you forget to specify using { /Verse.org/Simulation }?

Unknown identifier Barrier.

Unknown identifier Spawner.

copy using { /Verse.org/Simulation } in the top of your code

Thank you . Im am verry confused that is my code what seems to be the problem?

This is what it looks like

Your code should be looking like this. lines of using at the top

then the creative_device class where inside it you will have your functions like onplayereliminated. and also you need to define an @editable for the spawner and the barrier, along with connecting the function to an event probably from the OnBegin function

OK. this all very confusing for me, I’m kind of new to uefn/verse and a trying to learn. could you maybe give me an example or type the code out. Thanks i really apricate the help.

Up top of the code is the “using { }” parts,
they let your code know which “modules” need to be referenced by your code.
So when you want to use Barriers and Spawners in your code,
your code needs the using { /Verse.org/Simulation } which contains the information for it to deal with Barriers and Spawners.

Similarly the different things you put in a code, need the appropriate using{ } that, that thing uses.

In your code the agent is also red underlined, so you need to find out what module that comes from and add up there to.

At this stage the first two lines of your code should be

  • using {whatever module agent is in}
  • using { /Verse.org/Simulation }

the next part should be your verse device where you put all the code for it in.

  • Scrimline :- class(creative_device):

Now you need to know which barriers and spawners you’ll be using from your map, this is done by using the @editable and going into your map and selecting them with your verse device, see Mineblo’s answer at post 5.

Then maybe you need to use the OnBegin part, but I’m a bit too nooby to advise on this

Then maybe you can put in the code from your Post 13 pic, but using the names of the barrier and spawner defined by your @editable part.

1 Like

ok Thank you