SayAt help

Started by pseudo3d, Sat 20/07/2013 14:35:15

Previous topic - Next topic

pseudo3d

This is probably an extremely stupid question, but I'm having a bit of problems in writing the script properly.

// Lock door on startup when entering the room
  set_door_state(20, 2);
  init_object(20, oDoor.ID);
  player.FaceDirection(eDir_Down);
    cBman.SayAt player("Mike? MIKE!");
    player.Say("Hey! This is just a test!");
    player.Say("Now get started with your own game.");
    cBman.Say("Have fun!");

I'm having a bit of trouble making the "SayAt player" work properly, it won't compile otherwise. What am I doing wrong?

Adeel

#1
You need to specify the x and y coordinates for SayAt. Secondly, SayAt is a complete syntax (it doesn't need some other word to join with). So your code should be like this:

Code: AGS
// Lock door on startup when entering the room
  set_door_state(20, 2);

  init_object(20, oDoor.ID);

  player.FaceDirection(eDir_Down);

  cBman.SayAt(x, y, wide, "Mike? MIKE!"); // where: x,y are the: x-coordinate and y-coordinate (respectively) of the screen where you want to display your text. Also, wide is the value of width of that area where you want your text to appear.

    player.Say("Hey! This is just a test!");

    player.Say("Now get started with your own game.");

    cBman.Say("Have fun!");


An example of cBman.SayAt:
Code: AGS
cBman.SayAt(220, 20, 100, "I am Batman.");  
//this will display the line, I am Batman at top corner of the screen


I hope this helps...
BTW, why are you using FaceDirection? What does it do? I inquired manual but didn't find a thing. What version of AGS are you using?

EDIT: For more description, see here: SayAt.

Khris

Yes, the At part isn't in reference to another Character*, it's about the position of the text on the screen.
Even if it were though, the other character would be inside the parentheses, just like any other parameter of a function call.


Adeel: Character.FaceDirection() is available in some templates, for instance the 9verb one I believe.

Adeel

Quote from: Khris on Sat 20/07/2013 18:08:03
Adeel: Character.FaceDirection() is available in some templates, for instance the 9verb one I believe.

That makes sense, since all the default functions are listed in the manual. Thanks Khris.

SMF spam blocked by CleanTalk