Adventure Game Studio

AGS Support => Beginners' Technical Questions => Topic started by: on Wed 02/07/2003 17:50:33

Title: LucasArts style hotspots interaction
Post by: on Wed 02/07/2003 17:50:33
I can't seem to figure out a way to make the hotspots w/ walk-to point work like they do in LacasArts games.

When a hotspot is clicked on, I want the character to move to the walk-to point and not perform the action until they get to that point. But...I want that action request to be cancellable by clicking somewhere else. For example, when a player interacts with a hotspot, I want them to first start moving the the walk-to point, but I want them to be able to, for example, click to walk somewhere else while they are still en route to the walk-to point and then go to the new point instead, cancelling the old requested action.

I can't seem to figure out how, if its even possible, to get this to work like this. There doesn't seem to be a way to not make walking to a walk-to point blocking. Plus, the "character interacts with hotpoint" action seems to be triggered before the "any click on hotpoint" action. I'm stumped, hopefully someone can help, thanks.
Title: Re:LucasArts style hotspots interaction
Post by: Wolfgang Abenteuer on Wed 02/07/2003 20:18:25
Have you tried MoveCharacter (CHAR,x,y) and manually enter the x,y location of the hotspot?

~Wolfgang
Title: Re:LucasArts style hotspots interaction
Post by: on Wed 02/07/2003 20:47:37
Yes, but the problem is if I have a hotspot interaction event, it will be called before the character reaches the point. The only way I can find to have it wait for the character to reach the point is for the action o be blocking, which I don't want.

On the other hand, If I had some kind of event triggered when the character reached the place where I wanted him, how would I be able to know which interaction request sent the character there or if the character randomly walked over that point? So that wouldn't work either...
Title: Re:LucasArts style hotspots interaction
Post by: Wolfgang Abenteuer on Wed 02/07/2003 21:06:49
Try,
if ((character[EGO].walking == 0) && (GetCharacterAt (x,y)) {
//code for interaction here
}

where x,y is the coordinates for the hotspot's walk-to point (that you specified in MoveCharacter).  That should (theoretically) not cause the interaction to take place until the character has both stopped moving and is standing on the hotspot.

~Wolfgang
Title: Re:LucasArts style hotspots interaction
Post by: Scorpiorus on Wed 02/07/2003 23:29:22
You may wish to check that thread: http://www.agsforums.com/yabb/index.php?board=6;action=display;threadid=6587; (http://www.agsforums.com/yabb/index.php?board=6;action=display;threadid=6587;)

-Cheers
Title: Re:LucasArts style hotspots interaction
Post by: on Thu 03/07/2003 14:09:40
Thanks, exactly what I was looking for  ;D