MODULE: Lake v1.3

Started by Kweepa, Sun 09/07/2006 04:16:49

Previous topic - Next topic

Rui 'Trovatore' Pires

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
Reach for the moon. Even if you miss, you'll land among the stars.

Kneel. Now.

Never throw chicken at a Leprechaun.

Gilbert

Thanks Redrum, I had updated the first post. :)

.M.M.


Dualnames

#23
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?
Worked on Strangeland, Primordia, Hob's Barrow, The Cat Lady, Mage's Initiation, Until I Have You, Downfall, Hunie Pop, and every game in the Wadjet Eye Games catalogue (porting)

Kweepa

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
Still waiting for Purity of the Surf II

Kweepa

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.
Still waiting for Purity of the Surf II

Dualnames

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
Worked on Strangeland, Primordia, Hob's Barrow, The Cat Lady, Mage's Initiation, Until I Have You, Downfall, Hunie Pop, and every game in the Wadjet Eye Games catalogue (porting)

monkey0506

Ah but Dual CJ removed the "Make my game" button... :'(

R.I.P. "Make my game"

Dualnames

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!
Worked on Strangeland, Primordia, Hob's Barrow, The Cat Lady, Mage's Initiation, Until I Have You, Downfall, Hunie Pop, and every game in the Wadjet Eye Games catalogue (porting)

Dualnames

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?
Worked on Strangeland, Primordia, Hob's Barrow, The Cat Lady, Mage's Initiation, Until I Have You, Downfall, Hunie Pop, and every game in the Wadjet Eye Games catalogue (porting)

Shane 'ProgZmax' Stevens

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.

Kweepa

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.
Still waiting for Purity of the Surf II

Dualnames

#32
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*
Worked on Strangeland, Primordia, Hob's Barrow, The Cat Lady, Mage's Initiation, Until I Have You, Downfall, Hunie Pop, and every game in the Wadjet Eye Games catalogue (porting)

Kweepa

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:
Code: ags

        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
Still waiting for Purity of the Surf II

Dualnames

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:
Code: ags

        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.
Worked on Strangeland, Primordia, Hob's Barrow, The Cat Lady, Mage's Initiation, Until I Have You, Downfall, Hunie Pop, and every game in the Wadjet Eye Games catalogue (porting)

Kweepa

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?
Still waiting for Purity of the Surf II

Dualnames

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.
Worked on Strangeland, Primordia, Hob's Barrow, The Cat Lady, Mage's Initiation, Until I Have You, Downfall, Hunie Pop, and every game in the Wadjet Eye Games catalogue (porting)

Kweepa

#37
I think I misread your post. The second time! :=
Ok, this fixes it (tested!). Line 132
Code: ags

        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
Still waiting for Purity of the Surf II

Dualnames

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
Code: ags

        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!
Worked on Strangeland, Primordia, Hob's Barrow, The Cat Lady, Mage's Initiation, Until I Have You, Downfall, Hunie Pop, and every game in the Wadjet Eye Games catalogue (porting)

cubehouse

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*)

SMF spam blocked by CleanTalk