Adventure Game Studio

AGS Support => Beginners' Technical Questions => Topic started by: acha1993 on Fri 18/01/2008 14:51:46

Title: Object question
Post by: acha1993 on Fri 18/01/2008 14:51:46
I need to set a door as an object, when the character uses it, it shows another object that is an oper door. Everything is OK up to here. The problem is that the character appears behind the object, how can i change things to make my character to appear over objects?
Title: Re: Object question
Post by: on Fri 18/01/2008 15:00:46
Did you remember to set a baseline for the object? (room editor -> object -> set baseline)
Title: Re: Object question
Post by: Khris on Fri 18/01/2008 15:59:07
Also, you don't need to use two objects, you can change the sprite of the object.
Say the door object's scriptname is "oDoor", then in the interact script you'd put:
  if (oDoor.Graphic == 33) oDoor.Graphic = 34;
  else oDoor.Graphic = 33;


Interacting the door will now switch between the two sprites. (Keep in mind that without extra code, both sprites are aligned at the bottom left, so if the door opens to the left, you might have to add a transparent area to the left of the closed sprite and move the object position in the editor.)
Title: Re: Object question
Post by: acha1993 on Fri 18/01/2008 20:34:40
The baseline help was the solution, thank you.