Adventure Game Studio

AGS Support => Beginners' Technical Questions => Topic started by: Karlos on Sat 14/11/2009 15:53:02

Title: Pushing an object
Post by: Karlos on Sat 14/11/2009 15:53:02
I am new to AGS, and am making a small game that includes a part where the character pushes an object to another part of the room, wherever the user specifies.  I think I know how I want to do this: have the character walk to the object, turn off the object's visibility, switch to a custom view for the main character that shows the character bent over pushing the object and let him move where he wants, then when he uses the interact cursor on himself, switch to the normal view, move the object next to him, and then make it visible again.

The part that I'm wondering about is how to limit the character's ability to interact while she is in "pushing mode".  I understand that I can check the character's current view in my scripts, but it seems tedious to have to check for it in dozens of different places like that.

Anyway, my question is: is there an easier way to limit the character's actions while she is pushing the object?  I just want her to be able to move, and use the interact cursor on herself to stop moving.

Also, if there's an easier way to accomplish the object pushing than what I described above, please let me know.   :)
Title: Re: Pushing an object
Post by: Scarab on Sat 14/11/2009 17:43:23
When you call the commant which changes the view, you can use the
Mouse.Disablemode(eModeInteract);
Mouse.Disablemode(eModeLook);
//... etc.

commands to disable your cursors and just use Mouse.EnableMode() to turn them on after you've finished pushing the object.

Peace
Scarab
Title: Re: Pushing an object
Post by: Khris on Sat 14/11/2009 19:27:24
Alternatively, you can intercept clicks in the global on_mouse_click.
Title: Re: Pushing an object
Post by: Karlos on Sun 15/11/2009 13:52:24
Ok, thank you!  That's the info I needed.