Module: EpicShadows 1.0 (AGS 3.02+) - based on Shadow module by SSH

Started by Dusk, Sat 23/08/2008 21:37:12

Previous topic - Next topic

Slasher

#20
Hi

when the player starts from a walkbehind the shadow fails to appear. The object is spelled right and is just above walkable area. It is ok in other rooms

any ideas?

Slasher

I edited the room to not have that particular walkbehind and it works as it should... all ok (nod)

Potajito

Hi there! As I'm still using this module, I did a quick and dirt fix for it to work in modern AGS versions (module compatibility setting wasn't cutting it). Posting it here in case anyone wants it: https://drive.google.com/file/d/1iLAHrmQ2Fnqp_hfuuPNCz-g-O77KOf7O/view?usp=sharing

Crimson Wizard

Quote from: Potajito on Mon 31/05/2021 16:56:22
As I'm still using this module, I did a quick and dirt fix for it to work in modern AGS versions (module compatibility setting wasn't cutting it).

This module compiles properly if you set "Script compatibility level" to 3.4.1 (3.5.0 was the first version where System.ViewportWidth and other viewport-related things were deprecated). Or were there any other problems?

Potajito

Quote from: Crimson Wizard on Mon 31/05/2021 17:06:29
Quote from: Potajito on Mon 31/05/2021 16:56:22
As I'm still using this module, I did a quick and dirt fix for it to work in modern AGS versions (module compatibility setting wasn't cutting it).

This module compiles properly if you set "Script compatibility level" to 3.4.1 (3.5.0 was the first version where System.ViewportWidth and other viewport-related things were deprecated). Or were there any other problems?
There were! It wasn't properly hiding the dummy object when changing rooms.

Crimson Wizard

Quote from: Potajito on Mon 31/05/2021 23:38:28
There were! It wasn't properly hiding the dummy object when changing rooms.

Do you know what happened to be a reason?
I'm comparing original code and your version, and don't see much difference tbh, rather than for initial object position. Everything else is mostly GetViewport* functions replaced with Camera counterparts.
I'm asking because in theory I'd like to keep AGS 3.5.* backwards compatible as much as possible.

One thing that I might mention, you create new camera every time a room is loaded, but that camera is never deleted.
Custom Viewports and Cameras are bit special in a way that they are not automatically deleted even when the pointer variable is gone. You have to actually call .Delete() for it.
(All created cameras are stored in Game.Cameras[] array)

Code: ags

this.shadowsCanvas = DynamicSprite.Create(cam.Width, Room.Height-this.oShadows.Y);

Probably you could just use Game.Camera.Width instead here.

Laura Hunt

Quote from: Crimson Wizard on Tue 01/06/2021 00:02:11
One thing that I might mention, you create new camera every time a room is loaded, but that camera is never deleted.

Off-topic, but this reminded me that in "La Maleta", a warning.log was generated after I finished playing with a huge list of dynamic sprites that were never deleted. Potajito, maybe you've already fixed that, but if not, you might want to look into it :)

Potajito

Quote from: Crimson Wizard on Tue 01/06/2021 00:02:11
Quote from: Potajito on Mon 31/05/2021 23:38:28
There were! It wasn't properly hiding the dummy object when changing rooms.

Do you know what happened to be a reason?
I'm comparing original code and your version, and don't see much difference tbh, rather than for initial object position. Everything else is mostly GetViewport* functions replaced with Camera counterparts.
I'm asking because in theory I'd like to keep AGS 3.5.* backwards compatible as much as possible.

One thing that I might mention, you create new camera every time a room is loaded, but that camera is never deleted.
Custom Viewports and Cameras are bit special in a way that they are not automatically deleted even when the pointer variable is gone. You have to actually call .Delete() for it.
(All created cameras are stored in Game.Cameras[] array)

Code: ags

this.shadowsCanvas = DynamicSprite.Create(cam.Width, Room.Height-this.oShadows.Y);

Probably you could just use Game.Camera.Width instead here.
True that! Thanks for mentioning. I used Game.Camera.Width initially, then made some changes, then deleted them and that remained there. I'm still trying to understand the camera/viewport system and their differences D:

Quote from: Laura Hunt on Tue 01/06/2021 08:09:52
Quote from: Crimson Wizard on Tue 01/06/2021 00:02:11
One thing that I might mention, you create new camera every time a room is loaded, but that camera is never deleted.

Off-topic, but this reminded me that in "La Maleta", a warning.log was generated after I finished playing with a huge list of dynamic sprites that were never deleted. Potajito, maybe you've already fixed that, but if not, you might want to look into it :)
Yeah, that should be fixed now!

SMF spam blocked by CleanTalk