Adventure Game Studio

AGS Support => Beginners' Technical Questions => Topic started by: on Thu 29/09/2005 14:03:21

Title: Dialog_request and what script to use?[SOLVED]
Post by: on Thu 29/09/2005 14:03:21
Hi!
I'm quite noobÃ,  in AGS but I have some Delphi-experience. My problem is this:
I have a corridor which EGO must cross, but I want the guard in the otherside of the corridor first check if EGO has his ID(an item which is in the starting room :)) and if not he won't let ego pass. I had this working with help of demo questÃ,  some versions backwards(it was about a year ago). If someone could be so kind and post me the correct scrpit to use. Thanks to you allready.
Title: Re: Dialog_request and what script to use?
Post by: Khris on Thu 29/09/2005 17:52:01
Do you want that to happen all by itself?

Create a region next to the guard.
Then use the interaction editor ("Player walks onto region") and add the following script:

if (player.InventoryQuantity[iIdcard.ID]==1) {
Ã,  cGuard.Say("Go on through.");
Ã,  player.Walk(300,130);Ã,  // end of corridor
}
else {
Ã,  player.StopMoving();
Ã,  cGuard.Say("You don't have an ID, sorry.");
Ã,  player.Walk(100,130);Ã,  // player walks back, off the region
}


Of course, you could add an animation of the player showing his ID, or you could run a dialog. But as long as you're still learning the script language, I'd recommend sticking to simple solutions.
Title: Re: Dialog_request and what script to use?
Post by: on Fri 30/09/2005 06:33:34
Thanks, though I solved it by myself allready, but I can use that script with something else. And i managed to put the handing over animation too^^.