After doing some simulating, I found that the cubes don’t power the pipes or the water font or the goal cube when touching the half-pipe that connects to the rest. I tried setting the Lifetime number to a large number (500), and the program acts like those pipes are powered, even without any cubes touching the half-pipe.
I’ll have a look at that tomorrow, but it’s probably because those other components are using the old system, no?
Some were using the older system, so I got rid of the Boolean variables and the BP that used them. Then, I replaced those BPs with the newer ones that use the Lifetime integer. But okay. I appreciate the help, and sorry this has gone on for a long time.
Ok, you got it, good.
You’ll probably notice you have the same code in the pipe etc.
It doesn’t really matter, but the way around that is to use more blueprint inheritance.
You main cube parent would stay the same. Then you make a child of that called ‘conductor’, and put the code in there. But… no mesh.
Then inherit from that and make the cubes and pipes and put the meshes in. Like that.
Good luck
So, I would have to make a “conductor” child with the exact same BP as any objects that acquire power? What about objects that I want to be charged no matter what, such as the starting pipe and starting cube?
I just thought of a much easier way.
For the main cube, just make the mesh set-able. So, the main parent doesn’t have a mesh set. Then you can set the mesh and in the children.
Cube mesh for the cubes, pipe for the pipes etc.
But don’t worry too much about it. If you want to try it out, make a copy of the project. If you can get it working there, then delete the first one and carry on with the new one.
The reason I made pipes children to Cube_BP was so that I could cast to any object that was a child to that shape. I tried making a base pipe entity and making pipe shapes as children, but I couldn’t get the program to cast to both Cube_BP and pipe-related actors. So, I made the pipe actors related to Cube_BP.
Also, are you basically saying I should recreate the newer BPs for the Cube_BP actor so it is passed down to related actors?
You have the first part right. That fact that it’s called Cube… doesn’t matter, it’s the parent of everything, and you can always cast, correct.
All I’m saying is, the pipes and cubes can both be children without any duplication if you put the mesh in, one level later.
Also, it doesn’t really matter, it’s just to get rid of a double bit of code, I just thought you may have wondered about it
Alright. What about the start cube, which needs to be charged at all times? I could probably put in a Boolean condition to set it apart from the others.
No bools
There’s nothing wrong with the start cube. What sets it apart, is the fact that it’s the only one that contains the power generator code.
Oh, okay. So what I’ll probably do is recreate the Cube_BP actor, create the children and put in the BPs from the latest screenshots. This is because none of the other cubes are powered when they touch the first metal cube. I think I did something wrong, so I will have to remake the BPs.
After recreating and comparing between the older and newer projects, I’ve started to wonder if an integer instead of a Boolean would really be helpful. The program still acts like metal cubes aren’t powered when they touch, and it acts like no pipes are powered, even if I put in the BPs using the Lifetime integer. Also, I put the Power Pulse event only in the Cube_BP so that each actor would invoke Cube_BP’s Power Pulse event. But nothing seems to work right. It’s like I always mess something up.
Hey, can’t really see the solution you guys are currently working on. Just wanted to pitch in with an idea in case it might help: how it works is binding the overlap event of each cube to an event that checks overlapping actors starting from power source. So on every begin / end overlap, they update in chain and those that are not found to be connected are automatically told to turn off.
Just keep note that the last 2 for each loops can be done in 1 loop without casting or the branch. I’ll update it later .
It works perfectly for me, but you guys seems to get different ideas that don’t pan out
I can fix it one more time, but then that’s I’m afraid
And I won’t be able to do it until the weekend now.
Send me another link if you need it.
I must have gotten some of the BP screenshots mixed up, too. Anyway, I’ll try sending the .zip file hopefully the last time.
Anyway, here is the link: MyProject10.zip - Google Drive
I will fix it and give you link, at the weekend…
Okay. I appreciate your help, and sorry this has gone on for a long time.
In the meantime, I’ll see if I can figure anything out on my end.
I meant to say earlier that I wasn’t sure about using integer variables in this project because the Lifetime integer acted like a timer, meaning the power would be lost after the Lifetime number reaches 0. I figured this out after playtesting and examining the BP for each actor. I blame frustration and fatigue for not expressing myself better, last night. That was why I considered a Boolean variable, so I could set those variables to “true” or “false.” How would an integer variable work in the same scenario?
The lifetime integer get refreshed 10 times a second, so it won’t run out
Bools won’t work, you will get loops, because a given cube can’t tell where the power came from.