Adventure Game Studio

AGS Support => Beginners' Technical Questions => Topic started by: Ize on Wed 07/06/2006 00:29:04

Title: Walking to interact
Post by: Ize on Wed 07/06/2006 00:29:04
Hello everyone, I'm making a game, and I've got the noobiest question ever, I want to make my character move to the object I want him to pick him up before he actually picks it up, but I don't want that to happen when he looks at it.
For example, my character sees a bone, but he can tell you "It's a bone" without having to walk towards it, but I want him to do so when I make him pick it up. Can't ind it in the manual, if it's there maybe someone can tell me where.
Thanks a lot in advance.(man I just feel like such a rookie :P)
Title: Re: Walking to interact
Post by: Nathan23 on Wed 07/06/2006 00:59:57
In the interaction editor, select the option "interact with object", there you can do two things:

1.Choose the option run script
2. Choose a series of option:
Ã,  Walk to the x,y coordinates of the object,.... Ã,  etc

i prefer the first one, then double click over this option and choose "edit" then:

code:


cego.Walk(100, 20); //coordinates where theÃ,  object is placed
obone.Visible = false; //obone is the name of the object
cego.Addinventory(ibone); //have to put the name of the inventory item


Title: Re: Walking to interact
Post by: Ize on Wed 07/06/2006 04:06:32
I did that, but the object dissapears before the guy walks to it.
Title: Re: Walking to interact
Post by: Kweepa on Wed 07/06/2006 05:20:12
Here's a couple of possibilities:
* the walkable area doesn't extend to 100, 20 (or whatever coordinates you typed)
* you're using a "non-blocking" walk command, which means that the script continues immediately after the walk command is issued

It would help if you posted the script here.
Title: Re: Walking to interact
Post by: SSH on Wed 07/06/2006 11:58:44
It's the old "scripts run after ALL interaction editor commands" trick, so:

* delete the interaction editor thing that removes the object