Jump to content


Photo

surface not drawing in my main project but will in others


  • Please log in to reply
2 replies to this topic

#1 smbmaster99

smbmaster99

    GMC Member

  • GMC Member
  • 106 posts

Posted 28 March 2016 - 04:20 AM

Hey, i've run into a rather strange bug with my game. I've programmed a day/night cycle where a surface is created once the time reaches a certain point in the day, but for some reason the darkness won't draw. It draws in a "test" project i made for quicker testing but the code, which is almost 100% copied identically doesn't want to work in my main project.

 

This is what it looks like in the "test" project (that i used to create it and test it more quickly):

ez6SYvJ.png

(the 0.15 is an incrementer that changes how dark or light it is)
and here's all the code:

The control object:

Spoiler

The light object:

Spoiler


Yup, that's pretty much it. It works in my test project, but when i moved the code over to my main project, this is what i get:
lJljh7H.png

It should be about 50% opaque right now, but there's no darkness at all. Yeah there were some very slight changes made to the code, but it should still work....but it's not :v Here's the code, this time from my main project. The surface is handled in a control object that handles weather and time of day changes. I only included the parts of the object that controls or refers to the surface in some way
Spoiler

 

And yeah that's about it. Of course, i check for and remove the surfaces when they're no longer needed, but that only happens when the room ends or it turns day time again. So is anyone able to tell me why the surface/darkness won't draw?


Edited by smbmaster99, 28 March 2016 - 04:24 AM.

  • 0

#2 flyingsaucerinvasion

flyingsaucerinvasion

    GMC Member

  • GMC Member
  • 720 posts
  • Version:GM:Studio

Posted 28 March 2016 - 04:44 AM

You're not supposed to draw anything outside the draw events.

 

Also make sure whatever is drawing the surface either has a lower depth than everything else or draws the surface during the draw end event.


  • 0

#3 smbmaster99

smbmaster99

    GMC Member

  • GMC Member
  • 106 posts

Posted 28 March 2016 - 08:42 PM

what's weird though is that it's drawing in the other "test" file from within the end step event, but when it's moved over to the main project it doesn't, despite it's location (event-wise) not being changed. It's depth is also set to -101, the second most negative depth object in the game, only behind the main control object which is at -9999

EDIT: WAAAIT i think i know what i did wrong. I have an exit statement used in the end step event if certain weather actions aren't happening, so if that's what the problem is, then this topic can be closed. I'll edit this post again once i know for certain.

EDiT2: yup, that did the trick lol. I knew i shouldn't have tried moving it all over when i was tired :v

 

thanks for the help lol


Edited by smbmaster99, 28 March 2016 - 09:15 PM.

  • 0