Adventure Game Studio

AGS Support => Beginners' Technical Questions => Topic started by: Irathril on Sat 03/10/2009 14:01:49

Title: [SOLVED] Char facing location at entering room
Post by: Irathril on Sat 03/10/2009 14:01:49
Hi all.

I'm a completely begginer in AGS. I probably have the most simple question ever, but I've been looking for the answer on manual and forum and I have not found the answer.

In my game, the player enters a room and he meets a character there. I want that character (sailor2)  to be facing left when player enters the room. Just this.

I've tried a thousand things to do it, and I couldn't do it. The last thing I tried was that on Room script


function room_BeforeFadeIn()
{
 cSailor2.FaceLocation(170, 105);
 }


that actually didn't work. Could someone help me?

EDIT: Any other coordenate works.
Title: Re: Char facing location at entering room
Post by: monkey0506 on Sat 03/10/2009 14:04:57
Well an obvious question would be what cSailor2's actual co-ordinates are. Does something such as:

cSailor2.FaceLocation(cSailor2.x - 1000, cSailor2.y);

work?
Title: Re: Char facing location at entering room
Post by: Irathril on Sat 03/10/2009 14:52:05

no, he still face to the front (and yes, I've checked all te views for the char and so, I've used it in the game many times)
Title: Re: Char facing location at entering room
Post by: Matti on Sat 03/10/2009 14:59:23
That is strange and I have no clue what is going wrong. But you could test if cSailor2.Loop=1 works.
Title: Re: Char facing location at entering room
Post by: Irathril on Sat 03/10/2009 20:47:10
Quote from: Mr Matti on Sat 03/10/2009 14:59:23
That is strange and I have no clue what is going wrong. But you could test if cSailor2.Loop=1 works.

yes, it works. I even have created a dialog, and the player can speak with him normally, and Sailor2 reacts at Facecharacter and turns.

The only thing that doesn't work is having him looking to the left when the player enters the room. that should be included in the function room_BeforeFadeIn, right?
Title: Re: Char facing location at entering room
Post by: Crimson Wizard on Sat 03/10/2009 21:04:20
Quote from: Irathril on Sat 03/10/2009 20:47:10

The only thing that doesn't work is having him looking to the left when the player enters the room. that should be included in the function room_BeforeFadeIn, right?

Wel, what about trying some crazy ideas...
For example, is your function "room_BeforeFadeIn" actually bound to event in the events table?
By the way, in AGS 3.X this function is called "room_Load" by default. Can it be the cause?


What if you put some other commands in that function, will they work?
Title: Re: Char facing location at entering room
Post by: Khris on Sun 04/10/2009 14:36:36
Exactly, room_BeforeFadeIn never gets called by AGS except if you entered that name manually in the event pane.
Title: Re: Char facing location at entering room
Post by: Irathril on Sun 04/10/2009 18:32:17
Quote from: Crimson Wizard on Sat 03/10/2009 21:04:20
Quote from: Irathril on Sat 03/10/2009 20:47:10

The only thing that doesn't work is having him looking to the left when the player enters the room. that should be included in the function room_BeforeFadeIn, right?

Wel, what about trying some crazy ideas...
For example, is your function "room_BeforeFadeIn" actually bound to event in the events table?
By the way, in AGS 3.X this function is called "room_Load" by default. Can it be the cause?


What if you put some other commands in that function, will they work?

I tried with room_Load(), nothing happens yet.
I added a shakescreen, it doesnt work too.

function room_Load()
{
  cSailor2.FaceLocation(cSailor2.x - 1000, cSailor2.y);
    ShakeScreen(1);

  }


It's strange, because in another room (room1) I made a cutscene with function room_AfterFadeIn, and I had no problems.


Title: Re: Char facing location at entering room
Post by: Crimson Wizard on Sun 04/10/2009 19:01:35
Quote from: Irathril on Sun 04/10/2009 18:32:17
I tried with room_Load(), nothing happens yet.
I added a shakescreen, it doesnt work too.

function room_Load()
{
  cSailor2.FaceLocation(cSailor2.x - 1000, cSailor2.y);
    ShakeScreen(1);

  }


It's strange, because in another room (room1) I made a cutscene with function room_AfterFadeIn, and I had no problems.


Can you please re-check that this function (now room_Load) is actually bound to an event in the events table for this very room?
Title: Re: Char facing location at entering room
Post by: Irathril on Mon 05/10/2009 09:44:16
[quote author=Crimson Wizard link=topic=39003.msg513324#msg513324 date=1254679295

Can you please re-check that this function (now room_Load) is actually bound to an event in the events table for this very room?
[/quote]

how can I check it?

damn, I'm afraid I'm a completely noob.
Title: Re: Char facing location at entering room
Post by: Khris on Mon 05/10/2009 11:22:35
Open the room in the editor, then click the thunderbolt icon (while the drop down menu says "room ...").
Title: Re: Char facing location at entering room
Post by: Crimson Wizard on Mon 05/10/2009 13:22:08
Quote from: Khris on Mon 05/10/2009 11:22:35
Open the room in the editor, then click the thunderbolt icon (while the drop down menu says "room ...").

Just in case

Click there -
(http://www.2dadventure.com/ags/room_events_1.png)
Check that
(http://www.2dadventure.com/ags/room_events_2.png)
Title: Re: Char facing location at entering room
Post by: Irathril on Mon 05/10/2009 21:06:25

Lol... that was it. I erased accidentally the text in event box.  I was becoming crazy for just this. XD

Thank you khris and crimson, you helped a lot :)