changing position at random & speech windows

Started by Mr. Mozzarella, Sat 05/03/2005 13:52:48

Previous topic - Next topic

Mr. Mozzarella

I have two very different questions, but I put them together in order not to open too many new threads ...  ;)

1. Question:
When the Player enters a certain room (before fadein), I want the character EDWARD to change his position randomly. So one time he will sit at X0,Y0 another time at X1,Y1 and another time at X2,Y2
My script looks like this:

int edpos = Random(2);
if (edpos == 0) {
  MoveCharacterBlocking (EDWARD,40,140,1);
  AnimateCharacter(EDWARD,0,0,1);
  }
else if (edpos == 1) {
  MoveCharacterBlocking (EDWARD,110,100,1);
  AnimateCharacter(EDWARD,0,0,1);
  }
else{
  MoveCharacterBlocking (EDWARD,208,100,1);
  AnimateCharacter(EDWARD,0,0,1);
}

But, if I use Blocking, I get an error saying that I can only do this AFTER Fadein.
If I run the script after fadein, I see the sitting character floating across the screen (which I don't want. I want him to be there immediately)
If I don't use Blocking, nothing happens at all.

What can I do to fix that?


And I would like to know a second thing as well:
I want a small closeup picture of the character to appear in one of the edges, when the character is talking. Like here in KQ2 VGA:


How do I do that? Do I have to create Objects and turn them on and off during the dialog or is there a more simple way?

Thanks in advance :)
Night of Fire - Thread

I control, I am in charge of
Everyones future, red button is mine

Ashen

1.
Try just setting the character position before the fadein, then animating him after. E.g.:
Code: ags

#sectionstart room_a  // DO NOT EDIT OR REMOVE THIS LINE
function room_a() {
  // script for room: Player enters screen (before fadein)
  int edpos = Random (2);
  if (edpos == 0 {
    character[EDWARD].x = 40;
    character[EDWARD].y = 140;
  }
  else if (edpos == 1) {
    character[EDWARD].x = 110;
    character[EDWARD].y = 100;
  }
  else if (edpos == 0 {
    character[EDWARD].x = 208;
    character[EDWARD].y = 100;
  }
}
#sectionend room_a  // DO NOT EDIT OR REMOVE THIS LINE

#sectionstart room_b  // DO NOT EDIT OR REMOVE THIS LINE
function room_b() {
  // script for room: Player enters screen (after fadein)
  AnimateCharacter(EDWARD,0,0,1);
}
#sectionend room_b  // DO NOT EDIT OR REMOVE THIS LINE


2.
There's an easier way: On the 'General settings' window, change 'Speech style' to 'Sierra-style' or 'Siera-style w/ background'
I know what you're thinking ... Don't think that.

Mr. Mozzarella

Quote from: Ashen on Sat 05/03/2005 14:37:09
1.
Try just setting the character position before the fadein, then animating him after. E.g.:
Code: ags

#sectionstart room_aÃ,  // DO NOT EDIT OR REMOVE THIS LINE
function room_a() {
Ã,  // script for room: Player enters screen (before fadein)
Ã,  int edpos = Random (2);
Ã,  if (edpos == 0 {
Ã,  Ã,  character[EDWARD].x = 40;
Ã,  Ã,  character[EDWARD].y = 140;
Ã,  }
Ã,  else if (edpos == 1) {
Ã,  Ã,  character[EDWARD].x = 110;
Ã,  Ã,  character[EDWARD].y = 100;
Ã,  }
Ã,  else if (edpos == 0 {
Ã,  Ã,  character[EDWARD].x = 208;
Ã,  Ã,  character[EDWARD].y = 100;
Ã,  }
}
#sectionend room_aÃ,  // DO NOT EDIT OR REMOVE THIS LINE

#sectionstart room_bÃ,  // DO NOT EDIT OR REMOVE THIS LINE
function room_b() {
Ã,  // script for room: Player enters screen (after fadein)
Ã,  AnimateCharacter(EDWARD,0,0,1);
}
#sectionend room_bÃ,  // DO NOT EDIT OR REMOVE THIS LINE


2.
There's an easier way: On the 'General settings' window, change 'Speech style' to 'Sierra-style' or 'Siera-style w/ background'


Thanks. I'll try that.
Night of Fire - Thread

I control, I am in charge of
Everyones future, red button is mine

SMF spam blocked by CleanTalk