oldyz
Well-known member
i have this code that changes a character to a "shuffler" model, & i wanted to make 2 variants -
one version that forces the 3rd model change to start the spawn animation at frame 0 - using this code everything seems fine:
but the problem is with this other variant that is supposed to make the spawn animation begin at frame 6
@script
void self = getlocalvar("self");
if(frame == 1){
changeentityproperty(self, "model", "pharaon2X", 6);
} else if(frame == 3){
changeentityproperty(self, "model", "pharaon2X-8", 6);
} else if(frame == 5){
changeentityproperty(self, "model", "pharaon2X-9", 6);
} else if(frame == 7){
changeentityproperty(self, "model", "pharaon2X-10", 6);
} else if(frame == 9){
changeentityproperty(self, "model", "pharaon2X-12", 6);
}
@end_script
@script
void self = getlocalvar("self");
if( frame == 0){
int Sr = (rand() & 0x7fffffff) % 92 ;
if (Sr >= 0 && Sr <= 17){
changeentityproperty(self, "animpos", 8);
}else if (Sr >= 18 && Sr <= 35){
changeentityproperty(self, "animpos", 2);
}else if (Sr >= 36 && Sr <= 53){
changeentityproperty(self, "animpos", 0);
}else if (Sr >= 54 && Sr <= 71){
changeentityproperty(self, "animpos", 6);
}else if (Sr >= 72 && Sr <= 89){
changeentityproperty(self, "animpos", 4);
}
}
@end_script
frame data/chars/pharaon/51 #0
frame data/chars/pharaon/51 #1
frame data/chars/pharaon/51 #2
frame data/chars/pharaon/51
frame data/chars/pharaon/51 #4
frame data/chars/pharaon/51
frame data/chars/pharaon/51 #6
frame data/chars/pharaon/51
frame data/chars/pharaon/51 #8
frame data/chars/pharaon/51
OpenBor is ignoring the number 6 & starts the spawn animations of these 2 variants
if(frame == 1){
changeentityproperty(self, "model", "pharaon2X", 6);
} else if(frame == 3){
changeentityproperty(self, "model", "pharaon2X-8", 6);
at frames 1 & 3
to fix it i tried this other method:
but now the conflict is at anim follow1 - the engine makes uses of model2x's anim follow1's frames & if i change it to anim follow6 it ignores the 6 & does the spawn animation from the start
one version that forces the 3rd model change to start the spawn animation at frame 0 - using this code everything seems fine:
Code:
@script
void self = getlocalvar("self");
if(frame == 1){
changeentityproperty(self, "model", "pharaon2X", 0);
} else if(frame == 3){
changeentityproperty(self, "model", "pharaon2X-8", 0);
} else if(frame == 5){
changeentityproperty(self, "model", "pharaon2X-9", 0);
} else if(frame == 7){
changeentityproperty(self, "model", "pharaon2X-10", 0);
} else if(frame == 9){
changeentityproperty(self, "model", "pharaon2X-12", 0);
}
@end_script
@script
void self = getlocalvar("self");
if( frame == 0){
int Sr = (rand() & 0x7fffffff) % 92 ;
if (Sr >= 0 && Sr <= 17){
changeentityproperty(self, "animpos", 8);
}else if (Sr >= 18 && Sr <= 35){
changeentityproperty(self, "animpos", 2);
}else if (Sr >= 36 && Sr <= 53){
changeentityproperty(self, "animpos", 0);
}else if (Sr >= 54 && Sr <= 71){
changeentityproperty(self, "animpos", 6);
}else if (Sr >= 72 && Sr <= 89){
changeentityproperty(self, "animpos", 4);
}
}
@end_script
frame data/chars/pharaon/51 #0
frame data/chars/pharaon/51 #1
frame data/chars/pharaon/51 #2
frame data/chars/pharaon/51
frame data/chars/pharaon/51 #4
frame data/chars/pharaon/51
frame data/chars/pharaon/51 #6
frame data/chars/pharaon/51
frame data/chars/pharaon/51 #8
frame data/chars/pharaon/51
but the problem is with this other variant that is supposed to make the spawn animation begin at frame 6
@script
void self = getlocalvar("self");
if(frame == 1){
changeentityproperty(self, "model", "pharaon2X", 6);
} else if(frame == 3){
changeentityproperty(self, "model", "pharaon2X-8", 6);
} else if(frame == 5){
changeentityproperty(self, "model", "pharaon2X-9", 6);
} else if(frame == 7){
changeentityproperty(self, "model", "pharaon2X-10", 6);
} else if(frame == 9){
changeentityproperty(self, "model", "pharaon2X-12", 6);
}
@end_script
@script
void self = getlocalvar("self");
if( frame == 0){
int Sr = (rand() & 0x7fffffff) % 92 ;
if (Sr >= 0 && Sr <= 17){
changeentityproperty(self, "animpos", 8);
}else if (Sr >= 18 && Sr <= 35){
changeentityproperty(self, "animpos", 2);
}else if (Sr >= 36 && Sr <= 53){
changeentityproperty(self, "animpos", 0);
}else if (Sr >= 54 && Sr <= 71){
changeentityproperty(self, "animpos", 6);
}else if (Sr >= 72 && Sr <= 89){
changeentityproperty(self, "animpos", 4);
}
}
@end_script
frame data/chars/pharaon/51 #0
frame data/chars/pharaon/51 #1
frame data/chars/pharaon/51 #2
frame data/chars/pharaon/51
frame data/chars/pharaon/51 #4
frame data/chars/pharaon/51
frame data/chars/pharaon/51 #6
frame data/chars/pharaon/51
frame data/chars/pharaon/51 #8
frame data/chars/pharaon/51
OpenBor is ignoring the number 6 & starts the spawn animations of these 2 variants
if(frame == 1){
changeentityproperty(self, "model", "pharaon2X", 6);
} else if(frame == 3){
changeentityproperty(self, "model", "pharaon2X-8", 6);
at frames 1 & 3
to fix it i tried this other method:
Code:
@script
void self = getlocalvar("self");
if(frame == 1){
changeentityproperty(self, "animation", openborconstant("ANI_follow1"));
} else if(frame == 3){
changeentityproperty(self, "animation", openborconstant("ANI_follow2"));
} else if(frame == 5){
changeentityproperty(self, "animation", openborconstant("ANI_follow3"));
} else if(frame == 7){
changeentityproperty(self, "animation", openborconstant("ANI_follow4"));
} else if(frame == 9){
changeentityproperty(self, "animation", openborconstant("ANI_follow5"));
}
@end_script
@script
void self = getlocalvar("self");
if( frame == 0){
int Sr = (rand() & 0x7fffffff) % 92 ;
if (Sr >= 0 && Sr <= 17){
changeentityproperty(self, "animpos", 8);
}else if (Sr >= 18 && Sr <= 35){
changeentityproperty(self, "animpos", 2);
}else if (Sr >= 36 && Sr <= 53){
changeentityproperty(self, "animpos", 0);
}else if (Sr >= 54 && Sr <= 71){
changeentityproperty(self, "animpos", 6);
}else if (Sr >= 72 && Sr <= 89){
changeentityproperty(self, "animpos", 4);
}
}
@end_script
frame data/chars/pharaon/02 #0
frame data/chars/pharaon/02 #1
frame data/chars/pharaon/02 #2
frame data/chars/pharaon/02
frame data/chars/pharaon/02 #4
frame data/chars/pharaon/02
frame data/chars/pharaon/02 #6
frame data/chars/pharaon/02
frame data/chars/pharaon/02 #8
frame data/chars/pharaon/02
frame data/chars/pharaon/02
anim follow1
delay 1
offset 93 175
bbox 0 0 0 0
@script
void self = getlocalvar("self");
if(frame == 1){
changeentityproperty(self, "model", "pharaon2X", 6);
}
@end_script
frame data/chars/pharaon/02
frame data/chars/pharaon/02
anim follow2
delay 1
offset 93 175
bbox 0 0 0 0
@script
void self = getlocalvar("self");
if(frame == 1){
changeentityproperty(self, "model", "pharaon2X-8", 6);
}
@end_script
frame data/chars/pharaon/02
frame data/chars/pharaon/02
anim follow3
delay 1
offset 93 175
bbox 0 0 0 0
@script
void self = getlocalvar("self");
if(frame == 1){
changeentityproperty(self, "model", "pharaon2X-9", 6);
}
@end_script
frame data/chars/pharaon/02
frame data/chars/pharaon/02
anim follow4
delay 1
offset 93 175
bbox 0 0 0 0
@script
void self = getlocalvar("self");
if(frame == 1){
changeentityproperty(self, "model", "pharaon2X-10", 6);
}
@end_script
frame data/chars/pharaon/02
frame data/chars/pharaon/02
anim follow5
delay 1
offset 93 175
bbox 0 0 0 0
@script
void self = getlocalvar("self");
if(frame == 1){
changeentityproperty(self, "model", "pharaon2X-12", 6);
}
@end_script
frame data/chars/pharaon/02
frame data/chars/pharaon/02
but now the conflict is at anim follow1 - the engine makes uses of model2x's anim follow1's frames & if i change it to anim follow6 it ignores the 6 & does the spawn animation from the start