I want to have one entityt that can be deflected when you hit it so it travels opposite way and hits enemy back, its a projectile ,so i set it as npc, and when you hit it it should be able to hit enemy, so all works fine but it wont hit enemy back even if i set candamage by script or even when candamage enemy player is in header at all times.
Why projectile refuses to hit the owner n matter what i do? I dont want extra txt file just to spawn clone of the projectile.
So what is the secret to make it work ? Should be easy but its not cause of some internal flags or parenting , i cant be bothered to figure this out and spent houtrs changing aiflags and all, so i figured ill just ask if its even possible ? I want it all done within one entity.
It hits other enemies but not the owner .
I spawn projectile with projectile command in enemy attack.
@cmd projectile 1 "alfir" 30 3 180 1 0 0 3
Heres the fireball text
Why projectile refuses to hit the owner n matter what i do? I dont want extra txt file just to spawn clone of the projectile.
So what is the secret to make it work ? Should be easy but its not cause of some internal flags or parenting , i cant be bothered to figure this out and spent houtrs changing aiflags and all, so i figured ill just ask if its even possible ? I want it all done within one entity.
It hits other enemies but not the owner .
I spawn projectile with projectile command in enemy attack.
@cmd projectile 1 "alfir" 30 3 180 1 0 0 3
Heres the fireball text
Code:
name alfir
speed 5
jumpheight 0
type npc
shadow 1
remove 0
nolife 1
health 1
palette data/chars/almost/fih1.png
nomove 1
candamage obstacle player enemy
hostile obstacle player enemy
offscreenkill 300
nodrop 2
nodieblink 2
score 1 -1
falldie 1
alpha 1
flip 1
anim death
loop 0
delay 3
offset 128 44
bbox 44 4 180 86
hitfx data/sounds/beat2.wav
followanim 1
followcond 1
jugglecost 100
flipframe 0
dropv -1.0 -1.0 -1.0
hitflash flash2
attack 33 65 104 57 0 0 1 0 0 75
seta 1
@script
void self = getlocalvar("self");
if (getentityproperty(self, "direction")==1){
changeentityproperty(self, "velocity", 4, 0, 0);
}
if (getentityproperty(self, "direction")==0){
changeentityproperty(self, "velocity", -4, 0, 0);
}
@end_script
frame data/chars/almost/fih1.png
frame data/chars/almost/fih2.png
frame data/chars/almost/fih3.png
frame data/chars/almost/fih4.png
frame data/chars/almost/fih5.png
frame data/chars/almost/fih6.png
frame data/chars/almost/fih1.png
frame data/chars/almost/fih2.png
frame data/chars/almost/fih3.png
frame data/chars/almost/fih4.png
frame data/chars/almost/fih5.png
frame data/chars/almost/fih6.png
frame data/chars/almost/fih1.png
frame data/chars/almost/fih2.png
frame data/chars/almost/fih3.png
frame data/chars/almost/fih4.png
frame data/chars/almost/fih5.png
frame data/chars/almost/fih6.png
frame data/chars/almost/fih1.png
frame data/chars/almost/fih2.png
frame data/chars/almost/fih3.png
frame data/chars/almost/fih4.png
frame data/chars/almost/fih5.png
frame data/chars/almost/fih6.png
frame data/chars/almost/fih1.png
frame data/chars/almost/fih2.png
frame data/chars/almost/fih3.png
frame data/chars/almost/fih4.png
frame data/chars/almost/fih5.png
frame data/chars/almost/fih6.png
frame data/chars/almost/fih1.png
frame data/chars/almost/fih2.png
frame data/chars/almost/fih3.png
frame data/chars/almost/fih4.png
frame data/chars/almost/fih5.png
frame data/chars/almost/fih6.png
killentity(self)
anim idle
# stun 10
loop 1 1
delay 3
offset 128 44
bbox 44 4 180 86
followanim 1
followcond 1
jugglecost 100
attack 89 19 104 57 0 0 1 0 0 75
dropv -1.0 -1.0 -1.0
hitflash flash2
hitfx data/sounds/beat2.wav
seta 1
@script
void self = getlocalvar("self");
if (getentityproperty(self, "direction")==1){
changeentityproperty(self,"parent", NULL());
changeentityproperty(self, "velocity", 16, 0, 0);
}
if (getentityproperty(self, "direction")==0){
changeentityproperty(self,"parent", NULL());
changeentityproperty(self, "velocity", 16, 0, 0);
changeentityproperty(self, "velocity", -16, 0, 0);
}
@end_script
frame data/chars/almost/fih1.png
frame data/chars/almost/fih2.png
frame data/chars/almost/fih3.png
frame data/chars/almost/fih4.png
frame data/chars/almost/fih5.png
frame data/chars/almost/fih6.png
frame data/chars/almost/fih1.png
frame data/chars/almost/fih2.png
frame data/chars/almost/fih3.png
frame data/chars/almost/fih4.png
frame data/chars/almost/fih5.png
frame data/chars/almost/fih6.png
frame data/chars/almost/fih1.png
frame data/chars/almost/fih2.png
frame data/chars/almost/fih3.png
frame data/chars/almost/fih4.png
frame data/chars/almost/fih5.png
frame data/chars/almost/fih6.png
frame data/chars/almost/fih1.png
frame data/chars/almost/fih2.png
frame data/chars/almost/fih3.png
frame data/chars/almost/fih4.png
frame data/chars/almost/fih5.png
frame data/chars/almost/fih6.png
Last edited: