Adventure Game Studio

AGS Support => Beginners' Technical Questions => Topic started by: simulacra on Tue 12/10/2004 00:38:56

Title: Character appearing [SOLVED]
Post by: simulacra on Tue 12/10/2004 00:38:56
A silly question: how do I make a character appear in a certain room? I have tried editing the "start in room" setting and

character[ENGINE].room = 42;

What do I do wrong?
Title: Re: Character appearing
Post by: TerranRich on Tue 12/10/2004 00:46:25
In ENGINE a non-player character (NPC)? If so, you have just moved him to that room. If you want to actually go there, you must call a separate player.room=... command or a NewRoom()/NewRoomEx() command. If it's the player character, it should move you along with it. Does room #42 exist? What actually happens when you test this out?
Title: Re: Character appearing
Post by: simulacra on Tue 12/10/2004 00:53:31
ENGINE is a NPC. I put this code in the "Players enters screen (before fadein)" section. But when I go to room 42, the character didn't appear. I can only see the background.
Title: Re: Character appearing
Post by: Gilbert on Tue 12/10/2004 02:28:56
What's the character's coordinates? He can be out of the screen. Furthermore, is it possible that he's behind a walkbehind area?
Title: Re: Character appearing
Post by: Goot on Tue 12/10/2004 03:11:29
And make sure that 42 is correct room number.
Title: Re: Character appearing
Post by: Radiant on Tue 12/10/2004 09:20:06
It is also possible that he is transparent (see SetCharTransparency), or has a view attached that is simply an empty image. Or has a baseline that is set wrongly.
Title: Re: Character appearing
Post by: simulacra on Tue 12/10/2004 13:27:17
Quote from: Radiant on Tue 12/10/2004 09:20:06Or has a baseline that is set wrongly.


I haven't set a baseline. This is likely the problem. I'll get back to you when I have tested it. And thank you for the fast, professional responses!
Title: Re: Character appearing
Post by: Barbarian on Tue 12/10/2004 13:44:32
Yep, and also check the co-ordinates again of where you want the character to appear and that it's on a visible spot in that room. To do it via scripting, it might look like:

character[ENGINE].room = 42;
character[ENGINE].x=(150);
character[ENGINE].y=(100);   

And I think by default, the character baseline is set at the bottom placement of the Y posistion? But you could change this as you like (as an example) with:

SetCharacterBaseline(ENGINE,100);