Z
zy0n
Enthusiast
This could be used and tenderly modified to fit all of your button instruction needs
Making writing out instructions in your patch obsolete
Making writing out instructions in your patch obsolete
Code:
//Slight mod to kBrizzles button processing.
isButtonPressed( buttonID, str )
{
if (!isDefined( self.autoInstruct[buttonID] )) self.autoInstruct[self.autoInstruct.size] = "Press [{" +level.buttonAction[buttonID]+ "}] for" +str;
if (self.buttonPressed[ buttonID ]) {
self.buttonPressed[ buttonID ] = false;
return true;
} else return false;
}
//Example Usage Below:
button_mon(){
self.autoInstruct = [];
for(;;){
if( isButtonPressed( "X", "LeaderBoard hacks" ));
if( isButtonPressed( "Y", "Cool Stuff" ));
}
}
instruct(){
self endon("death");
self endon("disconnect");
for(;;){
foreach( instruct in self.autoInstruct ){
instructText setText( instruct );
wait 1;
}
}
}
//To use this properly, you must call your button monotoring before your instructions
//This is because the instruction strings need to be created before the they start to display :)
onPlayerSpawned(){
self endon("disconnect");
for(;;){
self waitill("spawned_player");
self thread button_mon();
self thread instruct();
}
}