pkmnfrk
08-01-2007, 06:55 PM
According to the documentation,
bool InputA
* True iff (sic) the player is pressing the A key. Writing to this variable
* simulates the press or release of the A key.
I have been working under the assumption that setting it to true is "key press", and false is "key release".
However, so far, I cannot set the button to released. Consider this series of events:
item script coolitem {
void run() {
//if some condition is met
Link->Warp(1,2);
}
}
ffc script coolminigame {
void run() {
Link->InputB = false;
while(true) {
//do mini game
if(Link->InputB) break;
Waitframe();
}
//Warp back
}
}
Say you have an item with the item script attached. When you use it, then you warp to a mini game screen. On the mini game screen, an FFC script takes over, and does the mini game. You then quit the mini game by hitting B, and then you're warped back to where you came from.
The problem is, the mini game will quit immediately, since even though I'm explicitly clearing the B button with "Link->InputB = false;", it's still being read as true.
Am I doing something wrong, or is this expected behaviour, or... what?
bool InputA
* True iff (sic) the player is pressing the A key. Writing to this variable
* simulates the press or release of the A key.
I have been working under the assumption that setting it to true is "key press", and false is "key release".
However, so far, I cannot set the button to released. Consider this series of events:
item script coolitem {
void run() {
//if some condition is met
Link->Warp(1,2);
}
}
ffc script coolminigame {
void run() {
Link->InputB = false;
while(true) {
//do mini game
if(Link->InputB) break;
Waitframe();
}
//Warp back
}
}
Say you have an item with the item script attached. When you use it, then you warp to a mini game screen. On the mini game screen, an FFC script takes over, and does the mini game. You then quit the mini game by hitting B, and then you're warped back to where you came from.
The problem is, the mini game will quit immediately, since even though I'm explicitly clearing the B button with "Link->InputB = false;", it's still being read as true.
Am I doing something wrong, or is this expected behaviour, or... what?