here it is...
I was going to try to and make one of this later after finishing my mod...
however there is a really big problem here...
the player keys are not released this means if the player holds left/right/attack/jump
the gaunge will keep increasing the point was to make it increase only when he presses the key...
Bloodbayne needs to check this !!! I think I once saw him make a release key script....
also when player escapes the slam if a wall is there puff bye bye...
see the attachment below to get the full grab escape entity
http://www.mediafire.com/download/v9oyng1njfaxysn/grab.rar
this is the grab1 entity
Code:
name grab1
type obstacle
scroll 1
health 300
speed 0
nomove 1 1
facing 1
noquake 1
shadow 0
falldie 1
antigrab 10
offscreenkill 30000
subject_to_wall 0
subject_to_platform 0
subject_to_obstacle 0
subject_to_hole 0
subject_to_gravity 0
diesound data/sounds/empty.wav
setlayer 999999998
lifebarstatus 150 20 0 1 0 2 5
lifeposition 120 240
nolife 1
anim idle
@script
void self = getlocalvar("self");
void attacker = getentityproperty(self,"parent");
void victim2 = getentityproperty(attacker, "opponent");
void victim = getentityproperty(victim2, "playerindex");
int HP = getentityproperty(self,"health");
int HPmax = getentityproperty(self,"maxhealth");
int escape = getentityvar(self, "madjon");
if(HP>=HPmax && escape == 1){
performattack(victim2, openborconstant("ANI_FOLLOW15"));
setidle(attacker, openborconstant("ANI_IDLE"));
bindentity(victim2, NULL());
setentityvar(self, "madjon", NULL());
killentity(self);
} else if(HP>=HPmax && escape == 2){
performattack(victim2, openborconstant("ANI_FOLLOW16"));
setidle(attacker, openborconstant("ANI_IDLE"));
bindentity(victim2, NULL());
setentityvar(self, "madjon", NULL());
killentity(self);
} else if(HP>=HPmax && escape == 3){
performattack(victim2, openborconstant("ANI_FOLLOW17"));
setidle(attacker, openborconstant("ANI_IDLE"));
bindentity(victim2, NULL());
setentityvar(self, "madjon", NULL());
killentity(self);
} else if(playerkeys(victim, 0, "moveleft")){// Left is pressed?
changeentityproperty(self, "health", HP+1);
} else if(playerkeys(victim, 0, "moveright")){// Right is pressed?
changeentityproperty(self, "health", HP+1);
} else if(playerkeys(victim, 0, "attack")){// Right is pressed?
changeentityproperty(self, "health", HP+1);
} else if(playerkeys(victim, 0, "jump")){// Right is pressed?
changeentityproperty(self, "health", HP+1);
}
@end_script
loop 1
delay 5
offset 125 130
bbox 0 0 0 0
#quakeframe 0 10 5
platform 1 1 1 1 1 1 1 1
frame data/chars/misc/grab/grab01.gif
frame data/chars/misc/grab/grab02.gif
frame data/chars/misc/grab/grab03.gif
frame data/chars/misc/grab/grab02.gif
frame data/chars/misc/grab/grab01.gif
frame data/chars/misc/grab/grab02.gif
frame data/chars/misc/grab/grab03.gif
frame data/chars/misc/grab/grab02.gif
frame data/chars/misc/grab/grab01.gif
frame data/chars/misc/grab/grab02.gif
frame data/chars/misc/grab/grab03.gif
frame data/chars/misc/grab/grab02.gif
anim spawn
@script
void self = getlocalvar("self");
changeentityproperty(self, "health",-5);
@end_script
loop 0
delay 5
offset 125 130
bbox 0 0 0 0
platform 1 1 1 1 1 1 1 1
frame data/chars/misc/grab/empty.gif
frame data/chars/misc/grab/empty.gif
the enemy will use a special spawn01 to spawn the grab1 in its slamst animation
anim follow1
loop 0
delay 30
offset 125 215
bbox 0 0 0 0
@cmd stop
@cmd slamstart2
@cmd position 11 45 30 -1 -1
frame data/chars/badguy/grab20.gif
delay 14
@cmd spawngrab "grab1" 200 200 450 50 3 #------- escape
@cmd position 7 30 55 -1 -1
frame data/chars/badguy/grab21.gif
@cmd position 11 30 65 -1 -1
frame data/chars/badguy/grab22.gif
@cmd position 11 30 75 -1 -1
frame data/chars/badguy/grab23.gif
frame.....
frame.....
you need to add the spawngrab script in the enemy animations script
animations script.c
void spawngrab(void vName, float fX, float fY, float fZ,int HPgv, int Num2)
{ //Spawns.a.grab---set.it.as.child--with.HP.MAX--opponent.plays.follow
//opponent.follow.Num=1jumpback
// Num=2dashlow
// Num=3countergrab
void self = getlocalvar("self");
void vSpawn;
vSpawn = spawn02(vName, fX, fY, fZ);
setentityvar(vSpawn, "madjon", Num2);
changeentityproperty(vSpawn, "maxhealth", HPgv);
changeentityproperty(vSpawn, "parent", self); //Set caller as parent.
return vSpawn; //Return spawn.
}
it spawns the grab1 entity on the camera panel coordinates not enemy coordinates
so add spawn02 in animations script
Code:
void spawn02(void vName, float fX, float fY, float fZ)
{ //Spawns entity based on left screen edge
//vName: Model name of entity to be spawned in.
//fX: X distance relative to left edge
//fY: Y height from ground
//fZ: Z location adjustment
void self = getlocalvar("self"); //Get calling entity.
void vSpawn; //Spawn object.
int XPos = openborvariant("xpos"); //Get screen edge's x position
int YPos = openborvariant("ypos"); //Get screen edge's y position
clearspawnentry(); //Clear current spawn entry.
setspawnentry("name", vName); //Acquire spawn entity by name.
vSpawn = spawn(); //Spawn in entity.
changeentityproperty(vSpawn, "position", fX + XPos, fZ + YPos, fY); //Set spawn location.
return vSpawn; //Return spawn.
}
it works very easly
void spawngrab(void vName, float fX, float fY, float fZ,int HPgv, int Num2)
vName - entity (grab1)
coords - X
coords - y - it scrolls with panel so set an altitude of 200
coords - Z - give it a z 400 to bring it 200 down
HPgv - its the grab1 health
Num2 - its the player release animation ive only made 3 more can be added (follow15/16/17)
-----release options-----
follow15 - player jumps back
follow16 - player dashes back
follow17 - player makes a counter grab
you need to set Num2 (1/2 or 3) in enemy @cmd spawngrab for the player to make the escape type depending on the slam...
important !!!
HPgv - its the grab1 health
in enemy @cmd spawngrab (HPgv) is the gauge release value
entity grab1 sets its health to 1 in its spawn animation when the player presses the keys entity grab1 health wil increase +1 once its reaches 100% the player makes an escape....
so if you give the entity grab1 a health of 1000 the player wil be there pressing the keys for a long time...
this is to make enemies harder and some slams harder to escape than others...
P.S. THE SLAM WORKS FOR ALL PLAYERS ON SCREEN PLAYER0/1/2/3/1000...ETC...
at frist player1 keys were controlling the escape of player 2 but I manadge to get the current player... also entity works better has type obstacle wrong type in media fire grab.rar
I was going to post a neo edit pack with this but I still have to make the slams animations for players and enemy
I will post a video later on... then maybe the neo edit pack