Download

Level blueprint (maybe?) controlled sequential light triggering.

Hey guys,

I have a quick question regarding blueprints and their control over objects in my level.

So basically I’m trying to create a series of lights that will fire (from 0 intensity to 5000 intensity back down to 0 intensity) one after another for the duration that the player is on the level.

I’ve created a basic class called LightBarSequential. I have 3 blueprint objects created from that type in the level.

In the level blueprint I have an array being populated from “get all actors of type” : LightBarSequential.

Now where I’ve struggled is at the point where I’m creating a delay within the ForEachLoop because the Delay node won’t work with that I’m trying to accomplish.

Is there a better way of doing this than having the level blueprint populate the array, foreach loop, cast to SequentialLight, then modify the intensity?

Thanks for any help guys!

Regards

Hello,
try this, it may be what you want :
3 lights in a row in a blueprint, intensity set to 0, timelines keys are 0 s, 0 / 1,5 s, 5000 and the 3 “light” booleans are set to false. Finished timeline output goes back to branch input.
42990e2f24a553de17e3c48e8ae9aa45503ea75d.png

Fen,

Thanks so much for your response! This is one of the ways I thought about doing this, the problem however is that I want to be able to build (programmatically, does this term even apply with blueprints?) an array at the beginning of play that will populate all of my SequentialLight objects so that I don’t have to manually specify the lights like this.

Thanks again man!

Sorry, i don’t understand your trouble. If you create this " 3 lights in a row" blueprint, you’ll have all of them flickering on event begin play and you’ll can spawn as much as you want without nothing to do. I may have misunderstood.

Edit : And if for some reason you need an array, you create one with this blueprint as variable from “get all actors”.

What about a way to have this intensity phase on and off within the class BP and have it offset itself incrementally so just placing them in the level would include the phaseOn offset?

Let’s say I decide I need 100 of these lights in the level, that means I would have to manually create 100 legs of this code to accommodate.

If I choose to build an array, the delay node breaks the ForEachLoop I would use to process the array.

This code is in the light blueprint, not in the level blueprint. So each time you drag / spawn your blueprint, it will works without nothing to do.

Ahhh I see I see… awesome!

Now, these lights would be synchronized though correct? If I placed 2 in a level, they would fire off at the same time?

How can I create an offset so that I can control the timing of them?

So instead of them being synced, one would fire off, then the next one, then the next one, and so on…

Edit: And I need to be able to loop this until the level ends

Maybe what you want is not a 3 in row 100 lights but a hundred lights flickering one after one. In that case, consider that after a delay the new light will be in phase with the first one and from there create a blueprint with one light with a vaiable for duration.

Correct, one after another!

Forgive me for not being understanding what you mean (I’m still really new), can you explain what you mean by "after a delay the new light will be in phase with the first one and from there create a blueprint with one light with a vaiable for duration. "?

Based on this blueprint but with one light :
On begin play :
Edit : i forgot level or light blueprint :

Level blueprint : Set an int “index” based on the “get all actors” “light blueprint” “find” array index
Light Blueprint : Set an int “SetDuration” from your “index” value like that for example :
if index+2/3 : division : remainder 0 then set duration 0
if index+1/3 : division : remainder 0 then set duration 3
if index/3 : division : remainder 0 then set duration 6

based on a 1.5 s timeline and a 3 lights line.

Or if you want the lights to light up as the player gets close to them, you can add a trigger volume to the Light Blueprint, so it turns on once the player is in range and turns off when they aren’t, with the range being fairly large so that multiple lights would be on at any given moment.
Is that the kind of effect you are looking for?

Fen,

Is modulus available in blueprints? Haven’t tried it yet!

DotCam,

That’s another cool one but no it’s not quite what I’m looking for.

Below is kind of what I have in mind:

The important thing is that it’s scalable so that I don’t have to manually reference each light to fire off.

Oh yes, so one light of all is activated.
Then based on my last idea : simply use your index array value as delay.
In your level “on tick” event with a delay, loop and select index of your lights array and activate the timeline by a custom event in blueprint.
then you can do a reverse effect with a bool set true or false when index is 0 or last index and on true value = index and on false value = length - index or a second loop from max to 0.

Edited for a better idea ^^

Fen,

Thanks so much for the tips! I greatly appreciate them!

Merci mille fois, Mille fois merci