Download

Quick Question

Hi guys,

Just got UE4 and loving it. But I’ve stumbled upon something that has me stumped.
I’ve no previous experience with the UDK, or any other game engine for that matter, (save for War3Edit years ago) but I normally manage to get by via trial and error and google searches.

I’m trying to create a random event.
Something like:

[table=“width: 500, align: left”]

**Trigger**
**Random**
**Result**


When triggered
Random Integer between 1 - 6
If Integer = 1 then do Event 1




If Integer = 2 then do Event 2




If Integer = 3 then do Event 3




If Integer = 4 then do Event 4




If Integer = 5 then do Event 5




If Integer = 6 then do Event 6

Anyone have any ideas or experience with similar things?

EDIT: This is what I have so far:
Untitled-1.jpg
The integer part is fine (as far as I can tell) and will run between 1 and 6 as needed.
The part I cant figure out is how to use the CompareInt correctly. As (at least in my mind) it lookis like they’re currently taking any input.
When I select Compare With and attach it to the Random Integer in Range, the number from the compare with vanishes :s

How about the following (The trigger in this case is Begin Play, replace with whatever trigger you need):

Blueprint.jpg

I would recommend looking into an Enum. It works just like the Switch on Int except it is easier to read in your BP and is better for performance(or so I hear). Your random int can convert into the byte pretty easily.

Ehamloptiran’s idea works. Thanks :slight_smile:

I will take a look into Enums when I get back from town later. Thanks for the help! :3