Thanks guys! Hit a real snag, though.
The test level I've got set up looks like this:
Code:
| |
| _ |
| | | |
| | | |
| _ ___| |___|
| | | |
| | |___|
The middle and right pits have water in, but not to the top. What's SUPPOSED to happen is, when you pour water (made of lots of small dots that look like a stream) into any of the pits, it fills the water up to a certain level, at which point it fills no more. Then, when you pour water into a pit that's already full, it finds the nearest 'overflow' object and makes a stream of water come out of there instead.
All of that works just fine!
But the problem occurs when you pour water into the rightmost pit, and the middle pit isn't full. What SHOULD happen is:
* Rightmost pit fills
* Water overflows into the middle pit
* Middle pit fills with the overflowing water from the top pit
* Middle pit, in turn, overflows into left pit, causing the water to leave the play area.
What REALLY happens is:
* Rightmost pit fills
* Water overflows into the middle pit
* Middle pit fills with overflowing water from the top pit
* Water from the filled middle pit, instead, spawns from the overflow point for the rightmost pit, meaning that even if you stop pouring the water, it keeps flowing around into itself in a highly unrealistic loop.
As you can imagine, this is really frustrating. The worst part is, it's not just when you're doing something that complicated: If you fill one pit entirely, stop pouring the water and wait a bit, and then start pouring it into another pit, it'll STILL generate water from the overflow point for the first pit you filled!
I'm so close to having this whole 'water' thing cracked after days and days of head-scratching, this is pretty much the last obstacle facing me. Does anyone know what I might be doing wrong?
For reference, here's the events I have in place (minus the ones that already work):
Please note that qualifier 3 is the 'still' water that fills up. It had to be a lot of unique objects, so I used a qualifier. The alterable value B of qualifier 3 = 1 event is just to differentiate still water that has already 'filled up' from that that hasn't.
Code:
* Every 00"-01
|__* Add 1 to alterable value B of 'falling water'
* Alterable value B of 'falling water' = 150
|__* Destroy 'falling water'
* Alterable value B of 'qualifier 3' = 1
+ Collision between 'falling water' and 'qualifier 3'
+ Alterable value A of 'falling water' = 0
|__* Set alterable value A of 'falling water' to 1
|__* Set alterable value B of 'falling water' to 148
|__* Start loop "overflow" 1 times
|__* Set alterable value C of 'falling water' to 1
* On loop "overflow"
+ Alterable value C of 'falling water' = 1
|__* Advanced Direction Object: Find distance and fixed of 'overflow object' to 0,0 from 'falling water'
|__* Set alterable value C of 'falling water' to 2
* On loop "overflow"
+ Fixed value of 'overflow object' = GetFixedObj("Advanced Direction Object", 0)
|__* Create 'falling water' at 0,0 from 'overflow object'
Phew, sorry about the long post. I've tried and tried but nomatter how much I look at my code, I can't work out what I've done wrong. Can anyone see it?