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.
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?
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)
That is strange and I have no clue what is going wrong. But you could test if cSailor2.Loop=1 works.
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?
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?
Exactly, room_BeforeFadeIn never gets called by AGS except if you entered that name manually in the event pane.
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.
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?
[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.
Open the room in the editor, then click the thunderbolt icon (while the drop down menu says "room ...").
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)
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 :)