The Daily Click ::. Forums ::. Klik Coding Help ::. Darn Alpha Channel Object bug
 

Post Reply  Post Oekaki 
 

Posted By Message

Xhunterko



Registered
  07/05/2003
Points
  1015

VIP MemberHas Donated, Thank You!Hasslevania 2!Pokemon Ball!
28th August, 2009 at 05:38:13 -

Hello.

I think I found a solution to my lighting problem. Yay for me! But, there's a big problem. Here's the relevant files:

http://www.filefront.com/14413511/AlphaChannelBug.zip

Testing
----------
In the firt application, contains four frames. The second applicaton contains what I want to do. I want to create a dark area that has a light that follows the player. While this works, it doesn't seem to want to behave in the firsr application. In my first frame of the Game Engine(first application), I tried to recreate the lighting effect. I could never get the overlay object to appear. I checked all the values and made sure everything in the code was correct. I saved it and pressed play. The overlay didn't appear. I tried it several times. I even tried to create a new application to try the same thing. It worked in the new application, but not in my game. The one that worked is the light application. So, I thought of just creating a new frame and recreate the light there. Which worked.

Carry overs
------------
Then I got the brilliant idea that I could have the overlay switch on and off at a certain spot when the player hit an active object. It worked, sort of. It didn't get the correct position of the active (for some reason, it reacts a few pixels away, even with overlapping). Well, that sucked, so I took out all the code and objects that dealt with the effect, then tested it. Guess what, it still flickered off! Okay, I thought, I just need to try and get the light itself working again. So I started another frame, set up a backdrop, set up the alpha channel, set up the overlay. Made sure all the exact settings are correct and all. Even down to the exact code from the light application, and tested it. The overlay doesn't show up.

Apparently, it has something to do with everything in my first application. Whether it be the acitve character, the overlay, the alpha channel, the backdrop, or something else entirely, I have no idea what could be wrong. Though I'm hoping it's a glitch in my file, I really hope it's not those two objects. Since it works in seperate, newly created files, if I really wanted it to work, I'd move all the graphical objects over. All I want to do, is have a long play level with a darkened area so the player has a light around them. Having the effect fade in would be nice too. Kind of like it does in one of MMX levels. I forget which.

Would anyone like to help?

 
All platforming problems can be mostly solved here:

http://www.clickteam.com/mbfiles2/277308-engine.zip
http://www.angelfire.com/games5/psywakd/platform.gam
www.zephni.com

These are very excellent examples by other people and are very informative.
Image

I work at the speed of "maybe".

Coming Soon: Diary Of An Indie Developer
http://www.youtube.com/watch?v=XaF6H9MrgH8

Twitter:
http://twitter.com/xhunterko

nim



Registered
  17/05/2002
Points
  7232
28th August, 2009 at 05:52:11 -

JakeDebug.mfw shows an error that says "JakesPlayground.mfa contains an invalid path". light.mfa seems to work alright.

If you're having trouble with the overlay object not showing up, try changing its position to (1,1) instead of (0,0) - ridiculous as that sounds, it's worked for me before.



Edited by nim

 
//

Xhunterko



Registered
  07/05/2003
Points
  1015

VIP MemberHas Donated, Thank You!Hasslevania 2!Pokemon Ball!
28th August, 2009 at 06:07:22 -

I'll try and upload it again. What I would basically want to do, is if the player moves into a certain section of a level, have the overlay show up to darken the screen. Then have the alpha channel as a light source for the player. Basically, what the second example does, only as if the player just entered a dark cave. Then, when the player gets out of the cave, (or section of the building without power), the light comes back on.

http://www.filefront.com/14413707/OnlyGame.zip

The application should work now. I got that strange error as well. Thank you for trying to check though.

Edited by Xhunterko

 
All platforming problems can be mostly solved here:

http://www.clickteam.com/mbfiles2/277308-engine.zip
http://www.angelfire.com/games5/psywakd/platform.gam
www.zephni.com

These are very excellent examples by other people and are very informative.
Image

I work at the speed of "maybe".

Coming Soon: Diary Of An Indie Developer
http://www.youtube.com/watch?v=XaF6H9MrgH8

Twitter:
http://twitter.com/xhunterko

nim



Registered
  17/05/2002
Points
  7232
28th August, 2009 at 06:45:26 -

If you need to get this working with the Overlay object, I suggest adding the Active Overlay object to your frame. This lets you move the output of the overlay object around like an active object. I got your example working (I think)

Move the overlay object off the play area and add the Active overlay object at 0,0.

Events:
Always
- (Active overlay) Set Redux Address to ovlAddress( "Overlay Redux" )
- (Active overlay) Update

Make sure that "Follow the frame" is checked in the Active overlay properties.
You don't actually need the Alpha object so you can delete it.

 
//

nim



Registered
  17/05/2002
Points
  7232
28th August, 2009 at 06:50:31 -

That solution above should work, but it's a pretty slow way of achieving the effect. A big active object with a hole in it might actually be faster.

 
//

Xhunterko



Registered
  07/05/2003
Points
  1015

VIP MemberHas Donated, Thank You!Hasslevania 2!Pokemon Ball!
28th August, 2009 at 07:27:09 -

I forgot to check the the follow frame off. Now the only problem is getting it to turn on and off. Which should just be when player overlaps active object, make active overlay visible. The opposite would be for turning it off. But then I'd have to maybe set it to a flag. No? (Was gonna say have seperate objects arranged so that the actives would be only touched a certain way, then I thought of flag.) And I think, that if I want a light or something, all I'd have to do is have another alpha channel for each light in the area. Right?

(Forgot to say thank you!)

Edited by Xhunterko

 
All platforming problems can be mostly solved here:

http://www.clickteam.com/mbfiles2/277308-engine.zip
http://www.angelfire.com/games5/psywakd/platform.gam
www.zephni.com

These are very excellent examples by other people and are very informative.
Image

I work at the speed of "maybe".

Coming Soon: Diary Of An Indie Developer
http://www.youtube.com/watch?v=XaF6H9MrgH8

Twitter:
http://twitter.com/xhunterko

Xhunterko



Registered
  07/05/2003
Points
  1015

VIP MemberHas Donated, Thank You!Hasslevania 2!Pokemon Ball!
29th August, 2009 at 22:32:23 -

Yo, me again!

Now I am trying to create this effect. Using the overlay redux object, I am trying to get it to fade in from clear, to a dark black, then back again. I have tried some things but its just not looking right. I'll try another idea here in a minute.

 
All platforming problems can be mostly solved here:

http://www.clickteam.com/mbfiles2/277308-engine.zip
http://www.angelfire.com/games5/psywakd/platform.gam
www.zephni.com

These are very excellent examples by other people and are very informative.
Image

I work at the speed of "maybe".

Coming Soon: Diary Of An Indie Developer
http://www.youtube.com/watch?v=XaF6H9MrgH8

Twitter:
http://twitter.com/xhunterko
   

Post Reply



 



Advertisement

Worth A Click