Hi dantedevil!
About your repulse projectle ability, I finally able to modify the script for 3D mods
anim freespecial5
@script
void self = getlocalvar("self"); //Caller.
void vEntity; //Target entity placeholder.
int iEntity; //Entity enumeration holder.
int iName; //Entity name.
int iMax = openborvariant("ent_max"); //Entity count.
int x = getentityproperty(self,"x"); //Get character's x coordinate
int z = getentityproperty(self,"z"); //Get character's a coordinate
int Ex;
int Ez;
int EDir;
int EVz;
//Enumerate and loop through entity collection.
for(iEntity=0; iEntity<iMax; iEntity++){
vEntity = getentity(iEntity); //Get target entity from current loop.
iName = getentityproperty(vEntity, "defaultname"); //Get target name
//Projectile
if(iName == "GPiau" || iName == "ShockBall"){
Ex = getentityproperty(vEntity, "x");
Ez = getentityproperty(vEntity, "z");
if(Ex <= x+40 && Ex >= x-40 && Ez <= z+10 && Ez >= z-10){
EDir = getentityproperty(vEntity, "direction");
EVz = getentityproperty(vEntity, "zdir");
changeentityproperty(vEntity, "candamage", "TYPE_ENEMY", "TYPE_OBSTACLE");
if(Ex <= x && EDir == 1){
changeentityproperty(vEntity, "direction", 0);
} else if(Ex > x && EDir == 0){
changeentityproperty(vEntity, "direction", 1);
}
if(Ez <= z+10 && EVz <= 0){
EVz = -EVz;
} else if(Ez > z-10 && EVz > 0){
EVz = -EVz;
} else {
EVz = EVz;
}
changeentityproperty(vEntity, "velocity", NULL(), EVz);
}
}
}
@end_script
...
The script will find knife projectiles whose name is either
GPiau or
ShockBall within
40 pixels left and right and
10 pixels back and front. If it finds any, it will repulse it away then change it to be able to damage enemies and obstacles
I have to mention knife projectiles cause it only works well to that type of projectile
If you want to modify that to your projectiles, just change the names. Extend the list if you want more projectiles to be repulsed
Oh yes, the name must be exactly same e.g ShockBall is repulsed but shockball isn't
And due to default setting in engine, you need to set
hitenemy 1 in projectile's text to allow it to hit the one who throw it
Last but not least, the script is run per frame so if you want high check rate you should set more frames in the animation