|
Post by JLaCroix on Apr 12, 2004 16:19:52 GMT -5
Can someone please help with this script? This script does dialogue. I need it so that you can use the joystick to go through text, not just anykey on the keyboard. ----------------------------------------------------------------------- // Below deletes the collision object to avoid duplication with(objDistanceCheck) instance_destroy();
// Below draws the textbox on screen var _brush_color,_pen_color,_font_size,_font_color,_font_align; _brush_color=brush_color; _pen_color=pen_color; _font_size=font_size; _font_color=font_color; _font_align=font_align;
// Sets the size and colors of the text window brush_color=0; pen_color=c_white; pen_size=2; font_size=12; font_color=c_white; font_align=fa_left;
// Draws the text box draw_roundrect(view_current+50,view_current+475,view_current+(screen_width-50),view_current+350);
// Draws the character icon in the text box draw_sprite(argument0,-1,view_left[1]+60,view_top[1]+360);
// Draws the dialogue draw_text(view_left[1]+140,view_top[1]+360,argument1); // Perfect
// Clears text after it has been written screen_refresh();
// Readies the keyboard for next input io_clear();
// Waits until any button has been pressed to continue keyboard_wait();
// Resets the variables brush_color=_brush_color; pen_color=_pen_color; font_size=_font_size; font_color=_font_color; font_align=_font_align; // End of dialogue script
|
|
|
Post by bpdenny on Apr 12, 2004 17:26:25 GMT -5
One thing instead of keyboard_wait() that would either work perfectly or freeze your computer is to put a while loop, probably like this: while ((keyboard_check(vk_anykey) = false) and (joystick_check_button(1,1) = false)) {io_clear()}; I'm not sure if it'll work, off the top of my head: I'm gettin a gut feeling that if joystick 1 doesn't exist then the game will crash instead of just put false... Anyways, to check if the player presses more buttons just copy the whole 'and (joystick...)' part including the and and the parentheses and change 1,1 to 1,2 or anything else 1,x. If you want to check 2,x you'll have to duplicate it. Hopefully that'll help without freezing your computer hehe EDIT: Yay! I'm a user now! 11 posts! Yay for me! ...Oh, and while I've heard the official rules may differ, I believe that 'a user' is correct, not 'an user,' because the noise made by the U is of the Y's yuh noise, which isn't a vowel, making 'a user' correct. But I heard from my dad that he heard from somewhere that it is the spelling that counts not the pronunciation...? Doubt it, I'll say a user. User abuser. Wow, is this offtopic or what
|
|
|
Post by JLaCroix on Apr 12, 2004 18:01:05 GMT -5
I'll try that when I get home tonight, I hope it doesn't crash the game!
Do I put the while in the same place where I had the keyboard_wait?
Should I check to see if the joystick exists first before I do this, if so where do I put it?
Finally, how can I make it check any of the joystick buttons? Can I do (1,1-8) or so?
Thanks again please let me know! If any others have ideas please share!
|
|
|
Post by JeremyLaCroix on Apr 13, 2004 11:12:27 GMT -5
Problems.
First it works but:
1. It makes the script SLOOOOWWW. (For the keyboard) I have to press the keyboard button several times to scroll the text once.
2. With the joystick, it happens FAST. Depending on how quick you tap the button, it'll scroll two or three text boxes at a time.
Any ideas on how to make it more efficient? Thanks!
|
|