dantedevil
Well-known member
Hello!
Its to hard for me use and learn script like said the member "nsw25" (Urban Lockdown").
I try to learn with the post of Itsuchi KS
To make a slam script a take the follow steps.
1. Create a file slam.c with the text of Itsuchi KS and put in the script folder
2. Set the line: animationscript data/scripts/slam.c
in the txt player header.
3. Take the animation of slam and apply the scripts.
In my case this is the animation:
But dont work.
The OpenBorLog says: Can't compile script!
This is the error script log:
Its not easy slam script...
Any idea?
Its to hard for me use and learn script like said the member "nsw25" (Urban Lockdown").
I try to learn with the post of Itsuchi KS
SLAM IS EASY:
@cmd position [1] [2] [3] [4] [5] - this controls the victims image frame and position, and it needs to declared for
each frame of the slam/throw
[1] # of fall7 animation (starts in 0)
[2] X axis -/+ left / right
[3] Y axis -/+ down / up
[4] Z axis -/+ (layer position) (ex: -1 behind attacker | 1 infront attacker // -10 more behind | 10 more infront)
[5] Controls victims facing direction: 0 = no change, 1 = same direction as slammer/thrower,
-1 = opposite direction as slammer
Example: @cmd position
@cmd position 6 50 45 -1 -1
So It will load sprites in a created anim "fall7" that contain all the needed sprites for the pain anim.
The 1st number in "posistion" is the FRAME NUMBER in FALL7 of the enemy that you would like to use but you can specify which frame to use per frame for your hero.
EX:
anim fall7
drawmethod 195 250 0 0 0 0 -1
delay 1000
offset 89 175
frame data/chars/chunli/hit1.png <---Frame 1
frame data/chars/chunli/fall15.png <---Frame 2
frame data/chars/chunli/fall14.png <---Frame 3
frame data/chars/chunli/fall29.png <---Frame 4
But you can have as many as you want but make sure you use the "same type" of frame for every character.
You have my old mod so this should be familiar with Sean (Forward, Down, Special):
anim freespecial9
drawmethod 195 250 0 0 0 0 -1
followanim 1
followcond 1
energycost 8
mponly 1
loop 0
delay 5
offset 89 175
BBox 48 101 81 76
Delay 10
Attack 48 101 81 76 0 0 1 0 0
move 15
Frame data\chars\sean\slide1.png
Frame data\chars\sean\slide2.png
Attack 0
Frame data\chars\sean\slide3.png
anim follow1
drawmethod 195 250 0 0 0 0 -1
hitfx data/sounds/hit1.wav
hitflash qflash2
fastattack 1
@cmd stop
@cmd lock
@cmd slamStart
@cmd position 0 20 1 -2 -1
delay 6
offset 89 175
sound data/chars/sean/mata.wav
frame data/chars/sean/tackle1.png
@cmd position 0 25 1 -2 -1
move 7
frame data/chars/sean/tackle2.png
@cmd position 1 0 40 -2 -1
frame data/chars/sean/tackle3.png
@cmd position 3 -13 1 -2 -1
frame data/chars/sean/tackle4.png
frame data/chars/sean/tackle5.png
move 0
frame data/chars/sean/tackle6.png
frame data/chars/sean/pound1.png
sound data/sounds/sw.wav
frame data/chars/sean/pound2.png
@cmd hurt2 3 1
@cmd spawn01 "qflash2" 0 20 1
sound data/sounds/hit1.wav
frame data/chars/sean/pound3.png
frame data/chars/sean/pound4.png
frame data/chars/sean/pound5.png
frame data/chars/sean/pound6.png
sound data/sounds/sw.wav
frame data/chars/sean/pound7.png
@cmd hurt2 4 1
@cmd spawn01 "qflash2" 0 20 1
sound data/sounds/hit1.wav
frame data/chars/sean/pound8.png
frame data/chars/sean/pound9.png
frame data/chars/sean/pound10.png
frame data/chars/sean/pound1.png
sound data/sounds/sw.wav
frame data/chars/sean/pound2.png
@cmd hurt2 4 1
@cmd spawn01 "qflash2" 0 20 1
sound data/sounds/hit1.wav
frame data/chars/sean/pound3.png
frame data/chars/sean/pound4.png
frame data/chars/sean/pound5.png
frame data/chars/sean/pound6.png
sound data/sounds/sw.wav
frame data/chars/sean/pound7.png
@cmd hurt2 5 1
@cmd spawn01 "qflash2" 0 20 1
sound data/sounds/hit1.wav
frame data/chars/sean/pound8.png
frame data/chars/sean/pound9.png
frame data/chars/sean/pound10.png
#
offset 89 175
frame data/chars/sean/smash1.png
frame data/chars/sean/smash2.png
frame data/chars/sean/smash3.png
@cmd spawn02 "flash3"
@cmd spawn01 "flash4" 0 130 1
sound data/chars/sean/speech2.wav
frame data/chars/sean/smash4.png
@cmd finish 25 3 2 0 -1
@cmd spawn01 "wave" 0 0 -1
sound data/sounds/hit1.wav
@cmd depost
@cmd clearSlam
frame data/chars/sean/smash5.png
frame data/chars/sean/smash6.png
frame data/chars/sean/smash1.png
frame data/chars/sean/smash7.png
frame data/chars/sean/slide3.png
frame data/chars/sean/roll1.png
frame data/chars/sean/rise11.png
Even Chun Li's GRABBACKWARD:
anim grabbackward
drawmethod 195 250 0 0 0 0 -1
attackone 0
hitfx data/sounds/bukk.wav
@cmd lock
@cmd slamStart
@cmd position 0 22 0 -1 0
offset 89 183
delay 20
sound data/sounds/grab.wav
@cmd spawn01 "fblock" 25 90 1
frame data/chars/chunli/flipk13.png
@cmd position 0 25 0 -1 0
Delay 5
offset 88 183
sound data/chars/chunli/haaa.wav
frame data/chars/chunli/flipk1.png
sound data/sounds/ss1.wav
frame data/chars/chunli/flipk1.png
frame data/chars/chunli/flipk2.png
@cmd position 1 0 75 -1 1
Delay 10
offset 87 195
frame data/chars/chunli/flipk3.png
frame data/chars/chunli/flipk4.png
@cmd position 2 -25 55 -1 1
Delay 6
offset 109 169
Attack -25 -6 60 70 12 1 1 0 20
frame data/chars/chunli/flipk5.png
frame data/chars/chunli/flipk6.png
@cmd position 2 -30 0 -1 1
@cmd hurt 24
@cmd spawn01 "down" -40 0 1
Delay 15
offset 97 140
Attack -12 15 74 53 12 1 1 0 20
frame data/chars/chunli/flipk7.png
@cmd position 3 -40 0 -1 1
@cmd finish 0 -2 2 0 1
@cmd depost
@cmd clearSlam
Delay 7
offset 97 140
Attack 0
frame data/chars/chunli/flipk8.png
offset 97 175
frame data/chars/chunli/da14.png
frame data/chars/chunli/da15.png
In order for your characters to do slams, you will need slam.c scripts. I got you:
#include "data/scripts/common/score.c"
void lock()
{
lockEntity(1);
}
void lockEntity(void noair)
{
void self = getlocalvar("self");
void target = getentityproperty(self, "grabbing");
if (!target){
target = getentityproperty(self, "opponent");
if(!target){
setentityvar(self,0,0);
setidle(self,openborconstant("ANI_IDLE"));
return;
}
}
if(getentityproperty(target,"type")==openborconstant("TYPE_OBSTACLE")
||getentityproperty(target,"dead")
||getentityproperty(target,"antigrab")
){
setidle(self,openborconstant("ANI_IDLE"));
}else{
if(noair)
{
if(getentityproperty(target,"a")!=getentityproperty(target,"base"))
{
setidle(self,openborconstant("ANI_IDLE"));
return;
}
}
setentityvar(self,0,target);
setentityvar(target,0,1);
}
}
void slamStart()
{
void self = getlocalvar("self");
if(!self){return;}else{}
void target = getentityvar(self,0);
if(target)
{
changeentityproperty(target,"noaicontrol",1);
performattack(target,openborconstant("ANI_FALL7"));
}else{
setidle(self,openborconstant("ANI_IDLE"));
}
}
void position(int Frame, float dx, float dy, float dz, int face)
{
void self = getlocalvar("self");
if(!self){return;}else{}
void target = getentityvar(self,0);
if(target)
{
updateframe(target, Frame);
bindentity(target, self, dx, dz, dy, face, 0);
//changeentityproperty(target,"nextthink",openborvariant("elapsed_time")+250);
//changeentityproperty(target,"nextanim",openborvariant("elapsed_time")+250);
}
}
void depost()
{
depost01(0);
}
void depost01(void bounce)
{
void self = getlocalvar("self");
void target = getentityvar(self,0);
if(target)
{
bindentity(target, NULL());
if(bounce)
{
changeentityproperty(target,"velocity",0,0,0);
}
}
}
void slamHurt()
{
//void self = getlocalvar("self");
//void target = getentityvar(self,0);
//void model;
//if(target){
// model=getentityproperty(target,"model");
// if (model=="Hugo"
// ||model=="Andore"
// ||model=="Raiden"
// ||model=="Chang"
// ||model=="Alex"
// ||model=="Zankuro"
// )
// {
// depost();
// clearSlam();
// damageentity(self,target,15,1,openborconstant("ATK_NORMAL"));
// damageentity(target,self,0,1,openborconstant("ATK_NORMAL"));
// tossentity(target,-1,0.01, 0);
// }
//}
}
void clearSlam()
{
void self = getlocalvar("self");
void target = getentityvar(self,0);
void x,zself,xself,offset,wall,i;
void base=getentityproperty(self,"base");
if(target)
{
setentityvar(self,0,NULL());
setentityvar(target,0,NULL());
x=getentityproperty(target,"x");
xself=getentityproperty(self,"x");
zself=getentityproperty(self,"z");
changeentityproperty(target,"noaicontrol",0);
if (xself>x){
offset=2;
}else{
offset=-2;
}
for (i=0;i<200;i++)
{
wall=checkwall(x,zself);
if (wall<=base){
changeentityproperty(target,"position",x,zself);
return;
}
x+=offset;
}
}
}
void finish(int Damage, int x, int y, int z, int faceOpposite)
{
void self = getlocalvar("self");
void target = getentityvar(self,0);
int SDir = getentityproperty(target,"direction");
int MDir;
if(faceOpposite){
MDir=!SDir;
}else{
MDir=SDir;
}
if(target)
{
int dir = getentityproperty(target,"direction");
if(!dir)x = -x;
damageentity(target, self, Damage, 1, openborconstant("ATK_NORMAL"));
tossentity(target, y, x, z);
changeentityproperty(target, "direction", MDir);
}
}
void throw(int Damage, int x, int y, int z, int faceOpposite)
{
void self = getlocalvar("self");
void target = getentityvar(self,0);
int SDir = getentityproperty(target,"direction");
int MDir;
if(faceOpposite){
MDir=!SDir;
}else{
MDir=SDir;
}
if(target)
{
int dir = getentityproperty(target,"direction");
if(!dir){
x = -x;
}
bindentity(target, NULL());
damageentity(target, self, 0, 1, openborconstant("ATK_NORMAL4"));
changeentityproperty(target, "attacking", 1);
changeentityproperty(target, "damage_on_landing", Damage);
changeentityproperty(target, "projectile", 1);
changeentityproperty(target, "direction", MDir);
tossentity(target, y, x, z);
clearSlam();
}
}
void hurt(int aamage)
{
hurt2(aamage,0);
}
void hurt2(int damage,int is_live)
{
hurt3(damage,is_live,7,1);
}
void hurt3(int Damage,int is_live,int type,int keepframe)
{
void self = getlocalvar("self");
void target = getentityvar(self,0);
if(!target){return;}else{}
int TAniPos = getentityproperty(target,"animpos");
if (is_live){
void hp=getentityproperty(target,"health");
void thp = hp;
thp -=Damage;
if(thp<1)thp=1;
changeentityproperty(target,"health",thp);
addScore(self,Damage*5);
}else{
if(!type)
damageentity(target, self, Damage, 1, openborconstant("ATK_NORMAL"));
else
damageentity(target, self, Damage, 1, openborconstant("ATK_NORMAL"+type));
}
if (keepframe)updateframe(target, TAniPos);
}
I have slam.c in data/scripts/common/slam.c
To make a slam script a take the follow steps.
1. Create a file slam.c with the text of Itsuchi KS and put in the script folder
2. Set the line: animationscript data/scripts/slam.c
in the txt player header.
3. Take the animation of slam and apply the scripts.
In my case this is the animation:
anim freespecial4
loop 0
followanim 4
followcond 3
delay 18
jumpframe 2 1 0
offset 82 177
bbox 79 90 29 88
frame data/chars/midas/at2c.gif
delay 2
move 6
movea 4
movez 4
bbox 52 68 31 111
sound data/chars/midas/yaa2.wav
frame data/chars/midas/kick0.gif
frame data/chars/midas/kick0.gif
move 6
frame data/chars/midas/kick0.gif
movez 0
frame data/chars/midas/kick0.gif
move 4
frame data/chars/midas/kick0.gif
frame data/chars/midas/kick0.gif
movea 2
attack 84 108 28 34 5 0 0 0 10
frame data/chars/midas/knee.gif
frame data/chars/midas/knee.gif
frame data/chars/midas/knee.gif
frame data/chars/midas/knee.gif
frame data/chars/midas/knee.gif
frame data/chars/midas/knee.gif
attack 0 0 0 0
move 1
frame data/chars/midas/knee.gif
frame data/chars/midas/knee.gif
frame data/chars/midas/knee.gif
frame data/chars/midas/knee.gif
frame data/chars/midas/knee.gif
movea 0
frame data/chars/midas/knee.gif
frame data/chars/midas/kick0.gif
frame data/chars/midas/kick0.gif
frame data/chars/midas/kick0.gif
frame data/chars/midas/kick0.gif
frame data/chars/midas/kick0.gif
anim follow4
loop 0
followanim 5
followcond 3
delay 2
move 2
movea 2
attack 0 0 0 0
bbox 0 0 0 0
offset 82 177
frame data/chars/midas/knee.gif
frame data/chars/midas/knee.gif
frame data/chars/midas/knee.gif
frame data/chars/midas/knee.gif
frame data/chars/midas/knee.gif
move 1
frame data/chars/midas/knee.gif
frame data/chars/midas/knee.gif
frame data/chars/midas/knee.gif
frame data/chars/midas/knee.gif
frame data/chars/midas/knee.gif
frame data/chars/midas/knee.gif
movea 0
move 0
frame data/chars/midas/knee.gif
offset 87 183
frame data/chars/midas/break0.gif
frame data/chars/midas/break0.gif
frame data/chars/midas/break0.gif
frame data/chars/midas/break0.gif
frame data/chars/midas/break0.gif
frame data/chars/midas/break0.gif
hitfx data/sounds/indirect.wav
attack 88 107 42 24 5 0 1 0 15
frame data/chars/midas/break2b.gif
frame data/chars/midas/break2b.gif
offset 82 177
attack 0 0 0 0
frame data/chars/midas/break2.gif
frame data/chars/midas/break2.gif
delay 30
frame data/chars/midas/break2.gif
delay 12
frame data/chars/midas/break1.gif
anim follow5
loop 0
fastattack 1
followanim 8
followcond 3
offset 87 183
delay 2
bbox 0 0 0 0
frame data/chars/midas/break2b.gif
frame data/chars/midas/break2b.gif
offset 82 177
attack 0 0 0 0
frame data/chars/midas/break2.gif
frame data/chars/midas/break2.gif
delay 30
frame data/chars/midas/break2.gif
delay 12
frame data/chars/midas/break1.gif
hitfx data/sounds/empty.wav
delay 4
attackone 1
attack 100 90 15 35 0 0 1 1 10
frame data/chars/midas/break1.gif
attack 0 0 0 0
anim follow8
loop 0
offset 82 177
delay 4
move -20
bbox 0 0 0 0
attack 0 0 0 0
frame data/chars/midas/grab.gif
move 0
fastattack 1
jumpframe 2 4 0
landframe 7
quakeframe 7 5 -2
delay 4
hitFX data/sounds/jump.wav
@cmd stop
@cmd lock
@cmd slamStart
@cmd position 0 20 1 -2 -1
attackone 1
attack13 115 90 30 35 0 0 1 1 10 20
frame data/chars/midas/grab.gif
movez 0
attack 0 0 0 0
delay 14
frame data/chars/midas/slam0.gif
sound data/chars/midas/yaa1.wav
delay 6
frame data/chars/midas/slam1.gif
offset 99 156
frame data/chars/midas/pile00.gif
delay 16
frame data/chars/midas/pile01.gif
delay 999
frame data/chars/midas/pile01.gif
delay 5
sound data/sounds/slam.wav
frame data/chars/midas/pile02.gif
frame data/chars/midas/pile02.gif
frame data/chars/midas/pile02.gif
frame data/chars/midas/pile02.gif
frame data/chars/midas/pile02.gif
hitfx data/sounds/empty.wav
attack8 110 135 40 20 10 1 1 1 50 20
damageonlanding 10 1
staydown 500 500
frame data/chars/midas/pile02.gif
frame data/chars/midas/pile02.gif
frame data/chars/midas/pile02.gif
frame data/chars/midas/pile02.gif
frame data/chars/midas/pile02.gif
attack 0 0 0 0
@cmd finish 25 3 2 0 -1
@cmd depost
@cmd clearSlam
delay 12
offset 82 177
frame data/chars/midas/rise1.gif
frame data/chars/midas/rise2.gif
frame data/chars/midas/rise3.gif
But dont work.
The OpenBorLog says: Can't compile script!
This is the error script log:
####animationscript function main#####
# data/chars/midas/midas.txt
########################################
void main()
{
int frame = getlocalvar("frame");
int animhandle = getlocalvar("animhandle");
if(animhandle==167)
{
if(frame==1)
{
stop();
}
if(frame==1)
{
lock();
}
if(frame==1)
{
slamStart();
}
if(frame==17)
{
finish(25, 3, 2, 0, -1);
}
if(frame==17)
{
depost();
}
if(frame==17)
{
clearSlam();
}
return;
}
}
Its not easy slam script...
Any idea?
