how do i stop my walk to event looping the text that i have for this event?

Started by DragzGames, Wed 04/03/2009 20:11:38

Previous topic - Next topic

DragzGames

right heres my prob, i have an event that when my character walks onto the hotspot i have 2 piece of overlay text appearing after eachother to say thats how u move then another saying look at the window but the 2 overlay texts keep looping.

how do i stop this from happening??

despretaly need this as its the only way i can progress making my game :)

thanks evry1,
DragzGames

thezombiecow

Presumably it's looping because your character is still standing on the hotspot.

Either move him off the hotspot automatically (with cYourCharacter.Walk(), using eBlock) on the very next line after your text, or set up some sort of boolean variable in Global Variables to test whether or not you've seen that text (bSeenWindowText = false, for example)

If you only want this text to be displayed once in the entire game, set your boolean to true. Before you display your text, check to see if it's already been seen with:

Code: ags

if (!bSeenWindowText)        // (or bSeenWindowText == false
{
  // your text goes here
  bSeenWindowText = true;
}


If you want the text to be displayed each time to walk onto that hotspot - that's more tricky. You'll need to reset bSeenWindowText to false every time the guy isn't stepping on the hotspot.

Hope that's of some help. :)

Trent R

You'd only have to declare it in the room script, and not need to bother with the Global Variables pane.

~Trent
To give back to the AGS community, I can get you free, full versions of commercial software. Recently, Paint Shop Pro X, and eXPert PDF Pro 6. Please PM me for details.


Current Project: The Wanderer
On Hold: Hero of the Rune

Khris

Or use a region instead, what you're supposed to be doing anyway. Then you can use the "Walk onto region" event which will get triggered only once (unless you walk off the region and back onto it).


SMF spam blocked by CleanTalk