Could someone make a tutorial how do i make text phraser?
Including GUI,scripts and evereything.
There's one in the manual. Just search for 'Text Parser'.
To get you started, here's the on_key_press-code I wrote once.
Add a GUI, name it "PARSER".
Put a textbox on it, name it "command".
String oldline;
String newline;
#sectionstart on_key_press // DO NOT EDIT OR REMOVE THIS LINE
function on_key_press(int keycode) {
// called when a key is pressed. keycode holds the key's ASCII code
// standard AGS keypress stuff here
// parser
if (keycode==361 && oldline!=null) { // F3
command.Text=oldline;
gParser.Visible=true;
}
if (keycode==8 && command.Text=="") { // Delete (when empty)
gParser.Visible=false;
}
if (keycode>=65 && keycode<=122 && gParser.Visible==false) { // show box after keypress
if (keycode<=90 && IsKeyPressed(403)==0 && IsKeyPressed(404)==0) keycode=keycode+32; // shift?
gParser.Visible=true;
newline="";
command.Text=newline.AppendChar(keycode);
}
}
#sectionend on_key_press // DO NOT EDIT OR REMOVE THIS LINE
Thanks.
I really need the text parser because a GUI would be too small for all the options
(STARWARS sim game)
EDIT:
umm.....where EXACTLY do i have to write that? ???
Edit by Ashen: Don't double post.
Menu: Script -> on_key_press
Now extend the existing function until it looks like the code above.
(Don't delete the contents inside, leave it where I wrote "// standard AGS keypress stuff here").