Player "say" without text...? **SOLVED**

Started by Knox, Tue 10/08/2010 13:29:50

Previous topic - Next topic

Knox

Hi,

Ive got a custom script that shows character expressions (not finished, still debugging):

Code: ags

void showExpression(this Character*, Expressions eExpressionType, Expression_Length eLength, String sSay)
{
  int iView;
  int iBlink;
  int iLength;
  int iDefaultLength;
  bool bIsGamePaused;
  iDefaultLength = Game.MinimumTextDisplayTimeMs;
  
  bIsGamePaused = IsGamePaused();
  
  if (eLength == eShort) iLength = 750;
  else if (eLength == eMedium) iLength = 1500;
  else if (eLength == eLong) iLength = 2500;
  
  previousView = this.GetSpeechView();
  
  if (eExpressionType == eSmile)
  {
    if (this == player)
    {
      //getSpeechView to know which expressions to show depending on what version of Brian...
      iView = 17;
      iBlink = 40;
    }
  }
  else if (eExpressionType == eAhhhh)
  {
    iView = 39;
    iBlink = 40;    
  }
  
  this.SpeechView = iView;
  this.BlinkView = iBlink;
  Game.MinimumTextDisplayTimeMs = iLength;
  
  if (bIsGamePaused == true) UnPauseGame(); //if  the game is paused, unpause so the portrait can close itself...
  
  if (sSay == "") Display("Debug, just show the portrait");
  else player.GSay(String.Format("%s", sSay));
  
  if (bIsGamePaused == true) PauseGame();
  
  Game.MinimumTextDisplayTimeMs = iDefaultLength; //(should be 1000)
  this.restoreSpeechView(previousView);
  
  bIsGamePaused = false; //reset
}


At this line:  
Code: ags
if (sSay == "") Display("Debug, just show the portrait");
, Im not sure what to place so  that if the text to display is "nothing", I just want to show the portrait animation with no text...right now if the text is blank (sSay == ""), no portrait is displayed at all.

Im guessing its something to do with AGS's built-in "say" that wont show the portrait animation if there is no text?
--All that is necessary for evil to triumph is for good men to do nothing.

Calin Leafshade

how about a space?

or rather a series of spaces depending on how long you want it to display for.

Knox

Hey Calin!

Well if I put a space, (sSay == " "), for example, we will see the speech text box next to the player's speech portrait, but empty...so  in my case a square border with blue filled background...I was wondering how I could do it so that the text box doesnt appear at all. Can I (or do I need to) hack the "say" command so that if the text is a space or empty it wont display the textbox but still display the speech portrait animation?

--All that is necessary for evil to triumph is for good men to do nothing.

Calin Leafshade

well if the character isnt actually *saying* anything than I would recommend you dont use the say command at all.

Just use a gui or something and draw the portrait that you want.. then get the engine to wait for 2 seconds or until the player presses a button.

Khris

Doesn't saying "..." create a pause while showing only the portrait?
(I've never used anything other than LA style speech though.)

Knox

wow, just tried that (say("...")...it works great :P

Is that in the manual? If so, Im really sorry I missed that...and quite embarassed  :-[
--All that is necessary for evil to triumph is for good men to do nothing.

Khris

Not sure where I read that. Might very well have been some obscure collections of tidbits and snippets :)

SMF spam blocked by CleanTalk