Search in
Sort by:

Question Status:

Search help

  • Simple searches use one or more words. Separate the words with spaces (cat dog) to search cat,dog or both. Separate the words with plus signs (cat +dog) to search for items that may contain cat but must contain dog.
  • You can further refine your search on the search results page, where you can search by keywords, author, topic. These can be combined with each other. Examples
    • cat dog --matches anything with cat,dog or both
    • cat +dog --searches for cat +dog where dog is a mandatory term
    • cat -dog -- searches for cat excluding any result containing dog
    • [cats] —will restrict your search to results with topic named "cats"
    • [cats] [dogs] —will restrict your search to results with both topics, "cats", and "dogs"

Simple way to persist randomized teleporter exits?


I am trying to figure out how to "randomize" teleporter exits from three teleporter entrances but I would like them to persist during each instance of the game such that entrance A can take you to only one of exit A, B or C but once it has chosen an exit, entrance B will never take you to the same exit, nor will entrance C.

For example: Entrance A sends you to random Exit A, B or C. Exit B is randomly chosen. Entrance A will now always take you to Exit B. Entrance B sends you to random Exit A or C (since Exit B is assigned to Entrance A). Exit A is randomly chosen. Entrance B will now always take you to Exit A. Entrance C sends you to random Exit C (since Exit A and Exit B are assigned). Entrance C will now always take you to Exit C.

I have successfully randomized the teleporter exits but I am not sure how to make them persistent. My initial thought is to store the randomized outputs into an array and use the array to tell each teleporter which exit to use. I am just unsure how to network the blueprint to do this. I have attached the randomized exit for entrance A but I am not sure where to go next. If someone has an example of how to wire this blueprint to achieve my results, that would be wonderfully helpful. Thanks for any help you can give!alt text!

[2]: /storage/temp/4199-random_teleport.jpg

Product Version: Not Selected
random_teleport.jpg (175.6 kB)
more ▼

asked Apr 16 '14 at 07:57 AM in Blueprint Scripting

avatar image

206 25 25 201

(comments are locked)
10|2000 characters needed characters left

1 answer: sort voted first

You tried to use booleans? I am a newbie in UE4 and don't understood the part of random point....you know...the way you scripted in blueprint....but I know if you put a set variable (bool) after the teleport....in the next teleport points (B and C) you can use Branch nodes to compare if the player was teleported to that location....

more ▼

answered Apr 17 '14 at 03:07 AM

avatar image

371 55 49 64

avatar image kingkeoua Apr 17 '14 at 05:47 AM

Sorry, I am pretty new to Blueprints as well and although I see how using Branch booleans applies to a single teleporter selecting and sticking with a single teleporter exit, how do I apply it to three teleporters choosing from three exit locations and always using that exit location until a new game is launched?

It seems like what I need is something that takes my three teleporter exit locations, randomly sorts them, and assigns one of the three outputted exit locations to each of the three SetActorLocation destinations. I'm also not sure if that location will persist through multiple teleporter uses or if it will randomize the location every time you use one of the teleporters. I want the exit locations to persist after it has randomly sorted them and assigned them to the SetActorLocation events.

avatar image kingkeoua Apr 19 '14 at 08:12 AM

Your answer helped after all but to make it persist I ended up setting the boolean variables randomly to either true or false on level start and when i use the teleporters, it checks on those booleans to decide which exit to use. Since the booleans never change after level start, the teleporter exits persist. As soon as I start the game again, it randomizes the boolean variables and I end up with randomized teleporter exits!

Thanks for the suggestion Sand, it ended up leading me down the correct road! :)

(comments are locked)
10|2000 characters needed characters left
Your answer
toggle preview:

Up to 5 attachments (including images) can be used with a maximum of 5.2 MB each and 5.2 MB total.

Follow this question

Once you sign in you will be able to subscribe for any updates here

Answers to this question