Adventure Game Studio

AGS Support => Beginners' Technical Questions => Topic started by: on Thu 07/06/2012 20:20:54

Title: code
Post by: on Thu 07/06/2012 20:20:54
hey dose anybody know how to do a code like if you type only a spacific number into a gui something will happen
like if you type nothing or anything else this will hapan but if you type 238 this will happen   
Title: Re: code
Post by: on Thu 07/06/2012 20:36:27
Not too hard. You can set up a textbox GUI and compare an entered string against a specific one.

if (gTextPad.Text == "238")
  Display("Whoo, Jackpot!");
else
  Display("Code Not Accepted!");
Title: Re: code
Post by: Calin Leafshade on Thu 07/06/2012 20:58:50
"pacific number" is a highlight on these forums thus far.
Title: Re: code
Post by: Atelier on Thu 07/06/2012 21:02:52
Heh. (http://www.youtube.com/watch?feature=player_detailpage&v=c3y0CD2CoCs#t=47s)
Title: Re: code
Post by: Khris on Thu 07/06/2012 21:09:30
Why isn't this in Beginner's Technical Questions...? (roll)

There's also InputBox() (http://www.adventuregamestudio.co.uk/manual/Game.InputBox.htm).
Code (ags) Select
  String text = InputBox("What's the password?");
  if (text == "pacific") ...
  else ...
Title: Re: code
Post by: on Thu 07/06/2012 21:14:45
thanks and were is a warm welcome back lol
Title: Re: code
Post by: WHAM on Thu 07/06/2012 21:23:18
lol indeed
Title: Re: code
Post by: DoorKnobHandle on Thu 07/06/2012 21:33:51
We put as much effort into your warm welcome as you put into your posts! :)
Title: Re: code
Post by: Khris on Thu 07/06/2012 21:34:20
ƨ   Æ¨   Æ¨   Æ¨
welcome back