Adventure Game Studio

AGS Support => Beginners' Technical Questions => Topic started by: DragzGames on Wed 04/03/2009 20:11:38

Title: how do i stop my walk to event looping the text that i have for this event?
Post by: DragzGames on Wed 04/03/2009 20:11:38
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
Title: Re: how do i stop my walk to event looping the text that i have for this event?
Post by: thezombiecow on Wed 04/03/2009 20:40:22
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:


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. :)
Title: Re: how do i stop my walk to event looping the text that i have for this event?
Post by: Trent R on Wed 04/03/2009 21:06:54
You'd only have to declare it in the room script, and not need to bother with the Global Variables pane.

~Trent
Title: Re: how do i stop my walk to event looping the text that i have for this event?
Post by: Khris on Wed 04/03/2009 21:09:32
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).
Title: Re: how do i stop my walk to event looping the text that i have for this event?
Post by: DragzGames on Wed 04/03/2009 23:57:19
thank you that works a treat thanks :):):):)