Pushing an object

Started by Karlos, Sat 14/11/2009 15:53:02

Previous topic - Next topic

Karlos

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.   :)

Scarab

When you call the commant which changes the view, you can use the
Code: ags

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

Khris

Alternatively, you can intercept clicks in the global on_mouse_click.

Karlos

Ok, thank you!  That's the info I needed.

SMF spam blocked by CleanTalk