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"

Huge switch statements; is there a way to run code in order without checks?

Edit: Found Multigate is what I wanted but it breaks after adding 30+ outputs, so it isn't working. It simply won't run if I have more than 30 outputs. Anyone know why?

I am trying to make a mini-music game that has about 500 beats. On each beat it may run a different code. Is it ok to use a Switch on Int statement (counting the beats) for 500 of them? After adding 30 the editor's Switch statement becomes weird (dissapears when I Add pin, need to scroll back up to make it appear again) and so adding 500 would take crazy long.

What would help this and save the game to do a huge check is to just have a repeatable execution node that proceeds to the next node after the previous has ran. Something like: alt text

Product Version: UE 4.15
sample.png (42.6 kB)
more ▼

asked Mar 05 '17 at 08:34 PM in Blueprint Scripting

avatar image

60 8 12 17

avatar image Mosel3y Mar 06 '17 at 10:59 AM

If you aren't doing something unique on each beat, but instead are doing something unique on every 2nd, 4th, 8th beat etc. you could use a modulo node and a branch. I've used this before when doing stuff with music, on the up and downbeats, modulo 2 and 4 in common time.

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

1 answer: sort voted first

you are looking for the Sequence node. as awful as it sounds. lol.

if you have a problem with 500 on a single sequence node, just split them up to levels, so for example the first sequence will have 10 outputs, each leading to another sequence node....etc..

tip: nodes menu (right click in blueprints graph) contains drop-down stuff by categories. sequence is in "Flow Control" category, which is very useful and in my opinion everybody has to learn all of them (not too many) to be effective. it's worthy.

good luck :)

more ▼

answered Mar 05 '17 at 10:26 PM

avatar image

903 20 43 63

avatar image michaeleeli Mar 05 '17 at 10:45 PM

Hey Arty, Thanks for your answer, however Sequence isn't what I'm looking for since it executes all outputs at the "same time". What I want is only one output executed whenever it is being inputted.

avatar image Arty-McLabin Mar 06 '17 at 07:52 AM

then you should use MultiGate node, from the same section (Flow Control), it plays "the next output" each time it gets an execution input.

avatar image michaeleeli Mar 06 '17 at 07:54 AM

It was the first thing I tried, but MultiGate node seems to only support up to 30 outputs; anything beyond that returns an error. I think I will just go with switch on int statements for now; I do notice a delay but I'll deal with it somehow!

(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