Adventure Game Studio

AGS Support => Beginners' Technical Questions => Topic started by: Global Lint on Thu 31/07/2008 21:14:24

Title: Stopping a character altogether
Post by: Global Lint on Thu 31/07/2008 21:14:24
I'm working on a game very similar to an old DOS game called Hugo.

When the character dies, he falls over (change in view number) and stops moving.

Only problem is, even though he's fallen over, the player can still control him, which makes him slide around the room.  Hilarious, but not what I'm looking for.  Please tell me how to disable character movement for only one character. 
Title: Re: Stopping a character altogether
Post by: RetroJay on Thu 31/07/2008 22:09:46
Hi Faith.

I'm not totaly sure about this. Have you tried unchecking the "this is the player character" box on your death view?

Either that or dissable the "Walkto" icon. You won't be able to walk anywhere then. I think the script for this is
mouse.DisableMode(eModeWalkto);

To enable the icon again type- mouse.EnableMode(eModeWalkto);

However you will still be able to look, talk and interact unless you also dissable them in the same way.

I hope I have been of some help to you.

Jay.

Oh. I forgot to ask what version of AGS you are using. I use 2.72. If you are using 3.0 then the scripting may be different. I don't know.
Title: Re: Stopping a character altogether
Post by: Makeout Patrol on Thu 31/07/2008 22:14:19
I'm not familiar with "Hugo," but I assume that it revolves around the player controlling more than one character at once? What I would do is set a global variable to indicate whether or not that character is dead, and set the character's movement controls only to respond if the variable indicates that they are alive.
Title: Re: Stopping a character altogether
Post by: Global Lint on Thu 31/07/2008 22:47:01
Hugo is just a regular adventure game, with only one character.  It's pretty basic: long mazes, the old newspaper-and-pencil trick, scaring gardeners away with your garlic breath, the works.  Hugo's text parser is sublime.  Also, the game isn't point-and-click; you move with the arrow keys.

You can't disable the 'this is the main character' button in the Views window.  That's in the character options, isn't it?

I'll try disabling the arrow keys with the variable idea.  My only worry about that is that once the player loads a game or quits, the keys will still be disabled.  I'm terrible with global things.  I'd better get on it.

It's just that I was almost certain there was a script function that disabled walking altogether.
Title: Re: Stopping a character altogether
Post by: RetroJay on Thu 31/07/2008 23:13:00
Hi Faith.

Yeah. Sorry about that. You're absolutely right. You can't disable the "This is the main character" in views. :-[

I never played Hugo and didn't know it was keys only. ::)

In that case go with Makeout Patrols Variable thing. :)

Sorry I couldn't help.
Jay.

Hey. Just had another thought. You could remove the walkable area using-  RemoveWalkableArea( -whatever number the area is- );
after your change view script.
Title: Re: Stopping a character altogether
Post by: Akatosh on Fri 01/08/2008 13:31:47
Quote from: Faith on Thu 31/07/2008 22:47:01
My only worry about that is that once the player loads a game or quits, the keys will still be disabled. 

Don't worry. When a game is loaded, everything is reset to exactly the state it was in when the game was saved, including global variables and such. So unless you allow the player to save the game when he's dead (and trust me, somebody WILL try that), you'll be safe.  :)
Title: Re: Stopping a character altogether
Post by: Global Lint on Fri 01/08/2008 16:00:50
Thank you, I'll remember to disable the save option when the character dies. 

Thank you guys for spending some time on this!  I really appreciate it.