dantedevil
Well-known member
It's possible create a way for the two different enemies bosses share the same health bar?
Like the Rude Bros. in Vendetta?
Like the Rude Bros. in Vendetta?

Last edited:
void spawnMate(void vName, float fX, float fY, float fZ)
{//Spawns Mate next to caller
//Spawned Mate & caller will know each other
//vName: Model name of entity to be spawned in
//fX: X location adjustment
//fZ: Y location adjustment
//fY: Z location adjustment
void self = getlocalvar("self"); //Get calling entity
int Health = getentityproperty(self, "health");
int Map = getentityproperty(self, "map");
void Mate; //Spawn object.
Mate = spawn01(vName, fX, fY, fZ); //Spawn Mate
changeentityproperty(Mate, "map", Map); //Match Mate's remap with self's...
void spawnMate(void vName, float fX, float fY, float fZ)
{//Spawns Mate next to caller
//Spawned Mate & caller will know each other
//vName: Model name of entity to be spawned in
//fX: X location adjustment
//fZ: Y location adjustment
//fY: Z location adjustment
void self = getlocalvar("self"); //Get calling entity
int Health = getentityproperty(self, "health");
int Map = getentityproperty(self, "map");
void Mate; //Spawn object.
Mate = spawn01(vName, fX, fY, fZ); //Spawn Mate
changeentityproperty(Mate, "map", Map); //Match Mate's remap with self's
changeentityproperty(Mate, "maxhealth", Health); //Match Mate's health with self's
changeentityproperty(Mate, "health", Health); //Match Mate's health with self's
setentityvar(self, 0, Mate); //Store mate to self
setentityvar(Mate, 0, self); //Store self to mate
}
void main()
{// Equalize health with mate's health
void self = getlocalvar("self"); //Get calling entity
void Mate = getentityvar(self, 0); //Find Mate
void MateX = getentityproperty(Mate, "exists");
int Health = getentityproperty(self,"health");
if(Mate!=NULL() && MateX){
if(Health > 0){
changeentityproperty(Mate, "health", Health);
} else {
setentityvar(self, 0, NULL());
setentityvar(Mate, 0, NULL());
damageentity(Mate, self, 1000, 1, openborconstant("ATK_NORMAL"));
}
}
}
********** An Error Occurred **********
* Shutting Down *
There's an exception while executing script 'animationscript' data/chars/bodyguard/bodyguard4.txtTotal Ram: 4294967295 Bytes
Free Ram: 4294967295 Bytes
Used Ram: 121274368 Bytes
Release level data........
animationscript data/scripts/escript.c
takedamagescript data/scripts/equal.c
anim spawn
loop 0
delay 20
offset 82 177
frame data/chars/bodyguard/idle0.png
frame data/chars/bodyguard/idle1.png
delay 28
frame data/chars/bodyguard/idle2.png
delay 20
@cmd spawnMate "bodyguard" 100 0 0
frame data/chars/bodyguard/idle1.png
Bloodbane said:Hmmm.... do you have spawn01 function too?
maxentityvars 50
maxman said:You should use PasteBin in order for you to paste the entire thing for your post with a link. Each post is limited with 2000 characters (letters, numbers, symbols, etc.) here. There's nothing wrong with a few posts of yours here but I'm just pointing out for you to use so you can paste your entire log there and share link here. I'm not trying to be/sound judgmental, dictating, or moderating on what you do. I point out what's easier for you, man.![]()
Bloodbane said:That might work as the combined obstacle method I used in Crime Buster is really old
[void spawnAniM(void vName, float fX, float fY, float fZ, void Ani, float Vx, float Vy, float Vz)
{
//spawnB (Generic spawner) + Specific animation + velocities
//Damon Vaughn Caskey + Douglas Baldan/O Ilusionista
//07/06/2007 - 30/05/2013
//
//Spawns entity next to caller.
//
//vName: Model name of entity to be spawned in.
//fX: X location adjustment.
//fZ: Y location adjustment.
//fY: Z location adjustment.
void self = getlocalvar("self"); //Get calling entity.
int iMap = getentityproperty(self, "map"); // Get caller's remap.
void vSpawn; //Spawn object.
int iDirection = getentityproperty(self, "direction");
clearspawnentry(); //Clear current spawn entry.
setspawnentry("name", vName); //Acquire spawn entity by name.
if (iDirection == 0){ //Is entity facing left?
fX = -fX; //Reverse X direction to match facing.
}
fX = fX + getentityproperty(self, "x"); //Get X location and add adjustment.
fY = fY + getentityproperty(self, "a"); //Get Y location and add adjustment.
fZ = fZ + getentityproperty(self, "z"); //Get Z location and add adjustment.
vSpawn = spawn(); //Spawn in entity.
changeentityproperty(vSpawn, "position", fX, fZ, fY); //Set spawn location.
changeentityproperty(vSpawn, "direction", iDirection); //Set direction.
performattack(vSpawn, openborconstant(Ani));
changeentityproperty(vSpawn, "velocity", Vx, Vy, Vz);
changeentityproperty(vSpawn, "map", iMap); //Set map.
return vSpawn; //Return spawn.
}
void spawnMate(void vName, float fX, float fY, float fZ)
{//Spawns Mate next to caller
//Spawned Mate & caller will know each other
//vName: Model name of entity to be spawned in
//fX: X location adjustment
//fZ: Y location adjustment
//fY: Z location adjustment
void self = getlocalvar("self"); //Get calling entity
int Health = getentityproperty(self, "health");
int Map = getentityproperty(self, "map");
void Mate; //Spawn object.
Mate = spawn01(vName, fX, fY, fZ); //Spawn Mate
changeentityproperty(Mate, "map", Map); //Match Mate's remap with self's
changeentityproperty(Mate, "maxhealth", Health); //Match Mate's health with self's
changeentityproperty(Mate, "health", Health); //Match Mate's health with self's
setentityvar(self, 0, Mate); //Store mate to self
setentityvar(Mate, 0, self); //Store self to mate
}
void spawnMate2(void vName, float fX, float fY, float fZ, void Ani)
{//Spawns Mate next to caller
//Spawned Mate & caller will know each other
//vName: Model name of entity to be spawned in
//fX: X location adjustment
//fZ: Y location adjustment
//fY: Z location adjustment
void self = getlocalvar("self"); //Get calling entity
void vSpawn; //Spawn object.
int iDirection = getentityproperty(self, "direction");
int Health = getentityproperty(self, "health");
int Map = getentityproperty(self, "map");
void Mate; //Spawn object.
clearspawnentry(); //Clear current spawn entry.
setspawnentry("name", vName); //Acquire spawn entity by name.
if (iDirection == 0){ //Is entity facing left?
fX = -fX; //Reverse X direction to match facing.
}
fX = fX + getentityproperty(self, "x"); //Get X location and add adjustment.
fY = fY + getentityproperty(self, "a"); //Get Y location and add adjustment.
fZ = fZ + getentityproperty(self, "z"); //Get Z location and add adjustment.
vSpawn = spawn(); //Spawn in entity.
Mate = spawn01(vName, fX, fY, fZ); //Spawn Mate
changeentityproperty(Mate, "map", Map); //Match Mate's remap with self's
changeentityproperty(Mate, "maxhealth", Health); //Match Mate's health with self's
changeentityproperty(Mate, "health", Health); //Match Mate's health with self's
changeentityproperty(vSpawn, "position", fX, fZ, fY); //Set spawn location.
changeentityproperty(vSpawn, "direction", iDirection); //Set direction.
performattack(vSpawn, openborconstant(Ani));
setentityvar(self, 0, Mate); //Store mate to self
setentityvar(Mate, 0, self); //Store self to mate
return vSpawn; //Return spawn.
}
name Equalo
type none
shadow 0
anim idle
@script
void self = getlocalvar("self");
void Parent = getentityproperty(self, "parent"); // Get parent
int Health = getentityproperty(self, "health"); // Get entity's health
if(Parent){ //Have parent?
int PHealth = getentityproperty(Parent, "health"); // Get parent's health
int EHealth = getglobalvar("Equalo");
if(EHealth == NULL()){
EHealth = 5000;
}
if(EHealth <= 0){
damageentity(Parent, self, 1, 1, openborconstant("ATK_NORMAL"));
} else if(PHealth <= 0){
setglobalvar("Equalo", PHealth);
killentity(self);
} else if(PHealth < EHealth){
setglobalvar("Equalo", PHealth);
} else if(PHealth > EHealth) {
changeentityproperty(Parent, "health", EHealth);
}
}
@end_script
loop 1
delay 2
offset 1 1
frame data/chars/misc/empty.gif
frame data/chars/misc/empty.gif
void main()
{
void self = getlocalvar("self"); //Get calling entity.
void vSpawn; //Spawn object.
clearspawnentry(); //Clear current spawn entry.
setspawnentry("name", "Equalo");
vSpawn = spawn(); //Spawn in entity.
changeentityproperty(vSpawn, "parent", self); //Set caller as parent.
bindentity(vSpawn, self, 0, 1, 50, 0, 0);
}
setglobalvar("Equalo", 5000);
spawn Jake
health 200
spawnscript data/scripts/equalis.c
coords 400 190 1
at 200
spawn Bred
health 300
spawnscript data/scripts/equalis.c
coords -100 220 1
at 0
spawn Jay
health 300
spawnscript data/scripts/equalis.c
coords 500 230 1
at 0