The Daily Click ::. Forums ::. Klik Coding Help ::. Fog of War/Negating mouse-over commands
 

Post Reply  Post Oekaki 
 

Posted By Message

Rick Cameron



Registered
  11/03/2012 08:45:25
Points
  82
27th December, 2013 at 27/12/2013 08:53:14 -

Hey guys,

I have a grid of actives (let's call them FOG) set up in my current project, and I'm trying to make it so if something IS 'colliding' with the FOG, it will become transparent, but if it is NOT colliding, it will revert to mostly solid.

I'm testing this out with the mouse in place of any units or anything at the moment, like this:

IF Mouse is over Object:FOG - Set FOG Opacity to (X)
X If mouse is over Object:FOG - Set FOG Opacity to

(That X represents me 'negating' the command)

For whatever reason, it does not seem to pick up the negate command and revert the opacity to it's original value, and the FOG object will stay at Opacity X.

HALP.

Cheers guys!

 
n/a

markrasher



Registered
  25/02/2013 18:43:57
Points
  34
27th December, 2013 at 27/12/2013 16:28:22 -

try making an object than making it invisible
and set the objects position to the mouse position
and then do:
if object is colliding with fog : set fog transparency to X

hope that works

 
Check out my survival game project:
http://www.create-games.com/project.asp?view=main&id=2424

Rick Cameron



Registered
  11/03/2012 08:45:25
Points
  82
27th December, 2013 at 27/12/2013 22:51:55 -

I'll give that a shot!

My temporary workaround was to have an event that resets the alt value of the fog active every .25 seconds or so, so it's ugly but stable at the moment. In the end the mouse isn't even going to interact with the fog anyway, as soon as I program some units and buildings in I will see what happens!

Thanks for the help!

 
n/a

markrasher



Registered
  25/02/2013 18:43:57
Points
  34
29th December, 2013 at 29/12/2013 15:14:00 -

if it doesnt work try:
if object is overlapping the fog : set fog transparency to x
didnt realize that

 
Check out my survival game project:
http://www.create-games.com/project.asp?view=main&id=2424

Zode



Registered
  13/04/2009
Points
  239

PS3 Owner
29th December, 2013 at 29/12/2013 18:27:42 -

Always:
Set fog opacity to (0)

when mouse is over object fog:
Set fog opacity to (255)





 
n/a

Rick Cameron



Registered
  11/03/2012 08:45:25
Points
  82
29th December, 2013 at 29/12/2013 22:54:15 -

Zode, I feel like the biggest idiot in the world. For some reason I always fear always commands, and I had it in the back of my mind that it would result in a flashing Active as the two commands battle, but no, it works perfectly.

>.>

Thanks!

And Mark - I'll check that out as soon my internet stops being strange. For some reason webpages and such are barely loading, I think my flatmates are dominating the bandwidth at the mo. From the screenshot I can see though it looks like you have an AWESOME little fog mechanic going on that I will have to check out.

Anyway. Back to the Rogue-like Base Management Tactical RTS goodness!

 
n/a
   

Post Reply



 



Advertisement

Worth A Click