SayAtBackground?

Started by Paul Franzen, Sun 07/10/2012 19:52:59

Previous topic - Next topic

Paul Franzen

Does anyone know how to code a character.SayAtBackground function? I have a creature who's being carried around by the player character in his inventory. There's one screen in particular where, if the player is carrying the creature, the creature starts making little noises (to signify that there's something on this screen he's interested in) from the player's inventory.

Here's what the code looks like:

function room_RepExec()
{
if(cPaul.HasInventory(iInventory46)){ // Paul has Merlin
   int haphap=Random(250);
   if (haphap==3){
    DisplaySpeechAt((character[PAUL].x)-75, (character[PAUL].y)-50, 125, MERLIN, "hap hap!");
   
   }
}
}

(Please excuse the combination of old- and new-style code; this game has a few different people working on it, and it's gone through a few different AGS versions.)

This means that the character "randomly" (i.e., every time the counter hits 3) says "hap hap!" from Paul's torso when he's on this screen. The problem is that, since it's not a SayBackground command, Blocking is turned on, so the game has to stop each time he says "hap hap." Is there a way to turn off Blocking for a SayAt command? (It's not the end of the world if there's no simple way to do it, but I figured I'd ask, since people here Know Things, and I don't always Know Things.)

Thanks in advance!
The Beard in the Mirror (formerly testgame) - Out now on Steam! http://store.steampowered.com/app/385840
Other games I've worked on: http://paulmfranzen.com/games/

arj0n

Why not use SayBackground?

Paul Franzen

I need the creature to be saying it at a specific location relative to the main character's positioning. (It's not an on-screen character itself; it's in Room -1, technically, displaying its speech wherever the player happens to be.)
The Beard in the Mirror (formerly testgame) - Out now on Steam! http://store.steampowered.com/app/385840
Other games I've worked on: http://paulmfranzen.com/games/

Andail

Have a dummy character say it, using SayBackground. This character is invisible (use a blank sprite) and follows the main character around the screen.

Crimson Wizard

Quote from: Andail on Sun 07/10/2012 20:51:09
Have a dummy character say it, using SayBackground. This character is invisible (use a blank sprite) and follows the main character around the screen.
Yeah, this is probably the best way to do this IMO.
Also this way you may make speech have different text color to allow player distinguish creature speech from PC's speech.

Paul Franzen

All right, I can do that! Thanks!
The Beard in the Mirror (formerly testgame) - Out now on Steam! http://store.steampowered.com/app/385840
Other games I've worked on: http://paulmfranzen.com/games/

SMF spam blocked by CleanTalk