Hi guys,
Ive got a character that is never visible on screen but visible for dialogs (a 911 dispatcher). When the player uses the radio, I placed this at the top of the "send" button's script:
int iPlayerX = player.x;
if (iPlayerX >= 512) //player is to the right
{
cDispatcherA.Move(0, -100); //move DispatcherA to the left
}
else if (iPlayerX < 512) //player is to the left
{
cDispatcherA.Move(1000, -100); //move DispatcherA to the right
}
I figured that by moving the dispatcher character the opposite side of the main player, when they engage in a conversation the portraits speech views would be also opposite each other...however, surprisingly regardless of my above code, the dispatcher's speech portrait is always on the left, no matter what.
I placed the dispatcher's starting room to "none" and have this code in "on_event" to automatically place the dispatcher character into the room that is being loaded:
void on_event (EventType event, int data)
{
if ((event == eEventEnterRoomBeforeFadein) && ((data != 0) || (data != 7)))
{
cDispatcherA.ChangeRoom(data, -100, -100);
}
}
Sierra-Style portrait location is set to "BasedOnCharacterPosition" in General Settings.
Any ideas why I cant seem to make the dispatcher's speech portrait to display opposite of the player's speech portrait?
If I were to guess, I'd say it's because you're using "move" when the character isn't on walkable areas. Is there a reason you're not just changing it's X coords? :P
cDispatcherA.x=1000;
Hmm, I thought I "had" to use the move function...ok, much better to do it this way! You're right, using the move function I had to make sure the player is on a walkable area.
So did that solve your issue?
And yeah, I know what that's like. Things I would normally think were easy with CSS for webpages are driving me insane today! :D
i suggest a useful extender function from a particular module...
although I shall rewrite a similar one here,
function SetPos(this Character*, int x, int y){
this.x = x;
this.y = y;
}
usage:
cEgo.SetPos(100,100);
Oh nice!
Thanks guys...solves it quite beautifully :)