AGS warning log about tinting

Started by Mouth for war, Wed 24/12/2014 01:04:00

Previous topic - Next topic

Mouth for war

ok so I have this in all rooms almost to check if it's day or night so objects and characters will be tinted or have the tint removed "Enters room before fade in"

function room_Load()
{
  RemoveWalkableArea(2);
if(night==0){
  SetBackgroundFrame(1);
  object[0].Tint(0, 0, 250, 65, 100);
}
else if(night==1){
  SetBackgroundFrame(0);
  object[0].RemoveTint();
}
}

As you can see the tints are only affected depending on if night is 0 or 1 but a warning log keeps telling me (for every room more or less) that a "RemoveObjectTint was called but object was not tinted"...There are no errors while playing but that warning log is really annoying
Any idea why this is happening?
mass genocide is the most exhausting activity one can engage in, next to soccer

Mandle

#1
Quote from: Mouth for war on Wed 24/12/2014 01:04:00
ok so I have this in all rooms almost to check if it's day or night so objects and characters will be tinted or have the tint removed "Enters room before fade in"

function room_Load()
{
  RemoveWalkableArea(2);
if(night==0){
  SetBackgroundFrame(1);
  object[0].Tint(0, 0, 250, 65, 100);
}
else if(night==1){
  SetBackgroundFrame(0);
  object[0].RemoveTint();
}
}

As you can see the tints are only affected depending on if night is 0 or 1 but a warning log keeps telling me (for every room more or less) that a "RemoveObjectTint was called but object was not tinted"...There are no errors while playing but that warning log is really annoying
Any idea why this is happening?

It's happening because the object is starting out untinted so AGS is telling you there is no need to remove the tint.

I'm guessing the game starts out in the day time so no objects have been tinted yet, and then after the first night time these warnings stop happening because the objects have been tinted once for night? (I'm assuming here that object tint is part of a room's save state)

Just be sure to turn off debugging before your final compile and this won't be a problem, or you could add an extra check on your else if statement to read if the object is tinted.

Mouth for war

Big...F*****G D'OH.... yeah of course...How the hell could I not think about that?!? I probably thought that objects will stay tinted if i exit a room at night and come back in daytime, so that's why I did that check. Thanks! :D
mass genocide is the most exhausting activity one can engage in, next to soccer

Mandle

Quote from: Mouth for war on Wed 24/12/2014 01:12:44
I probably thought that objects will stay tinted if i exit a room at night and come back in daytime.

They might. I'm not sure as I've never used tinted objects so I don't know if AGS's save room state remembers tints or not.

Mouth for war

I just tried to remove the else if...and if i return at day the object is still tinted blue fast before returning to a normal color...maybe that damn else if must stay then...
mass genocide is the most exhausting activity one can engage in, next to soccer

Mandle

#5
Quote from: Mouth for war on Wed 24/12/2014 01:17:17
I just tried to remove the else if...and if i return at day the object is still tinted blue fast before returning to a normal color...maybe that damn else if must stay then...

Yeah, you can just leave it in and as long as you turn off debugging before you release the game it won't matter. AGS won't send the warning anymore and the game should run just fine.

I'm sure there is also an IsObjectTinted or somesuch test you can add to the else if statement if you want to be uber tidy but there's really no need to that I can see.

Mouth for war

Yeah I'll do that! Thanks for answering :D
mass genocide is the most exhausting activity one can engage in, next to soccer

SMF spam blocked by CleanTalk