Bruce
Active member
Hello everyone,
First of all, I know both methods work, but there got to be some differences in terms of performance / memory issue.
I just wanted to pick out the best method as possible and wanted to understand more about it instead of copy and paste code.
Can someone please take a look at the code below and please advise?
Thank you so much
DidhitScript.c:
VS
Didhitscript2.c:
Main.c:
First of all, I know both methods work, but there got to be some differences in terms of performance / memory issue.
I just wanted to pick out the best method as possible and wanted to understand more about it instead of copy and paste code.
Can someone please take a look at the code below and please advise?
Thank you so much
DidhitScript.c:
Code:
void main()
{
void AttackType = getlocalvar("attacktype"); // Get attack type
int KnockDownPower = getlocalvar("drop");
if(KnockDownPower > 100) {
void Target = getlocalvar("damagetaker"); // Enenemy
void TYPE = getentityproperty(Target,"type");
void HEALTH = getentityproperty(Target, "health");
if((TYPE == openborconstant("TYPE_enemy") && HEALTH < 1){
AFunction();
}
}
}
void AFunction()
{
.....
}
VS
Didhitscript2.c:
Code:
#import "data/scripts/anim/Main.c"
void main()
{
void AttackType = getlocalvar("attacktype"); // Get attack type
int KnockDownPower = getlocalvar("drop");
if(KnockDownPower > 100) {
void Target = getlocalvar("damagetaker"); // Enenemy
void TYPE = getentityproperty(Target,"type");
void HEALTH = getentityproperty(Target, "health");
if((TYPE == openborconstant("TYPE_enemy") && HEALTH < 1){
AFunction();
}
}
}
Main.c:
Code:
void AFunction()
{
.....
}