Adventure Game Studio

AGS Support => Advanced Technical Forum => Topic started by: unkelben on Fri 09/10/2009 18:20:36

Title: How to know if text has been skipped?
Post by: unkelben on Fri 09/10/2009 18:20:36
Hi,

I'm trying to produce a detailed log of player behavior and the only thing I can't track is when player skips text. The rest of the actions I can log from the global "on_mouse_click" function, but this function doesn't seem to be fired when the player clicks to interrupt text.

I suppose I could turn off skipping text automatically and manage it myself but then I don't know how to check if a character is saying something nor how to force skip.

Any suggestions?

Thanks.

Jonathan
Title: Re: How to know if text has been skipped?
Post by: Khris on Sun 11/10/2009 14:32:38
This might work:

In repeatedly_execute_always, loop through all characters, check if they are in player.Room, then check if they're .Speaking.
If they are and weren't the last loop, store them in a variable.
Set the variable to -1 if no char is currently speaking.
Then, detect keypresses/mouse clicks according to whatever you allowed the player to skip speech.
You should then be able to add "player skipped Character X's speech" to the log.
Title: Re: How to know if text has been skipped?
Post by: unkelben on Sun 11/10/2009 19:01:57
Great suggestion, thanks.

Strangely, though, "character.Speaking" never seems to become true even when the character is "saying" something.

function repeatedly_execute() {
 
    if(cEgo.Speaking==true){
      logFile.WriteString("SPEAKING");
    }
}

This works if I change Speaking to Moving...

Title: Re: How to know if text has been skipped?
Post by: monkey0506 on Mon 12/10/2009 01:29:38
Note that Khris said "repeatedly_execute_always". This function is run even during blocking events like character speech. "repeatedly_execute" is not.

Further, you must also ensure the character has a speech view set (http://www.adventuregamestudio.co.uk/yabb/index.php?topic=38568.msg507739#msg507739) or it won't work either. ;)
Title: Re: How to know if text has been skipped?
Post by: unkelben on Mon 12/10/2009 01:40:07
Everything works.

You guys are the best.

Thanks a lot.

Jonathan