Mixing speech styles (using repeatedly_execute_always)

Started by Andail, Sun 03/06/2012 18:07:06

Previous topic - Next topic

Andail

(search function down, I think)
Ok, either me or this editor is slightly retarded.

I'm using Sierra's portrait style dialog system. However, I want less significant characters to speak with only a speech animation (i.e. no close up portrait).

According to the manual, I should be able to use something like this:
Code: ags

function repeatedly_execute_always()
{
  if ((cVisitor.Speaking==true)&&!cVisitor.Animating)
  {
    cVisitor.Animate (1, 4, eRepeat, eNoBlock);
  }
}

Never mind all the options with lockview or checking the loops or whatnot; I've tried it all - nothing happens.
I've controlled the function with other commands, and it's working pretty sporadically, I must say. If set the cEgo to move while he's talking (just to check if the code works), he waits until the line is said, even though I'm using noBlock and the repeatedly_execute_always() should work during blocking stuff.

So, is this function repeatedly_execute_always() working properly or am I stupid?

Obviously I can't use the built-in speech view since that would place the animation in the top corner, where the portrait should have been.

How can you create custom talking animations if not like this? Or more precisely, how do games solve the problem of giving some characters portraits and other speech animations?

I'm going slightly mad.

Khris

Depending on which style is used more often, I'd put a switch to the other one in a custom say function:

Code: ags
void Say2(this Character*, String message) {
  SetSpeechStyle(eSpeechLucasarts);
  this.Say(message);
  SetSpeechStyle(eSpeechSierra);
}

Andail

Yeah ok, that's an option.

I'm still a bit annoyed that the repeatedly_execute_always doesn't work at all the way it's supposed to; even copying the manual verbatim doesn't produce what it says it does...

Well, thanks Khris :)

PS:
Works splendidly btw, cheers!

Khris

I tested this myself and the reason why it doesn't work like it says in the manual is that a talking character's .Animating property is set to true.

repeatedly_execute_always does work like it's supposed to, but the if condition is flawed.

This works for the player:
Code: ags
bool was_speaking;

void repeatedly_execute_always() {
  bool s = player.Speaking;
  if (s && !was_speaking) {
    player.LockView(player.SpeechView);
    player.Animate(player.Loop, 5, eRepeat, eNoBlock);
  }
  if (!s && was_speaking) player.UnlockView();
  was_speaking = s;
}


Shouldn't be too hard to expand this to work for all characters.

SMF spam blocked by CleanTalk