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"

How to get levels to open in a specific order when the trigger is the same

I have created more than two levels to my game but the way I transition between them is when the enemy in the castle is hit then it opens the next level. The problem is that it only works to go to level 2 because of the way it is scripted in the blueprint already. I need to know if there is a shorter way to connect the levels in a certain order because the only way I know how to do it now is to create a separate final enemy blueprint for each level and pair each of them to the projectile (which is where the open level bp is working currently) and have an even more massive complicated blueprint.

Product Version: UE 4.13
more ▼

asked Feb 21 '17 at 01:05 PM in Blueprint Scripting

avatar image

5 2 5 7

(comments are locked)
10|2000 characters needed characters left
Viewable by all users

1 answer: sort voted first

You could assign an index to a level in an Int variable, for example: Level 1 = 0, Level 2 = 1, Level 3 = 2...

When you hit your final enemy, you could use a Switch on Int node, and load the level you want based on the index of your current level, for example. You can then, change your current level index and carry that value into the next level.

alt text That said, you don't actually need to have an order saved in some place or configuration file, but of course, this is just a low-level solution and easy way to implement that.

A second approach would be to store the names of your levels in a string array in the order you want them to be presented to the player, and then just open level with your current index + 1 when you hit your enemy.

alt text

I haven't worked with levels in a while, so these may go wrong, but test them out. And please let me know if that helps.


openlevel.png (95.7 kB)
more ▼

answered Feb 21 '17 at 01:24 PM

avatar image

Luiz Sotero
115 1 7 8

(comments are locked)
10|2000 characters needed characters left
Viewable by all users
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