Adventure Game Studio

AGS Support => Beginners' Technical Questions => Topic started by: meadforspeed on Sun 17/02/2013 04:36:23

Title: Disabling Character on 2nd Background (SOLVED)
Post by: meadforspeed on Sun 17/02/2013 04:36:23
So basically what I want to do is have an up-close view of an object when that object is interacted with. Right now I've got it set so that when the player interacts with the object, the view switches to a second background, I got that working just fine, my problem is I can't seem to figure out how to disable walkable areas for JUST this second background. I'd also need to make the player character invisible on this second background, instead of both, which is currently the problem. I did a re-read of the tutorial again and I'm sorry if I'm missing something obvious! Thanks!
Title: Re: Disabling Character on 2nd Background
Post by: Hernald on Sun 17/02/2013 05:19:49
In the window that shows the second room on the right hand side about halfway down it says ShowPlayerCharacter True; change that to False.
Title: Re: Disabling Character on 2nd Background
Post by: Peder 🚀 on Sun 17/02/2013 05:24:51
Hernald beat me to the solution if you use a separate room though I've left it in anyway since I made a screenshot of it..

If you are using a separate room for the close up then you can do this in the room with the close up:
(http://i.imgur.com/GC0dzkk.png)

If it's within the same room I guess maybe creating a walk-behind area that covers the whole screen and is disabled by default and activated whenever the close up is activated..

Code (AGS) Select
SetWalkBehindBase (int area, int baseline)

Changes the walk-behind AREA to have new BASELINE. This effectively allows you to turn walk-behinds on and off, although you can do other tricks with it as well. BASELINE is from 1 to the height of the room (normally 200) and moves the line which you set originally in the editor.

Passing BASELINE as 0 disables the walk-behind area, so that the player will always walk in front of it.

Basically, if the character's feet are below BASELINE, he will be drawn in front of it, otherwise he will be drawn behind it.
Title: Re: Disabling Character on 2nd Background
Post by: Khris on Sun 17/02/2013 12:08:51
You can simply turn off the walk cursor and move the player off-screen:
Code (ags) Select
// room variable, declared at the very top of the room script
int old_y;

// looking at the object
  SetBackgroundFrame(1);
  mouse.DisableMode(eModeWalkto);
  old_y = player.y;
  player.y = -1;

// closing close-up
  SetBackgroundFrame(0);
  mouse.EnableMode(eModeWalkto);
  player.y = old_y;
Title: Re: Disabling Character on 2nd Background
Post by: meadforspeed on Mon 18/02/2013 07:05:04
Thanks guys! I really appreciate the help!