Disabling/Changin Icon

O Ilusionista

Captain 100K
I want to remove the lifebar,name and icon from a player on a specific stage.

What I've tried:
-To set the stage as bonus (type 2), no good
- Use nolife1 and other in the character header
nolife 1
lifebarstatus 320 5 0 1 0 1 1 1 1
lifeposition 80 202
nameposition 81 193
iconposition 61 193
ANSeX2W.png


But the default lifebar still shows up.

Then I tried to use script:
Code:
	void self = getlocalvar("self");
	changeentityproperty(self, "iconposition", 500,900);
But nothing works. Even if I use the script as updatescript/ondrawscript.

Is ICONPOSITION a read-only property?
Any ideas of how to do it?
 
I have resolved this issue for apescott using a weapon change on spawn !


Code:
void wcheck()
{//check if weapon change needed and update hp

void self = getlocalvar("self"); //get self
char model = getentityproperty(self,"defaultname"); //original name
char name = getentityproperty(self,"name"); //get current name
changeentityproperty(self,"name",model); //revert to original name
int maxhp = getentityproperty(self,"maxhealth");//get max health
int weapon = 0; //weapon to change to 0 is default (no weapon)


if(maxhp == 25)      { weapon=1;
} else if (maxhp == 35) { weapon=2;
} else if (maxhp == 45) { weapon=3;
} else if (maxhp == 60) { weapon=4;
} else if (maxhp == 75) { weapon=5;} //more weapons can be added if needed


 changeentityproperty(self, "weapon", weapon); //change weapon
 changeentityproperty(self,"maxhealth",maxhp); //update max hp
 changeentityproperty(self,"health",maxhp); //update hp


 if(strinfirst(name, "ANI_")!= -1){ //if name includes a animation change
 changeentityproperty(self, "animation", openborconstant(name)); //Change the animation
 }
}



this code needs to be modified a bit and this will not work for mods that use weapons. remember to update hp using code as the weapon switch will mess up your hp (well it did in my tests).  Normally I would weapon change based on name when spawned but for this example the name will make the enemy show a custom spawn animation and the life will change the weapon model to show icon with alters size to fit life.


also a important thing is the weapon model does not need much data as everything is copied from the main model here is a weapon used in apescott's final fight mod.


Code:
name   Bred25_1
health   25
weaploss 3
icon   data/chars/bred/icon_25.gif
icondie   data/chars/bred/icon_25.gif



only real change was the icon file !


For you Ilu you could just use something like "setweap 1" for this one stage !


 
my example:

Code:
name   Bred25_1
health   25
weaploss 3
icon   data/chars/bred/icon_25.gif
icondie  data/chars/bred/icon_25.gif

is a fully working weapon model just 5 lines and done everything else is copied from the main character model automatically.
 
Hi @msmalik681, I wish to hide lifebar and mpbar too when I'm on a worldmap for example. Using weapon model is the only way to hide it?
Can you share a simple code line for activating this?
I wrote something like this in anim spawn:
Code:
@script
  if(frame==1){
    void self = getlocalvar("self");

    changeentityproperty(self, "weapon",1,0);
  }
@end_script
I will try your method :).
 
Last edited:
I want to remove the lifebar,name and icon from a player on a specific stage.

What I've tried:
-To set the stage as bonus (type 2), no good
- Use nolife1 and other in the character header

ANSeX2W.png


But the default lifebar still shows up.

Then I tried to use script:
Code:
    void self = getlocalvar("self");
    changeentityproperty(self, "iconposition", 500,900);
But nothing works. Even if I use the script as updatescript/ondrawscript.

Is ICONPOSITION a read-only property?
Any ideas of how to do it?
As a suggestion, you can change layer values for the entire level sprites and change all entity's layers with script only in this level.
In the example below I covered all hud by using an black image and adjusted Axel's layer with scripts. It works with "drawsprite" function too.

Code:
fglayer        data/sprites/back2.gif             1000000001 1 1 0 -120 0 0 -1 1 1 2

Code:
changeentityproperty(self, "setlayer", 10000000002);

wjmyEOm.png
 
I used in the level
Code:
type 2
(thanks @NickyP for pointing me that) which removes efficiently the lifebar and mpbar. This is great for cutscenes and worldmap but it's applied to the whole level.
Thanks @Kratus for your method too, I like this kind of trick :) .
 
Back
Top Bottom