Please test this .CAP for me

For questions about using Classic.

Post » Wed May 30, 2012 11:30 am

I've been runnning into Plasma issues recently where the Plasma effect is completely off-center. It gets cut up, and forced higher and to the left of where I want it to be. Now I'm having similar issues with a water effect.

I found this excellent thread about water effects and a brilliant .CAP by Rojo within. I decided to recreate this effect from scratch, copying what Rojo had done, and then play around with the variables and add some tweaks and additions to get my desired effect.

It isn't working properly for me though. The water should create a ripple wherever you left-click. But the registered location of the ripple is way off-center for me, higher and to the left. Oddly similar to my current plasma issues.

Could you please download and run this quick .CAP, and see if this off-center issue occurs for you too? If it does, maybe I just screwed up when recreating the effect. If it doesn't, there's something wrong with my mouse, or my version of construct, or something else... I'm not sure. I'd just like to try and pinpoint what the issue is.

Dropbox link here

Many thanks!
B
15
S
7
G
7
Posts: 250
Reputation: 5,298

Post » Wed May 30, 2012 1:22 pm

I get the same bug, staring at the original and yours side by side the only thing i can spot which doesn't solve the issue is in your events you have key left mouse button is down as opposed to left mouse button is down
B
2
G
1
Posts: 9
Reputation: 520

Post » Wed May 30, 2012 1:51 pm

Good catch, but changing it doesn't fix the issue. How odd.

What could possibly cause the mouse click to correspond to a location somewhere left of where you click...? o.O
B
15
S
7
G
7
Posts: 250
Reputation: 5,298

Post » Wed May 30, 2012 3:36 pm

You're calculating the position relative to the box's x. But the box's hotspot is centered. Just change the hotspot to topleft, left or bottomleft to let it work with your calculation, or substract box.Width/2 from the centered x, or use Box.Left
Image
B
23
S
8
G
10
Posts: 1,820
Reputation: 8,242

Post » Wed May 30, 2012 3:39 pm

Ha! Thanks Tulamide
B
15
S
7
G
7
Posts: 250
Reputation: 5,298

Post » Wed May 30, 2012 7:34 pm

Okay, time for a bonus question

I've tweaked with the settings, found out how to extend the water, alter the wave height and strength, but I'm now trying to trigger the ripple effect in a different way. Rojo's version is triggered by a mouse click, but I'd like to trigger it on collision.

I've added a waterfall (and slapped some shaders over everything for extra pretties) and have created a box object for collisions. The box is at the base of the waterfall, and I'd like the ripple effects to start being produced at the box's X location once the box is on screen.

What I can't work out is how to create a ripple effect once every second (or half second, or 2 seconds etc). I know the 'trigger once while true' condition allows me to create a single ripple once, but is there a way to tell the engine to trigger the ripple effect once every second?

Updated .CAP here.-Silver-2012-05-30 19:40:36
B
15
S
7
G
7
Posts: 250
Reputation: 5,298

Post » Wed May 30, 2012 7:49 pm

Change

+ System: For "" from -7 to 7
-> Array: Set index (LoopIndex+(SplashCollision.X-Box.X)/4, 1) to 30

to

+ System: Every 1000 milliseconds
+ System: For "" from -7 to 7
-> Array: Set index (LoopIndex+(SplashCollision.X-Box.X)/4, 1) to 30

Instead of 1000 use whatever period you prefer.


...And another tip: Instead of applying a seperate effect to every instance of the water sprite, try placing them on a seperate layer and apply the effects to that layer instead. You will have at least a 5 to 6 times higher framerate xD
Image
B
23
S
8
G
10
Posts: 1,820
Reputation: 8,242

Post » Wed May 30, 2012 8:27 pm

Awesome, thanks!

Yeah, that's the issue with creating Construct games on a gaming PC. I run at 60fps no matter what I do

Thanks for the optimization tip
B
15
S
7
G
7
Posts: 250
Reputation: 5,298

Post » Fri Jun 01, 2012 2:39 pm

Okay, think I'm done! I can't shake the feeling that the water looks a bit like jelly though... maybe if I can find a way to randomise the Warp height on the water levels, but I'm not sure if that's possible. Sine could work, but layers don't have behaviours do they? Only effects?

The foam plasma effect is a placeholder - I already have some ideas for how to make it swirl out at angles. But the water itself works well enough I think. I've layered it to match my platformer's perspective, and dunked my puppy in the water so you can see how I want it to work in-game.

Clicking on the water still works, and for each layer individually. I'll be getting rid of that and making it a ripple-on-collision effect for when the wolf is in the water. But for anyone else from the future looking for water ideas, this is what I got out of Rojo's awesome implementation.

Thanks for all the help getting me here

.CAP Dropbox download-Silver-2012-06-01 14:41:44
B
15
S
7
G
7
Posts: 250
Reputation: 5,298


Return to Help & Support using Construct Classic

Who is online

Users browsing this forum: No registered users and 3 guests