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...
Bloodbane said:Ah, I knew you'd ask this issue
That happened because when one of enemies is killed, the rest will be killed by knocking them down
I'm going to figure out how to kill the rest without making them fall in strange way
@script
if(frame==1){
void vEntity; //Target entity placeholder.
int iEntity; //Entity enumeration holder.
int iType; //Entity type.
int iHP; //Entity HP
int iMax = openborvariant("ent_max"); //Entity count.
//Enumerate and loop through entity collection.
for(iEntity=0; iEntity<iMax; iEntity++){
vEntity = getentity(iEntity); //Get target entity from current loop.
iType = getentityproperty(vEntity, "type"); //Get target type.
iHP = getentityproperty(vEntity, "health"); //Get target health
//Enemy type?
if (iType == openborconstant("TYPE_ENEMY") && iHP > 0){
damageentity(vEntity, vEntity, 2000, 1, openborconstant("ATK_NORMAL"));
}
}
changeopenborvariant("slowmotion", 1);
setindexedvar("Dead", 1);
}
if(frame==2){
void self = getlocalvar("self");
changeopenborvariant("slowmotion", 0);
killentity(self);
}
@end_script
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, 0, 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
Bloodbane said:Sorry for the late reply, I was busy making a game for 3 days jam
Anyways, try this slightly updated Equalo:
Code: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, 0, 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
@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_NORMAL15"));
} 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
anim fall15
loop 0
delay 9
offset 82 177
bbox 38 159 98 19
@cmd stop
frame data/chars/gang1/bee/pain8.png
@cmd degravity 0
frame data/chars/gang1/bee/fall4.png
How do I use different Spawn custom, when I use a spawnscript in the level?
Thanks for this my friend!How do I use different Spawn custom, when I use a spawnscript in the level?
You either:
1. Make new spawnscript which contains both contents of spawnscript and custom SPAWN
OR
2. Copy the contents of spawnscript into custom SPAWN script
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){
int PFall = getentityproperty(Parent, "aiflag", "falling");
changeentityproperty(Parent, "health", 0);
if(PFall == 1){
changeentityproperty(Parent, "damage_on_landing", 5);
} else {
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
Bloodbane said:I've figured out a way to prevent a enemies from getting knocked down again. This is the updated equalo.txt:
Code: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){ int PFall = getentityproperty(Parent, "aiflag", "falling"); changeentityproperty(Parent, "health", 0); if(PFall == 1){ changeentityproperty(Parent, "damage_on_landing", 5); } else { 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
I haven't tested this with fatality yet. I'm going to find something to test that