Adventure Game Studio

AGS Support => Modules, Plugins & Tools => Topic started by: Kweepa on Sun 09/07/2006 04:16:49

Title: MODULE: Lake v1.3
Post by: Kweepa on Sun 09/07/2006 04:16:49
(http://www.kweepa.com/step/ags/screens/megascrolly.jpg)

Creates an animated reflection like the once-popular java lake applets. Reflects a background image (can specify an alternate background frame). Characters and objects are also reflected. You can see the effect in action in this demo:
http://www.kweepa.com/step/ags/games/MegaDemo.zip (5Mb)

Download here:
http://www.kweepa.com/step/ags/tech/LakeModule13.zip (3k)

Instructions are in the module header.
Works with AGS v3.1 and above. (Tested with AGS v3.2.)


History:
1.0. First version. Used a screenshot to reflect objects and characters. Works with AGS v2.72.
http://www.kweepa.com/step/ags/tech/LakeModule10.zip (2k)
1.1. Now takes a baseline to filter objects and characters, and doesn't reflect guis or cursors. Works with AGS v3.1.
1.2. Now works with right-to-left operator precedence. Thanks dualnames.
1.3. Now uses strict object-based scripting.
Title: Re: MODULE: Lake v1.0
Post by: Besh on Sun 09/07/2006 04:49:33
AHHHHHHHHHHHHH!!!Ã, Ã,  :o

WOW!!! Steve you are the BEST!!!
Simply AMAZING.
Title: Re: MODULE: Lake v1.0
Post by: monkey0506 on Sun 09/07/2006 05:03:37
Pretty impressive stuff.  Not really sure how it works (:=), but it does, so that's good.

Also I'm not entirely clear on what the dinosaur pinball and scrolly notepad have to do with the module...but neat effects anyway.
Title: Re: MODULE: Lake v1.0
Post by: TheMagician on Sun 09/07/2006 13:30:38
Wow. Very nice module!
Great work!

This might be a nice starting point for me to code a pixel-shifting algorithm to create water effects as used in Riven for example.
Title: Re: MODULE: Lake v1.0
Post by: IceMan on Sun 09/07/2006 13:44:52
Steve, you are a genius!Ã,  ;D

I put together a quick test to see how I might use it in DNG 2.Ã,  I added a few tweaks to complete the effect, such as the rounded pond-edge and a transparent layer of water, so that you still get some blue in there...

(http://www.2dadventure.com/ags/pond_test.jpg)
Title: Re: MODULE: Lake v1.0
Post by: Kweepa on Sun 09/07/2006 15:32:05
Ah, those are just RawDrawn on top. Something like this:

pond.Update();
RawDrawImageTransparent(GFX_BLUE_RECT, 0, 140, 50);
RawDrawImage(GFX_POND_EDGE, 0, 120);


Glad it's going to come in handy!
Also glad to see it works at 640x480. :=
Title: Re: MODULE: Lake v1.0
Post by: jasonjkay on Tue 11/07/2006 13:06:37
This is something ive been waiting for, it looks amazing. Ill definately have to add it to my site.
Title: Re: MODULE: Lake v1.0
Post by: subspark on Thu 13/07/2006 09:53:41
IceMan, I and the other graphics gurus of this forum would really appreciate your demo of Steves Lake module also. Or possibly a thorough tutorial of how you acheived your results.

Good work to the both of you.

Cheers.
Title: Re: MODULE: Lake v1.0
Post by: Privateer Puddin' on Thu 13/07/2006 10:13:36
Steve said how to do it. As fair as I can see this is correct (but rushed so the overall effect doesn't look any where near as good) and it seems TheMagician got it as well..

(http://custardsclutter.com/water.gif)

very quickly done ;p
without any
with blue transparent
with edge
Title: Re: MODULE: Lake v1.0
Post by: Sadistyk on Fri 14/07/2006 04:15:47
Is there anyway that the Lake module works while the Wait() function is running?
Title: Re: MODULE: Lake v1.0
Post by: Kweepa on Fri 14/07/2006 05:15:50
Just update it in a repeatedly_execute_always function instead of repeatedly_execute.
If you don't have that function in your room script, create it:

function repeatedly_execute_always()
{
  pond.Update();
}
Title: Re: MODULE: Lake v1.0
Post by: GarageGothic on Sat 15/07/2006 01:42:36
Excellent idea to use an alternate background frame as a buffer for the screenshot. I hadn't thought about that myself, which made me suggest to CJ to add optional coordinates to the CreateFromScreenShot function. But this is a great workaround. Thanks for that ingenious solution - I had actually given up on ever getting my full screen postprocessing to run at decent speed.
Title: Re: MODULE: Lake v1.0
Post by: Kweepa on Mon 17/07/2006 16:35:45
I won't be able to get to this for a week or so as I'm on holiday, but if someone else wants to provide a demo game that would be swell.
Title: Re: MODULE: Lake v1.0
Post by: Candle on Wed 02/08/2006 22:06:23
Did you get that template/demo/source yet?
Title: Re: MODULE: Lake v1.0
Post by: alimpo83 on Wed 13/09/2006 13:53:47
How can I use it correctly in 640x480? When I use it in my game it doesn't appear correctly, well it appears till a part of the screen, then no effect. I have to edit the coordinates and sizes I think, but when I change this part:

this.enabled = true;
  this.x = 0;
  this.y = 100;
  this.w = 320;
  this.h = 100;
  this.speed = 1.0;

to other values the game crashes. What am I doing wrong? Please help!
Thanks.
Title: Re: MODULE: Lake v1.0
Post by: Kweepa on Wed 13/09/2006 20:43:08
You shouldn't need to modify the internals of the module to get it to work at 640x480 - IceMan got it working without doing that. I'll check what you need to do later.
Title: Re: MODULE: Lake v1.0
Post by: alimpo83 on Wed 13/09/2006 21:31:45
What i want to change it's the range of the effect. In your demo, basically half the screen gets the water effect, the other half is the background. When I try your module, the effects ends before it reaches the bottom of the screen. I want to be able to control where it starts and where it ends.

Thanks.
Title: Re: MODULE: Lake v1.0
Post by: Kweepa on Thu 14/09/2006 01:00:27
Ok, here's a minimal room script that works.


// room script file
Lake pond;

#sectionstart room_a  // DO NOT EDIT OR REMOVE THIS LINE
function room_a() {
  // script for Room: Player enters room (before fadein)
  pond.DefaultConstruct();
  pond.y = 120;
  pond.h = 120;
}
#sectionend room_a  // DO NOT EDIT OR REMOVE THIS LINE

#sectionstart room_b  // DO NOT EDIT OR REMOVE THIS LINE
function room_b() {
  // script for Room: Repeatedly execute
  pond.Update();
}
#sectionend room_b  // DO NOT EDIT OR REMOVE THIS LINE


You need to create these interactions and then fill in the code as above.

For 320x240 or 640x480, y can be no smaller than 120 (half of 240) for the effect to reach the bottom of the screen.

In any event, there must be enough screen above the top of the water to reflect into the region you specify. For example, if you want the top of the water to be at pond.y = 60, then the maximum pond.h = 60. I should add that check to the code, but right now you'll have to be careful.

It would be possible to stretch what's available above the water to fill the water vertically, but right now I don't have the time or inclination. Perhaps if someone has a pressing need for the feature, a game about to be released, and asks nicely, I'll see what I can do. :=
Title: Re: MODULE: Lake v1.0
Post by: .M.M. on Wed 19/09/2007 17:16:55
Anybody has that plugin???
Title: Re: MODULE: Lake v1.0
Post by: Gilbert on Thu 20/09/2007 02:07:03
This thread is more than a year's old, please try PMing the author before bumping it.

Furthermore, it's a module, not a plugin.
Title: Re: MODULE: Lake v1.0
Post by: Rui 'Trovatore' Pires on Thu 20/09/2007 10:27:38
Still MIA? I miss the guy.

Anyway, in the meantime, here's a working link to the Lake module.

http://www.2dadventure.com/ags/LakeModule10.zip
Title: Re: MODULE: Lake v1.0
Post by: Gilbert on Thu 20/09/2007 11:15:56
Thanks Redrum, I had updated the first post. :)
Title: Re: MODULE: Lake v1.0
Post by: .M.M. on Fri 21/09/2007 18:51:46
Sorry for "plugin"... :-\
Title: Lake Module: Some Questions (Trouble!)
Post by: Dualnames on Sun 03/01/2010 17:27:16
I'm using Steve's wonderful module, and because the topic has been inactive for a while, I thought it was better to post here. It is mostly relative to the module, but not only. Okay, so I'm using it to have a small pond that reflects. Similar to McCarthy. Thing is it's also reflecting the mouse. And I don't recall the one in McCarthy to do that, unless I am mistaken of course. So anyone with any ideas on how NOT to reflect the mouse, but still reflect characters and objects?

Can this be done by any other means apart from the Lake module?
Title: Re: Lake Module: Some Questions
Post by: Kweepa on Sun 03/01/2010 19:08:44
Oops.
I guess reflecting a screenshot is not a viable solution :)
I'll fix it up - I'll add a "baseline" for the water, and reflect just the objects and characters whose baseline is above that.

Steve
Title: Re: Lake Module: Some Questions
Post by: Kweepa on Sun 03/01/2010 21:01:20
Ok, new version of the Lake module.
http://www.kweepa.com/step/ags/tech/LakeModule11.zip
Works with AGS 3.1 and above.
The Lake object now has a baseline property that can be used to filter out objects and characters. For example, set the baseline to 0 to reflect nothing but the background.

The Lake thread has been updated with the new version.
Title: Re: Lake Module: Some Questions
Post by: Dualnames on Sun 03/01/2010 21:10:24
Quote from: SteveMcCrea on Sun 03/01/2010 19:08:44
Oops.
I guess reflecting a screenshot is not a viable solution :)
I'll fix it up - I'll add a "baseline" for the water, and reflect just the objects and characters whose baseline is above that.

Steve

WTF is wrong with this community? I wonder how to do a FOG, someone makes it for me. I wonder how to do a reflection, someone makes it for me. I will make a topic that I don't know how to make my game!!! :D
Title: Re: Lake Module: Some Questions
Post by: monkey0506 on Sun 03/01/2010 21:12:16
Ah but Dual CJ removed the "Make my game" button... :'(

R.I.P. "Make my game"
Title: Re: Lake Module: Some Questions
Post by: Dualnames on Sun 03/01/2010 21:13:22
Quote from: monkey_05_06 on Sun 03/01/2010 21:12:16
Ah but Dual CJ removed the "Make my game" button... :'(

R.I.P. "Make my game"

DAMN!
Title: Re: Lake Module: Some Questions
Post by: Dualnames on Sun 03/01/2010 22:38:45
Quote from: SteveMcCrea on Sun 03/01/2010 21:01:20
Ok, new version of the Lake module.
http://www.kweepa.com/step/ags/tech/LakeModule11.zip
Works with AGS 3.1 and above.
The Lake object now has a baseline property that can be used to filter out objects and characters. For example, set the baseline to 0 to reflect nothing but the background.

The Lake thread has been updated with the new version.

Damn Steve. Everything seems to work fine on the module on a replica of the room I want to use it in, but when I port it on HHGTG, it just won't work. Setting the baseline even to (100000000) won't do it. I can't have the character drawn in the reflection.

Objects are cool. But there's something that has to do with characters I can't figure it out..
I checked for Baselines but nothing there. I even searched for IgnoreWalkBehinds but not. Even characters I've not teased from default won't show on the lake!

Any ideas?
Title: Re: Lake Module: Some Questions (Trouble!)
Post by: Shane 'ProgZmax' Stevens on Mon 04/01/2010 00:12:25
A few things might affect it:

1.  Is the character solid?
2.  Does the character have any transparency?
3.  Check to see if you modified the character baseline to some massive value.


Those are the first things that come to mind that might have some kind of an impact on the module.  Bear in mind this is just a guess as I've never used it.
Title: Re: Lake Module: Some Questions (Trouble!)
Post by: Kweepa on Mon 04/01/2010 01:33:27
Quote from: ProgZmax on Mon 04/01/2010 00:12:25
1.  Is the character solid?
2.  Does the character have any transparency?
3.  Check to see if you modified the character baseline to some massive value.
Solidity of character shouldn't matter. Nor should transparency, as that's taken into account. And he did say he messed with the baselines...

How about these questions (and how the answers compare with the working sample):
Is the room scrolling?
What is the resolution/bit depth?
Are there other effects/modules active?
Is the background animating?

Try opening up Lake.asc and putting a breakpoint on line 132 to see if it's being hit. If not, put a breakpoint on line 51 and see if it's obvious why the character isn't being added to the list to be drawn.
If all else fails, can you upload your game somewhere for me to investigate?

Cheers.
Title: Re: Lake Module: Some Questions (Trouble!)
Post by: Dualnames on Mon 04/01/2010 02:22:10
Quote from: SteveMcCrea on Mon 04/01/2010 01:33:27
Quote from: ProgZmax on Mon 04/01/2010 00:12:25
1.  Is the character solid?
2.  Does the character have any transparency?
3.  Check to see if you modified the character baseline to some massive value.
Solidity of character shouldn't matter. Nor should transparency, as that's taken into account. And he did say he messed with the baselines...

How about these questions (and how the answers compare with the working sample):
Is the room scrolling?
What is the resolution/bit depth?
Are there other effects/modules active?
Is the background animating?

Try opening up Lake.asc and putting a breakpoint on line 132 to see if it's being hit. If not, put a breakpoint on line 51 and see if it's obvious why the character isn't being added to the list to be drawn.
If all else fails, can you upload your game somewhere for me to investigate?

Cheers.

Ah! Took me 6 hours. And I found it. It needs setting left-to-right precedence on General Windows Pane set to TRUE! And I had it set to FALSE, for my other modules to work.

Thing is is it possible to tell me what to change so the module works with left-to-right precedence on false? Also, dare I tell that ..well..the character doesn't get tinted on the reflection as it is tinted on region.

*I'm getting a little pesky i know*
Title: Re: Lake Module: Some Questions (Trouble!)
Post by: Kweepa on Mon 04/01/2010 03:11:13
Quote from: Dualnames on Mon 04/01/2010 02:22:10
Ah! Took me 6 hours. And I found it. It needs setting left-to-right precedence on General Windows Pane set to TRUE! And I had it set to FALSE, for my other modules to work.
Well done, sir!
To get it to work with either precedence, you need to bracket all the multiply and divide lines. I suspect it's particularly lines 129-130 that you should replace with:

        int w = (character[in].Scaling*dsf.Width)/100;
        int h = (character[in].Scaling*dsf.Height)/100;


Quote
Also, dare I tell that ..well..the character doesn't get tinted on the reflection as it is tinted on region.
Ugh. I figured someone would ask for that. Let me see if it's possible to fix.

Steve
Title: Re: Lake Module: Some Questions (Trouble!)
Post by: Dualnames on Mon 04/01/2010 03:25:51
Quote from: SteveMcCrea on Mon 04/01/2010 03:11:13
Well done, sir!
To get it to work with either precedence, you need to bracket all the multiply and divide lines. I suspect it's particularly lines 129-130 that you should replace with:

        int w = (character[in].Scaling*dsf.Width)/100;
        int h = (character[in].Scaling*dsf.Height)/100;


Quote
Also, dare I tell that ..well..the character doesn't get tinted on the reflection as it is tinted on region.
Ugh. I figured someone would ask for that. Let me see if it's possible to fix.

Steve

Those aren't the lines! I tried bracketing all of them..but no. I can have a work around this anyway.
Title: Re: Lake Module: Some Questions (Trouble!)
Post by: Kweepa on Mon 04/01/2010 03:34:27
I think I misread your post. You need to set left-to-right to FALSE??
That can't be it. I have it set to TRUE in my demo project and it works fine.
Any chance of uploading the game for me to check?
Title: Re: Lake Module: Some Questions (Trouble!)
Post by: Dualnames on Mon 04/01/2010 03:45:29
Quote from: SteveMcCrea on Mon 04/01/2010 03:34:27
I think I misread your post. You need to set left-to-right to FALSE??
That can't be it. I have it set to TRUE in my demo project and it works fine.
Any chance of uploading the game for me to check?

To quote my post above:
Quote
It needs setting left-to-right precedence on General Windows Pane set to TRUE! And I had it set to FALSE, for my other modules to work.

Lake works only on True, while my other modules work on false.
Title: Re: Lake Module: Some Questions (Trouble!)
Post by: Kweepa on Mon 04/01/2010 04:07:09
I think I misread your post. The second time! :=
Ok, this fixes it (tested!). Line 132

       ds.DrawImage(character[in].x - w/2, (character[in].y - character[in].z) - h, dsf.Graphic, character[in].Transparency, w, h);


I'll upload the fixed module at some point.

[EDIT] Done:
http://www.kweepa.com/step/ags/tech/LakeModule12.zip
Title: Re: Lake Module: Some Questions (Trouble!)
Post by: Dualnames on Mon 04/01/2010 04:33:38
Quote from: SteveMcCrea on Mon 04/01/2010 04:07:09
I think I misread your post. The second time! :=
Ok, this fixes it (tested!). Line 132

       ds.DrawImage(character[in].x - w/2, (character[in].y - character[in].z) - h, dsf.Graphic, character[in].Transparency, w, h);


I'll upload the fixed module at some point.

[EDIT] Done:
http://www.kweepa.com/step/ags/tech/LakeModule12.zip


Thanks Steve!!!! Life saver there!
Title: Re: MODULE: Lake v1.2
Post by: cubehouse on Mon 29/03/2010 21:10:57
Starting to use AGS in a project very shortly and playing around with some of the (OMGZ AWESOMEZ) things I've been finding on the forums.
Using 3.2 at the moment (the "final" release) and tried to get this working.
The RawDrawImageResized seems to be no longer supported?

Anyway, I genuinely am just hacking about at this as I'm a complete n00b to AGS, but I managed to get this module working with 3.2 (which I don't know if we're meant to be discussing supporting until it's officially released? but I thought I'd post what I did).

I had to replace line 161 in Lake.asc:
        RawDrawImageResized(this.x, this.y + i, s.Graphic, this.w, 1);

with
        #ifver 3.2
        DrawingSurface *surface = Room.GetDrawingSurfaceForBackground();
        surface.DrawImage(this.x,  this.y + i, s.Graphic, 0, this.w, 1);
        #endif
        #ifnver 3.2
        RawDrawImageResized(this.x, this.y + i, s.Graphic, this.w, 1);
        #endif

which fixes the compatibility (and backwards compatible! I think I've got the hang of this already!)

and I had to change line 58:
        if ((character.room == player.room)

to
        if ((character.Room == player.Room)

although I don't know if that is right - but it makes it compile and run ;)  (maybe stricter capitalisation checking in 3.2? *shrug*)
Title: Re: MODULE: Lake v1.3
Post by: Kweepa on Tue 30/03/2010 03:16:13
Nice work!
(You could also set "Enforce object-based scripting" to false in General Settings and it will work fine. That's not the default though.)
Actually the lake module is now a horrible mish-mash of 2.7 and 3.0 code that will only work with 3.0+. So I might as well just make it AGSv3 only.

http://www.kweepa.com/step/ags/tech/LakeModule13.zip
Title: Re: MODULE: Lake v1.3
Post by: cubehouse on Tue 30/03/2010 16:20:18
Ah ok, not heard of the Enforce object-based scripting thing.
But it's much nicer to have it work "out-of-the-box" so to speak :)

Is a very awesome script  ;D

Quote from: SteveMcCrea on Tue 30/03/2010 03:16:13
Nice work!
(You could also set "Enforce object-based scripting" to false in General Settings and it will work fine. That's not the default though.)
Actually the lake module is now a horrible mish-mash of 2.7 and 3.0 code that will only work with 3.0+. So I might as well just make it AGSv3 only.

http://www.kweepa.com/step/ags/tech/LakeModule13.zip

Title: Re: MODULE: Lake v1.3
Post by: arj0n on Tue 10/08/2010 22:11:57
Very cool module  :)
Title: Re: MODULE: Lake v1.3
Post by: silverwolfpet on Fri 22/07/2011 03:51:18
I didn't want to write a new topic since we have this one.

I do not understand how you can make characters be reflected in the lake.

32-bit, 1024x756, character sprites are PNGs with transparency.

Any ideas? I've got the latest version of the lake module, and my AGS version is v3.1.2 SP1, February 2009

Help, please?

Code I used in the room:


Lake Room2Lake;

function room_FirstLoad()
{
 Room2Lake.DefaultConstruct();
 Room2Lake.x = 0;
 Room2Lake.y = 500;
 Room2Lake.w = 800;
 Room2Lake.h = 500;
 Room2Lake.yRippleSize = 0.5;
 Room2Lake.xRipplePhaseScale = 0.5;
 Room2Lake.xRipplePhaseScale = 0.5;
}

function room_RepExec()
{
 Room2Lake.Update();
}


EDIT: FOUND the solution!!

For all interested, just play some more with the baselines. You can always use

cEgo.Baseline = 2;  (in the global script)

and then use

Lake.baseline = 4;  (in the room script)

I used to put really low values (like 0 or 1) and it just won't take them. Yay! Fixed it!

But now I has another issue. I'm fading in a title...and as I'm doing that, the lake stops updating.
I tried using

function room_RepExec()
{
 Room2Lake.Update();
}

...but during the fade in of the title (which is an object), the lake won't update. Any ideas? I can move characters while it's fading in...so I have no idea why it's doing that.

EDIT 2: I'm brilliant.

Instead of using a fade IN - fade OUT script, I just (patiently) created 20 sprites (each with +5% transparency) of the title.
THEN I turned it into an object... and I animated that object, specifying not to Block the script (eNoBlock).
Gave it the right timing and voila! It's brilliant!

Thanks :D
Title: Re: MODULE: Lake v1.3
Post by: placyd on Sat 25/08/2012 18:01:01
I'm trying to use this module in my game, but I encountered a problem: backgroundFrameIndex doesn't seem to work for me.
I've imported a new background to frame1 and set the code like this:

sea.backgroundFrameIndex=1;

But it isn't working, the water reflects the original background. Can someone help me with this, please?

Another question about the module: is it possible to fully reflect a character which is below the reflection point? For example the character goes into the water. In this case only that part reflects which is above the y coordinate I've set, not the whole character.
Title: Re: MODULE: Lake v1.3
Post by: Snake on Mon 18/08/2014 00:05:31
Hello! I'm very sorry, I DO know that there hasn't been any posts in this thread for a very long time :-[

This is a very cool module. I have a blocking animation that stops the water from moving when it is called. Is there a way for this module to ignore blocking commands?
Title: Re: MODULE: Lake v1.3
Post by: Dualnames on Mon 18/08/2014 16:38:09
You could move the lake update to repeatedly_execute_always.
Title: Re: MODULE: Lake v1.3
Post by: Snake on Wed 20/08/2014 23:32:57
Hey, Duals, you handsome guy, you. Thank you very much, that is what did the trick! THANKS!
Title: Re: MODULE: Lake v1.3
Post by: Julius Dangerous on Thu 09/07/2015 17:32:57
Great Thanks!!
Title: Re: MODULE: Lake v1.3
Post by: strangeDetective on Tue 13/12/2016 17:06:09
I downloaded the Lake module from this site: http://americangirlscouts.org/agsresources/

And got everything working, except the cursor also reflects in the water. I saw that the module was modified to include a baseline for the Lake, to get around this issue. However the version I have does not have anything about setting a baseline in it so it must be an older version. 

The link in the module's forum entry looks like a dead link. Does anyone have an updated version of this module, or know how I can add the code so the lake will have a baseline and not mirror the cursor?

Thanks for any help.
Title: Re: MODULE: Lake v1.3
Post by: arj0n on Tue 13/12/2016 22:01:34
@strangeDetective:
I do have v1.2, which was released in 2010.
Not sure if it's updated enough compared to the v1.3 (although v1.2 should work for ags 3.0+ I believe) but you can grab it here (http://dam1976.home.xs4all.nl/AGS/modules/) if you like.
Title: Re: MODULE: Lake v1.3
Post by: strangeDetective on Wed 14/12/2016 03:09:59
Quote from: arj0n on Tue 13/12/2016 22:01:34
@strangeDetective:
I do have v1.2, which was released in 2010.
Not sure if it's updated enough compared to the v1.3 (although v1.2 should work for ags 3.0+ I believe) but you can grab it here (http://dam1976.home.xs4all.nl/AGS/modules/) if you like.

Thanks a lot, I'll try it out and see. ;-D
Title: Re: MODULE: Lake v1.3
Post by: strangeDetective on Fri 27/01/2017 00:21:06
Does anyone who has used the Lake module know how to get the characters tint color to show up in the water reflection? I have the latest updated version, and saw this issue mentioned in the thread but cannot find an example of how to do it?:-\
Title: Re: MODULE: Lake v1.3
Post by: abstauber on Fri 27/01/2017 10:56:36
Since I was working on a similar issue, I took the liberty to add these features:
- characters: added tints
- objects: added tints, viewframe animation, scaling and visibility

LakeModule14.zip (http://shatten.sonores.de/wp-content/uploads/2017/01/LakeModule14.zip)

Maybe a moderator could update the first post.

--edit:
I just realized, that AGS supports setting all sorts of tints, but getting them seems to impossible. At least I haven't found out if "SetAmbientTint" did something or an object was directly tinted. On the other hand objects seem to ignore region tinting.

Long story short: I only included support for region tinting. For objects you need the object's tint manually to match the region tint (or use SetAmbient Tint)
Also I added this parameter, which has to be set to true in order to apply region tints to objects.


Lake.tintObjects;


Here's an example

Lake pond;

function room_Load()
{
  myObject.IgnoreScaling =false;
  // manually apply the region tint values to the object.
  myObject.Tint(120, 20, 20, 50, 100);
 
  pond.DefaultConstruct();
  // turn on region tinting for object reflections
  pond.tintObjects = true;

  pond.y = 220;
  pond.w = 320;
  pond.h = 160;
  pond.baseline = 160;
 
}


Title: Re: MODULE: Lake v1.3
Post by: strangeDetective on Sat 28/01/2017 14:00:26
Quote from: abstauber on Fri 27/01/2017 10:56:36
Since I was working on a similar issue, I took the liberty to add these features:
- characters: added tints
- objects: added tints, viewframe animation, scaling and visibility

Thanks I'll try this out:)
Title: Re: MODULE: Lake v1.3
Post by: JLM_82 on Thu 11/02/2021 21:25:58
Is there any updates of this module for AGS 3.5 or above?

I downloaded Lake 1.4 (http://shatten.sonores.de/wp-content/uploads/2017/01/LakeModule14.zip), imported it in the "Scripts" -section, and then got the following error when testing the game:

Code (ags) Select
Lake.asc(139): Error (line 139): undefined symbol 'GetViewportY'

What could be a reason, and is there an easy fix available?

Besides, I'd like to know if there is ANYWHERE available proper instructions how the module should be used in the game? For example, how I should tell for the module where the lake is located in the background image?
Title: Re: MODULE: Lake v1.3
Post by: arj0n on Fri 12/02/2021 10:12:19
for AGS 3.5 or above, just replace the following in the Lake 1.4 script:

GetViewportY() with Game.Camera.Y
GetViewportX() with Game.Camera.X
Title: Re: MODULE: Lake v1.3
Post by: JLM_82 on Fri 12/02/2021 10:18:52
Quote from: arj0n on Fri 12/02/2021 10:12:19
for AGS 3.5 or above, just replace the following in the Lake 1.4 script:

GetViewportY() with Game.Camera.Y
GetViewportX() with Game.Camera.X

Thanks for the idea, hopefully that works!

Has anyone instructions how the module should be used in practice? Let's say, if I have a 300x200px -sized lake in my 640x400 -background-image, how the module should be put to work in order to animate the water-area in image? I assume that the lake animation should be started by the room event "After fade-in".
Title: Re: MODULE: Lake v1.3
Post by: arj0n on Fri 12/02/2021 10:56:25
For all the available options you can use, see the struct info in the lake script header.
Here's a small and very simplistic roomscript example (game res is 320x200):

Code (ags) Select

// room script file
Lake swimmingPoolSurface;

function room_Load()
{
  swimmingPoolSurface.DefaultConstruct();
  swimmingPoolSurface.baseline = 150;
  swimmingPoolSurface.x = 50;
  swimmingPoolSurface.y = 100;
  swimmingPoolSurface.w = 100;
  swimmingPoolSurface.h = 50;
}

function room_RepExec()
{
  swimmingPoolSurface.Update();
}
Title: Re: MODULE: Lake v1.3
Post by: JLM_82 on Mon 15/02/2021 09:30:18
Quote from: arj0n on Fri 12/02/2021 10:56:25
For all the available options you can use, see the struct info in the lake script header.
Here's a small and very simplistic roomscript example (game res is 320x200):

Code (ags) Select

// room script file
Lake swimmingPoolSurface;

function room_Load()
{
  swimmingPoolSurface.DefaultConstruct();
  swimmingPoolSurface.baseline = 150;
  swimmingPoolSurface.x = 50;
  swimmingPoolSurface.y = 100;
  swimmingPoolSurface.w = 100;
  swimmingPoolSurface.h = 50;
}

function room_RepExec()
{
  swimmingPoolSurface.Update();
}


Ok, thanks. So it seems the lake must always have a rectangular shape? No way to create lakes with irregular or round borders?

If it works like that, maybe I'll create a rectangular lake and put a couple of large AGS-objects (rocks, trees etc.) in front of the lake to hide the straight (unnatural) shorelines.