dantedevil
Well-known member
I have a prpbelam when use an enemy first like a boss and next like a regular enemy in future stages.
Because when is a boss if use lifebarstatus, can't use again the same enemy for regular enemy. So need to create a copy of this enemy, without the lifebarstatus.
So searching info about this, I found the script lifebar for bosses in the Crime Buster mod for BloodBane.
I try to use in my mod but not work, the icon and the bar never shows.
Here the files:
The lifebar script:
The lifebar entity:
And the set in spawn level:
There two problems here:
1 - Like said before, , the icon and the bar never shows.
2 - When use this line "spawnscript data/scripts/lifebar.c" in the spawn level,
the character not spawn using ANI_follow12. I don't understand why.
Because when is a boss if use lifebarstatus, can't use again the same enemy for regular enemy. So need to create a copy of this enemy, without the lifebarstatus.
So searching info about this, I found the script lifebar for bosses in the Crime Buster mod for BloodBane.
I try to use in my mod but not work, the icon and the bar never shows.
Here the files:
The lifebar script:
Code:
// Lifebar display script
void main()
{
void self = getlocalvar("self"); //Get calling entity.
void vSpawn; //Spawn object.
int vAlias = getentityproperty(self, "name");
int iHealth = getentityproperty(self, "health");
int iHPMax = getentityproperty(self, "maxhealth"); // Get entity's maximum health
clearspawnentry(); //Clear current spawn entry.
setspawnentry("name", "Lifebar"); //Set Lifebar as spawned entity.
vSpawn = spawn(); //Spawn in entity.
changeentityproperty(vSpawn, "parent", self); //Set caller as parent.
changeentityproperty(vSpawn, "name", vAlias); //Set name.
changeentityproperty(vSpawn, "health", iHealth); //Set health.
changeentityproperty(vSpawn, "maxhealth", iHPMax); // Set maxhealth.
}
The lifebar entity:
Code:
name Lifebar
health 1
type none
shadow 0
icon data/chars/misc/lbaricon.png
lifebarstatus 400 8 1 1 0 -9999 -9999 -9999 -9999
iconposition -12 235
lifeposition 35 260
nameposition -9999 -9999
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 != NULL()){ //Have parent?
int HParent = getentityproperty(Parent, "health"); // Get parent's health
changeentityproperty(self, "health", HParent); // Use parent's health
}
if (Health <= 0){ // Health = 0?
killentity(self); // Suicide
}
@end_script
loop 1
delay 2
offset 1 1
frame data/chars/misc/empty.png
anim fall
delay 100
offset 1 1
frame data/chars/misc/empty.png
And the set in spawn level:
Code:
spawn bomberman2
spawnscript data/scripts/lifebar.c
alias bomberman
@script
void main() {
performattack(getlocalvar("self"), openborconstant
("ANI_follow12"));
} @end_script
2phealth 500
3phealth 600
item bosser
coords -150 270 0
flip 1
at 1645
There two problems here:
1 - Like said before, , the icon and the bar never shows.
2 - When use this line "spawnscript data/scripts/lifebar.c" in the spawn level,
the character not spawn using ANI_follow12. I don't understand why.
Last edited: