maxman
Well-known member
I have a projectile which is a type trap that can hit any entity type I want since it's set in script with candamage. What I'm trying to do is to have the projectile hit any entity depending on which type that is. If it's a player or enemy type, that hitflash should have a special move hitflash to appear (switch to anim follow3). But if it's a trap type like projectiles, that should have a hitflash of collision spark (switch to anim follow1). Using followcond and followanim along with hitflash works perfectly, but only hitflash calls on certain entity to hit any entity instead of entity type. For instance, I'm trying to hit players and enemies with special flash like hitflash (but with script). Even hitting projectiles to appear like hitflash with anim follow1 without special hit sparks. Also, the problem is that if I don't use these 3 conditions for both fighters (followcond, followanim, and hitflash), the first one who unleashes his/her projectile, kills off the opponent's projectiles instead of clashing. If fighter 1 has no 3 conditions at all while fighter 2 has them, and fighter 1 unleashes his projectile first before fighter 2 does, that's gonna kill fighter 2's projectile off. If fighter 2 unleashes his projectile with 3 conditions in set before fighter 1 does unleash, that can collide. For instance, Ryu unleashes his Hadouken first before Ken does his, Ryu's projectile eliminates Ken's without clashing.
SpecFlash.txt:
projectilehit.c:
How can I have a clashing spark appear when projectiles collide, and special hit sparks when it hits directly at its target (player, enemy, NPC, or obstacle)?
Code:
name Hadoken
type trap
health 1
hostile enemy player trap none npc
gfxshadow 0
speed 8
nolife 1
remove 1
#nomove 1
alpha 1
setlayer 300
#hitenemy 1 0
antigravity 100
#lifespan 100000
offscreenkill 69 #USING OFFSCREENKILL IS A MUST WHEN IT COMES TO SUMMONING PROJECTILES ONCE UNTIL IT GETS KILLED OFFSCREEN OR HITS A FIGHTER OR PROJECTILE
hostile trap player enemy none npc
candamage npc none enemy player trap
#didhitscript data/scripts/didhit/hadouhit.c
#didhitscript data/scripts/knocker.c
didhitscript data/scripts/projectilehit.c
animationscript data/scripts/special.c
#animationscript data/scripts/script.c
#ondoattackscript data/scripts/knocker.c
onspawnscript @script
void main(){
void self = getlocalvar("self");
changeentityproperty(self, "candamage", (1 + 4096) || (2 + 4096) || (1 + 2048) || (2 + 2048) || (5 + 4096) || (9 + 2048) || (9 + 4096));
//Players, enemies, none, and trap types
}
@end_script
anim follow1
@script
void self = getlocalvar("self");
if(frame==0){
changeentityproperty(self, "velocity", 0, 0, 0);
setindexedvar("AfterHadou",1);
}
if(frame==15){
killentity(self);
}
@end_script
delay 2
offset 37 22
@cmd makeOpponentUnblock
frame data/chars/misc/hadoken/0700500000.gif
offset 71 54
frame data/chars/misc/hadoken/0700500001.gif
offset 61 42
frame data/chars/misc/hadoken/0700500002.gif
offset 59 45
frame data/chars/misc/hadoken/0700500003.gif
offset 62 46
frame data/chars/misc/hadoken/0700500004.gif
offset 65 46
frame data/chars/misc/hadoken/0700500005.gif
offset 68 46
frame data/chars/misc/hadoken/0700500006.gif
offset 70 44
frame data/chars/misc/hadoken/0700500007.gif
offset 71 38
frame data/chars/misc/hadoken/0700500008.gif
offset 71 39
frame data/chars/misc/hadoken/0700500009.gif
offset 70 40
frame data/chars/misc/hadoken/0700500010.gif
offset 69 40
frame data/chars/misc/hadoken/0700500011.gif
offset 67 41
frame data/chars/misc/hadoken/0700500012.gif
frame data/chars/misc/hadoken/0700500013.gif
offset 63 40
frame data/chars/misc/hadoken/0700500014.gif
offset 46 37
frame data/chars/misc/hadoken/0700500015.gif
offset 1 1
frame data/chars/misc/empty.gif
anim follow2
@script
void self = getlocalvar("self");
if(frame==0){
changeentityproperty(self, "velocity", 0, 0, 0);
}
if(frame==15){
killentity(self);
}
@end_script
loop 0
delay 2
offset 37 22
@cmd makeOpponentUnblock
frame data/chars/misc/hadoken/0700500000.gif
offset 71 54
frame data/chars/misc/hadoken/0700500001.gif
offset 61 42
frame data/chars/misc/hadoken/0700500002.gif
offset 59 45
frame data/chars/misc/hadoken/0700500003.gif
offset 62 46
frame data/chars/misc/hadoken/0700500004.gif
offset 65 46
frame data/chars/misc/hadoken/0700500005.gif
offset 68 46
frame data/chars/misc/hadoken/0700500006.gif
offset 70 44
frame data/chars/misc/hadoken/0700500007.gif
offset 71 38
frame data/chars/misc/hadoken/0700500008.gif
offset 71 39
frame data/chars/misc/hadoken/0700500009.gif
offset 70 40
frame data/chars/misc/hadoken/0700500010.gif
offset 69 40
frame data/chars/misc/hadoken/0700500011.gif
offset 67 41
frame data/chars/misc/hadoken/0700500012.gif
frame data/chars/misc/hadoken/0700500013.gif
offset 63 40
frame data/chars/misc/hadoken/0700500014.gif
offset 46 37
frame data/chars/misc/hadoken/0700500015.gif
offset 1 1
frame data/chars/misc/empty.gif
anim follow3
@script
void self = getlocalvar("self");
if(frame==0){
changeentityproperty(self, "velocity", 0, 0, 0);
setindexedvar("AfterHadou",1);
}
if(frame==4){
killentity(self);
}
@end_script
delay 2
offset 1 1
frame data/chars/misc/empty.gif
frame data/chars/misc/empty.gif
frame data/chars/misc/empty.gif
frame data/chars/misc/empty.gif
frame data/chars/misc/empty.gif
anim idle
@script
void self = getlocalvar("self");
changeentityproperty(self, "name", "Ryu");
changeentityproperty(self, "candamage", openborconstant("TYPE_NONE"), openborconstant("TYPE_ENEMY"), openborconstant("TYPE_PLAYER"), openborconstant("TYPE_NPC"), openborconstant("TYPE_TRAP"));
changeentityproperty(self, "subject_to_platform", 0);
@end_script
hitfx data/sounds/empty.wav
attack17 41 14 34 21 15 0 0 0 0 0 0
loop 1 1
delay 2
followanim 1
#followanim 3
followcond 1
#hitflash empty
hitflash SpecFlash
offset 67 22
bbox 41 14 34 21
platform 1 1 1 1 1 1 1 1 # <== PLEASE USE ALL 1's IN PLATFORM IF TRAP OR OBSTACLE TYPE IS USED SO IT DOESNT BLOCK ENTITIES
frame data/chars/misc/hadoken/0700000000.gif
@cmd makeOpponentBlock
hitfx data/sounds/empty.wav
attack17 41 14 34 21 15 0 0 0 0 0 0
delay 8
bbox 41 14 34 21
frame data/chars/misc/hadoken/0700000000.gif
offset 68 24
attack17 42 16 34 21 15 0 0 0 0 0 0
bbox 42 16 34 21
@cmd makeOpponentBlock
frame data/chars/misc/hadoken/0700000001.gif
offset 69 28
attack17 43 20 34 21 15 0 0 0 0 0 0
bbox 43 20 34 21
@cmd makeOpponentBlock
frame data/chars/misc/hadoken/0700000002.gif
offset 72 28
attack17 46 20 34 21 15 0 0 0 0 0 0
bbox 46 20 34 21
@cmd makeOpponentBlock
frame data/chars/misc/hadoken/0700000003.gif
attack17 46 20 34 21 15 0 0 0 0 0 0
@cmd makeOpponentBlock
frame data/chars/misc/hadoken/0700000004.gif
offset 77 28
attack17 51 20 34 21 15 0 0 0 0 0 0
bbox 51 20 34 21
@cmd makeOpponentBlock
frame data/chars/misc/hadoken/0700000005.gif
offset 74 27
attack17 48 19 34 21 15 0 0 0 0 0 0
bbox 48 19 34 21
@cmd makeOpponentBlock
frame data/chars/misc/hadoken/0700000006.gif
offset 78 26
attack17 52 18 34 21 15 0 0 0 0 0 0
bbox 52 18 34 21
@cmd makeOpponentBlock
frame data/chars/misc/hadoken/0700000007.gif
offset 79 23
attack17 53 15 34 21 15 0 0 0 0 0 0
bbox 53 15 34 21
@cmd makeOpponentBlock
frame data/chars/misc/hadoken/0700000008.gif
offset 79 22
attack17 53 14 34 21 15 0 0 0 0 0 0
bbox 53 14 34 21
@cmd makeOpponentBlock
frame data/chars/misc/hadoken/0700000009.gif
#|edited by openBor Stats v 0.67
SpecFlash.txt:
Code:
# Special Hit flash
name SpecFlash #Special flash (special move hitsparks)
type none
shadow 0
alpha 1
setlayer 50000
animationscript data/chars/misc/flash/flash.c
anim idle
delay 3
offset 36 51
@cmd randAni4 openborconstant("ANI_FOLLOW1") openborconstant("ANI_FOLLOW2") openborconstant("ANI_FOLLOW3") openborconstant("ANI_FOLLOW4")
frame none
frame none
anim follow1
delay 3
offset 360 272
#drawmethod 128 128 0 0 0 1 0 0 0 0 # drawmethod {scalex} {scaley} {flipx} {flipy} {shiftx} {alpha} {remap} {fillcolor} {rotate} {fliprotate}
drawmethod scale 0.52 0.52 # drawmethod scale {scalex} {scaley}
drawmethod alpha 1 # drawmethod alpha {alpha}
@cmd randDir
frame data/chars/misc/flash/M_flash/8210_0.png
frame data/chars/misc/flash/M_flash/8210_1.png
frame data/chars/misc/flash/M_flash/8210_2.png
frame data/chars/misc/flash/M_flash/8210_3.png
frame data/chars/misc/flash/M_flash/8210_4.png
frame data/chars/misc/flash/M_flash/8210_5.png
frame data/chars/misc/flash/M_flash/8210_6.png
frame data/chars/misc/flash/M_flash/8210_7.png
frame data/chars/misc/flash/M_flash/8210_8.png
frame data/chars/misc/flash/M_flash/8210_9.png
frame data/chars/misc/flash/M_flash/8210_10.png
frame data/chars/misc/flash/M_flash/8210_11.png
@cmd suicide
frame data/chars/misc/flash/M_flash/8210_11.png
anim follow2
delay 3
offset 360 272
#drawmethod 128 128 0 0 0 1 0 0 0 0 # drawmethod {scalex} {scaley} {flipx} {flipy} {shiftx} {alpha} {remap} {fillcolor} {rotate} {fliprotate}
drawmethod scale 0.52 0.52 # drawmethod scale {scalex} {scaley}
drawmethod alpha 1 # drawmethod alpha {alpha}
@cmd randDir
frame data/chars/misc/flash/M_flash/8211_0.png
frame data/chars/misc/flash/M_flash/8211_1.png
frame data/chars/misc/flash/M_flash/8211_2.png
frame data/chars/misc/flash/M_flash/8211_3.png
frame data/chars/misc/flash/M_flash/8211_4.png
frame data/chars/misc/flash/M_flash/8211_5.png
frame data/chars/misc/flash/M_flash/8211_6.png
frame data/chars/misc/flash/M_flash/8211_7.png
frame data/chars/misc/flash/M_flash/8211_8.png
frame data/chars/misc/flash/M_flash/8211_9.png
frame data/chars/misc/flash/M_flash/8211_10.png
frame data/chars/misc/flash/M_flash/8211_11.png
@cmd suicide
frame data/chars/misc/flash/M_flash/8211_11.png
anim follow3
delay 3
offset 360 272
drawmethod scale 0.52 0.52 # drawmethod scale {scalex} {scaley}
drawmethod alpha 1 # drawmethod alpha {alpha}
@cmd randDir
frame data/chars/misc/flash/M_flash/8212_0.png
frame data/chars/misc/flash/M_flash/8212_1.png
frame data/chars/misc/flash/M_flash/8212_2.png
frame data/chars/misc/flash/M_flash/8212_3.png
frame data/chars/misc/flash/M_flash/8212_4.png
frame data/chars/misc/flash/M_flash/8212_5.png
frame data/chars/misc/flash/M_flash/8212_6.png
frame data/chars/misc/flash/M_flash/8212_7.png
frame data/chars/misc/flash/M_flash/8212_8.png
frame data/chars/misc/flash/M_flash/8212_9.png
frame data/chars/misc/flash/M_flash/8212_10.png
frame data/chars/misc/flash/M_flash/8212_11.png
@cmd suicide
frame data/chars/misc/flash/M_flash/8212_11.png
anim follow4
delay 3
offset 360 272
drawmethod scale 0.52 0.52 # drawmethod scale {scalex} {scaley}
drawmethod alpha 1 # drawmethod alpha {alpha}
@cmd randDir
frame data/chars/misc/flash/M_flash/8213_0.png
frame data/chars/misc/flash/M_flash/8213_1.png
frame data/chars/misc/flash/M_flash/8213_2.png
frame data/chars/misc/flash/M_flash/8213_3.png
frame data/chars/misc/flash/M_flash/8213_4.png
frame data/chars/misc/flash/M_flash/8213_5.png
frame data/chars/misc/flash/M_flash/8213_6.png
frame data/chars/misc/flash/M_flash/8213_7.png
frame data/chars/misc/flash/M_flash/8213_8.png
frame data/chars/misc/flash/M_flash/8213_9.png
frame data/chars/misc/flash/M_flash/8213_10.png
frame data/chars/misc/flash/M_flash/8213_11.png
@cmd suicide
frame data/chars/misc/flash/M_flash/8213_11.png
projectilehit.c:
C:
void main(){
//Projectile hitting certain entity with specified hit effects
//A role play of hitfx
void self = getlocalvar("self");
void target = getentityproperty(self, "opponent");
void tname = getentityproperty(target, "defaultname");
void Type = getentityproperty(target, "type");
void Beat = loadsample("data/sounds/beat1.wav");
//clearspawnentry();
//loadmodel("specflash");
//setspawnentry("name", "specflash");
//void Spawn = spawn();
if(Type == openborconstant("TYPE_PLAYER")){
// Players
//void Beat = loadsample("data/sounds/beat1.wav");
playsample(Beat, 0, 100, 100, 0, 0);
//changeentityproperty(Spawn, "animation", openborconstant("ANI_IDLE"));
//performattack(self, openborconstant("ANI_FOLLOW3"));
//killentity(self);
}else if(Type == openborconstant("TYPE_ENEMY")){
// Enemies / CPU Opponents (Fighters as enemy type entities)
//void Beat = loadsample("data/sounds/beat1.wav");
playsample(Beat, 0, 100, 100, 0, 0);
//performattack(self, openborconstant("ANI_FOLLOW3"));
//killentity(self);
}else if(tname == "Ryu3"){
// Dummies
//void Beat = loadsample("data/sounds/beat1.wav");
playsample(Beat, 0, 100, 100, 0, 0);
//performattack(self, openborconstant("ANI_FOLLOW3"));
//killentity(self);
}/*else if(tname == "hadoken" || tname == "khadoken" || tname == "khadokenE" || tname == "hadokenE"){
//performattack(self, openborconstant("ANI_FOLLOW1"));
changeentityproperty(self, "animation", openborconstant("ANI_FOLLOW1"));
//killentity(self);
}*/
}
How can I have a clashing spark appear when projectiles collide, and special hit sparks when it hits directly at its target (player, enemy, NPC, or obstacle)?
Last edited: