maxman
Well-known member
I have trouble with key delays and one of the buttons is pressed first before pressing the other to perform a special move. It's kinda like anim special which you hold attack first and then press jump to perform that move when you have anim block, but I'm trying not to have press delays. For example, in scripts, you have attack and attack2 keys. You press attack button first and then after that, you press attack2 button to perform a special move. It can be either way. I'm trying not to press one and hold and then press the other to perform a special.
This is my keyscript and I'm having trouble with SimulPress() function. It's based on the charging script like Mega Man charging shot, but I changed it to make my attempted simultaneous press. (How can I press keys at the same time without having key delays?)
This is my keyscript and I'm having trouble with SimulPress() function. It's based on the charging script like Mega Man charging shot, but I changed it to make my attempted simultaneous press. (How can I press keys at the same time without having key delays?)
Code:
#define ov openborvariant
#define time ov("elapsed_time")
void main(){
SimulPress();
}
void SimulPress(){
void self = getlocalvar("self");
void ani = getentityproperty(self, "animationid");
int index = getentityproperty(self, "playerindex");
// Presses
int attack = playerkeys(index, 1, "attack");
int attack2 = playerkeys(index, 1, "attack2");
// Releases
int attackR = playerkeys(index, 2, "attack");
int attack2R = playerkeys(index, 2, "attack2");
float A = getentityvar(self, "A");
float A2 = getentityvar(self, "A2");
float AR = getentityvar(self, "AR");
float A2R = getentityvar(self, "A2R");
if(attack){
if(A == NULL()){
A = time;
setentityvar(self, "A", A);
}
}
if(A <= time - 10){
A == NULL();
setentityvar(self, "A", NULL());
}
if(attack2){
if(A2 == NULL()){
A2 = time;
setentityvar(self, "A2", A2);
}
}
if(A2 <= time - 10){
A2 == NULL();
setentityvar(self, "A2", NULL());
}
if(A != NULL() && A2 != NULL() && ani != openborconstant("ANI_SPAWN")){
performattack(self, openborconstant("ANI_FREESPECIAL4"));
}
}