In my game, the player can set the Textspeed with "+" and "-" keys like in Lucas Arts Games. My Problem is that the player can't set the textspeed while a message is displayed with DisplaySpeech. I tried a solution with IsKeyPressed in repeatedly_execute_always but it didn't work :(
Does anyone know a solution for my problem?
in what way didn't it work? IsKeyPressed in repeatedly_execute_always should work fine.
it just don't work.
Here's my code in repeatedly_execute_always:
function repeatedly_execute_always() {
if (IsKeyPressed(47)==1) set_textspeed(0);
else if (IsKeyPressed(93)==1) set_textspeed(1);
if (IsGUIOn(9)==1) {
if (timer==40) {GUIOff(9); timer=0; SetLabelText(4, 0, "Walk to");}
else timer++;
}
}
Here's my set_textspeed function:
function set_textspeed(int id) {
if (id == 0) {
SetSliderValue(9, 0, GetSliderValue(9, 0)-1);
}
else if (id == 1) {
SetSliderValue(9, 0, GetSliderValue(9, 0)+1);
}
timer = 0;
if (IsGUIOn(9)==0) GUIOn(9);
game.text_speed = GetSliderValue(9,0)*6;
StrFormat(buffer, "Textspeed - %d", GetSliderValue(9, 0));
SetLabelText(4, 0, buffer);
}
Until now i handled the "+" and "-" key in the on_key_press function.
Since I handled it in the repeatedly_execute_always function nothing happens if i press the keys
Seems like the IsKeyPressed function doesn't react on +/- at all.
oh that's the problem. if i use other keys like "q" and "a" it works fine. When will this get fixed?
I'll add it to my list.