Looks good to me! Thanks for all your help! =) Now then, I will have to do some more experimenting, including throwing in an indication that the puzzle is solved.
We got there!
I hate to bother you again, but it looks like I’ve run into another problem. After setting up the cubes as needed, I decided to include stationary metal and rubber cubes. I gave the stationary metal cubes the same BP as regular metal cubes, except I set them to not move when pushed.
Now, when metal cubes are lined up with the starting cube and lit up and then touch a stationary metal cube. But, when I push a cube out of the line and metal cubes after that one are still touching but the power line is broken, the stationary metal cube is still powered, along with any metal cubes touching it!
Just for example, here is a screenshot:
The lit cubes are not supposed to be powered at this point, and neither is the stationary metal cube. What can I do to remove its power when the line of metal cubes is broken? Your help is greatly appreciated, once again!
Hi
It looks ok actually. I’m assuming those hex cubes are the metal ones, and the copper one is the startcube?
You need to push this one a bit further to break the chain
The hex cubes are the metal ones and the copper one is actually a stationary metal cube.
Can you show a larger view with the start cube?
The chrome cube on the very left is the starting cube, with one metal cube touching and drawing energy from it. On the right is the stationary metal cube in its “powered” state" with a powered metal cube; those two aren’t supposed to be powered unless all the other metal cubes are touching and connected to the starting cube and – ideally – to a goal cube I also made.
Do you think I should also expand the Collision boxes some, since they really need to go up against a block to gain power?
That’s not right is it
Wanna give me a download link again?
For some reason, I can’t share the link and I can’t share the file as an attachment because I’m still a “new user.” Any other way I can share the .zip file?
You could PM me the link?
I see the problem.
While I figure it out, you know you can make the stationary metal cube by just making a child of ‘metal cube’ and changing the physics.
The problem is that once some cubes have power, they have a little ‘power party’, even after they’re disconnected from the source:
BTW, much easier way to test: play in simulate mode, then you can just drag the cubes around:
Ok, here’s the answer. The bool variables are all out of the window, we don’t use them anymore.
The main parent cube class is the same.
The metal cube now goes like this:
And the start cube has this code
Edit: These settings give a kind of ripple effect sometimes. You might like that. If you don’t, make both timers 0.1, and up the power pulse from 10 to about 50.
Do I also need to copy, paste and edit the BP from MetalCube to StationaryMetalCube?
I just deleted the old StationaryMetalCube and recreated it as a child with the MetalCube as its parent. Though the StationaryMetalCube turns on and off as intended, it and any connected MetalCubes blink like Christmas lights. Do you think I should fix the timer on the “SetTimerbyEvent,” considering I’d need to remake the set of commands in order to give the StationaryMetalCube different default and “powered” materials?
Oh, and here’s the BP for the StationaryMetalCube, right now.
Do I also need to copy, paste and edit the BP from MetalCube to StationaryMetalCube?
No, that’s the whole point of making it a child, it already has the code.
Like I say, you might get the blinking problem depending on how many cubes are connected and the settings of the timers and initial value of the power pulse.
What’s happening is the powered cube is sending a ‘token’ into the cube network, and as they pass it around it runs out. This is to stop loops, which is what the problem was with the last method.
The higher the initial value of the pulse, the more the cubes have to count down to discharge it. The timer in the start cube is how often the pulse is sent out, and the timer in the metal cube, is how often it gets decremented and sent on to the other cubes.
You have to tweak these values a bit to get it right for your needs.
If you can’t get it right, show me the network you have and I’ll figure out some numbers.
Update: Put this
in the metal cube code, instead of what is currently there for this event.
You can set the original pulse right down and it doesn’t flicker
( The value should be about double the number of cubes you expect the power ).
This seems to work great, so far. As long as the Lifetime integer is set to 0, any cubes not touching charged ones will remain uncharged until they do touch. Will this work with any number of moving and stationary metal cubes I’d set in a room?
Should do, I’ve tried it quite extensively. In fact, the original power number only needs to be a bit more than the longest chain of cubes you expect.
You can tell when it’s not quite enough, because the most distant cubes flicker, which is pretty cool actually…
[ The only lifetime you need to set is the first one ( on the start cube ) ]
I actually did consider keeping a rippling effect for, well, effect. Right now, I’m testing to make sure the flickering ones further along don’t lose power.