[SOLVED] Char facing location at entering room

Started by Irathril, Sat 03/10/2009 14:01:49

Previous topic - Next topic

Irathril

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

Code: ags

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


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

EDIT: Any other coordenate works.

monkey0506

Well an obvious question would be what cSailor2's actual co-ordinates are. Does something such as:

Code: ags
cSailor2.FaceLocation(cSailor2.x - 1000, cSailor2.y);


work?

Irathril


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)

Matti

That is strange and I have no clue what is going wrong. But you could test if cSailor2.Loop=1 works.

Irathril

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?

Crimson Wizard

#5
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?

Khris

Exactly, room_BeforeFadeIn never gets called by AGS except if you entered that name manually in the event pane.

Irathril

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.

Code: ags
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.



Crimson Wizard

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.

Code: ags
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?

Irathril

[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.

Khris

Open the room in the editor, then click the thunderbolt icon (while the drop down menu says "room ...").

Crimson Wizard

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 -

Check that

Irathril


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 :)

SMF spam blocked by CleanTalk