Dispatcher Question

Apologies in advance, I’ve tried a couple of tutorials but I can’t seem to retro fit code to use in my game.

I have a day cycle[from tutorial] that checks the angle of rotation and when the rotation hits a certain angle I started a new day.

Lots of things are meant to trigger on a new day so here is the logic.

  1. New day logic [I created a event dispatcher in this Level BP and when the new day is set I connect the “Call New Dat” ] , In my head this means that things can now listen out for a “new day” event.
  2. Making things “listen” [ I imagine this needs to be on a recurring period unless I just need to fire it once. For now I just want to use the event tick on another BP. So in my head to code should be something like on tick → check if even fired → if it did run a function etc.

My BP where I bind is different to the Player controller BP where the event dispatcher is.

I’ve tried a couple of options on the bind but it seems to just call on every tick and not just when the event is dispatched.
I’ve tried creating a custom event… * time passes*

I figured it out, premo.

So unchecked the context box. Added reference to player controller, then grabbed dispatch “bind event” and then created custom event. I didn’t connect the bind event to anything but the custom event is connected to a print and it prints ever time the day changes. Pretty cool!

TIA

The bind is a once only thing, that’s the whole point, you don’t have to listen, it’s done for you.

In order to bind, you need a reference to the actor you want to bind to. In this case, that’s the level blueprint.

Mostly, I would advise not trying to establish comms between the level BP and other BPs, in either direction. There’s nothing wrong with it. per se, but as you can see, it’s a pain in the tushie.

I know you can get a reference to the level BP, if it’s a streaming level, but that’s probably not the case here.

The solution, is just to put your level BP code in an actor, and put that in the level. Then you can refer to it and bind.

Thanks for the feedback. I’ve read the level BP thing and I’ve got it on my to do list.
I got stuck moving the level BP items into their own BP because I couldn’t find a skysphere O_o.

Just make a instance editable actor reference ( switch the ‘eye’ on ), and then you can point it at the sky when you put your blueprint in the level.

345996-screenshot-1.jpg

then in the level

345997-screenshot-2.jpg

( use the dropper to point at the sky ).