synchronisation of custom events to collect actor

Hello,

I use an actor Character : Balloon (hot air balloon) which moves at 1300 from the ground (to avoid collisions) in order to collect spheres which are on the ground. The spheres are also actors character because they move on the axis of Z to join the balloon. Firstly, I calculate the balloon’s shortest route, which I save in a table. Then, in a For Each Loop, I move the balloon just above the sphere, this one goes up to the balloon and the balloon moves to the next sphere until the end of the collection and returns to its starting position. I use three custom events (because of the Array): BalloonToSphere, SphereToBalloon and when everything is collected BalloonToStartPosition, with Lerp vectors and Chronologies. I looked at the comments of ‘Best way to move an object to a specific location’, I had a glimmer of hope because I thought there was an incompatibility between array and TimeLine, but moving the Balloon is not correct, no synchronization (using an array is ok, collection works). I can’t make the three custom events one after the other, the TimeLines overlap, I’ve used Vinterp, Lerp, Add movement input, TimeLine, Event Tick, Timers… without success, I’ve been working on the problem for a long time without finding a correct visual solution, it’s a real headache, I’ve tried everything except splines. Thank you for your help.

1 Like

It sounds like you’re trying to control everything from one place. Possibly the level blueprint, or the balloon.

What would work better, is to make a balloon, and a sphere blueprint ( you copy the sphere BP around the map ).

The balloon has it’s timeline to move along the route, issuing ‘pickup’ calls to the spheres.

The sphere BP then move from where it currently is, to where the balloon is, again, on it’s own timeline.

Every item has it’s own timeline.

1 Like




Hi ClockworkOcean, thanks for your help, yes I control the moves in GameMode (see SCREEN IMPR) I also attach the custom events for BP_Balloon and BP_Mana and every item has it’s own timeline. The problem is in Gamemode with MoveBalloon?

2 Likes

I think I see the problem: a for loop will not wait for anything, it will just run. I’m assuming your balloon just moves to the last position?

Best thing is to write your own loop in the balloon ( or game mode ). So just get the first point, move the ballon there, then tell the mana to follow, increment index, move to the next mana, etc…

Also, I wouldn’t try attaching, that might be a problem. Better to just code the mana to move to where the balloon currently is. You would need ‘rinterp to const’ to do that. You can only use a timeline for the mana, if the balloon will wait until the mana has reached it, before moving on.

1 Like

Hi ClockworkOcean, it’s good to have some help with a problem that’s going to drive me crazy, I must say that there’s no shortage of pitfalls in Unreal Engine. For the balloon movement, if the collection is 1 (which isn’t the aim) the movement is good for the balloon but not for the mana, which is why I’ve attached it to the balloon, above 1 it goes very fast and it’s wrong. I’ve coded all this, I’ll come back to you to tell you that I’ve succeeded (or for any other information). Many thanks for everything.

2 Likes

Hello ClockworkOcean, I have several problems that impact synchronisation:

  • the mana distances are different and the timeline duration is 3 seconds.
  • I can’t get the balloon to wait for the mana to reach it. I’ve added an OnComponentBeginOverlap to Mana’s blueprint with a boolean set to true and also in GameMode before executing the MoveManaToBalloon, the mana moves when the balloon returns to the castle, so it’s wrong.
  • For the rinterp to Constant, the movement is not correct, I think because of the Deltatime and Interpspeed settings.
    Thanks for all your help.
2 Likes

Should the balloon wait until the mana has reached it, or is it ok if it catches up?

1 Like

No it’s never ok, I put a boolean after the Finished of the balloon timeline, the balloon doesn’t wait, when the mana moves the balloon is already back to its starting position.

2 Likes

What do you want it to do?

1 Like



the balloon must arrive at its destination (MoveManatoBalloon must not execute): the mana location X,Y and Z must be 1300. When it reaches its destination, the mana can rise to 135 or 1300. Once the mana has reached its destination (the balloon’s location), collection can continue.

2 Likes

This code is the problem

The loop will not wait until the mana has been collected.

You have to remove the loop and do this by hand

The delays need to be as long as it takes to do each process. If you want to do it without the delays, then you need to separate the custom events, and make the balloon and mana call each other. ( you still can’t use a loop ).

Hi ClockworkOcean
Thank you for taking the time to make me a Blueprint table. I still have a few questions:

  • Is it possible to calculate a delay, because delays depend on distance and the distance of manas is never the same. For the delay I use the distance divided by the speed of the object, should I multiply it by a Get world delta seconds?
  • The balloon and the manas each have their own custom event in BP_Balloon and BP_Mana. If I remove the time limits, I’ll call both of them with events Dispatcher?
  • I still have two For Each Loops that don’t use a TimeLine, should I modify them?
    I’ll make the changes and let you know the result.
    Thanks again for all your help and time.
1 Like

If you want a more elaborate setup, then delays are not the way ( also dispatchers aren’t really appropriate ).

You would need to write the code like this

Balloon:
1 Move to next mana.
2 Timeline ends → Tell this mana to rise
3 When mana says it’s done, go to 1

Mana:
Get signal from balloon to move
Move to balloon
Tell balloon we are done

The communication between the balloon and mana is just done with custom events. Tell me if you can’t get it working, and I will make an example.

Where are these other for loops?

it doesn’t work, I calculate manually and I check on the computer if the calculations are identical and I come back.

1 Like

Balloon

Mana

Collecting mana

1 Like

I come back to you and oh surprise! the solution, it’s perfect, it’s concise, you’re a god. Thank you very much.

1 Like

Hi ClockworkOcean
I have a problem with MoveToBalloon (target is BP_mana)
Blueprint Runtime Error: ‘Accessed None trying to read property CallFunc_Array_Get_Item_1’. Node: Move Mana to Balloon Graph: EventGraph Function: Execute Ubergraph BP Balloon Blueprint: BP_Balloon
Do you have an idea? Thanks

1 Like

I thought it was working?

Have you changed something?

Hi ClockworkOcean

  • no it doesn’t work that there’s an error, I spent some time redoing the balloon’s path because the mana locations are spawned when an enemy is destroyed. In the ManaNav table (in GameMode) I only have BP_Mana instances that are ranked to have an optimised path.
  • I’ve changed Mana to ManaNav, so it’s not in the Balloon Beginplay but in GameMode.
  • The Balloon is not in the beginplay of BP_mana but in the Beginplay of GameMode (balloonRef)
  • The MoveBalloon is not executed in the Balloon Beginplay but in the CollectedOwnMana of the GameMode
    The rest is identical. I can send you some screen shots, thank you.

Yes please…