How to hide HUD for map stage

  • Thread starter Thread starter utunnels
  • Start date Start date
U

utunnels

Guest
This is a note than a tut because the old topic got buried when lavalit was closed.

Using type 2 in a level txt will skip HUD logic and most game over logic, you'll need an end level item or jumptobranch script to exit the level.

 
that's wonderful news for me, but it seems to have some problems with "level-up" and "hp/mp in numbers" scripts. take a look at the attached file. any clues?

[attachment deleted by admin]
 
It seems those are drawn by script. You need to add some flags for those maps.

if(!someflag)
{

    //your draw logic

}
 
i think i understand the logic:

if somelevel.txt has type 2 - then hide numbers

but i don't have any clues to how to implement it.  :-\
 
There are many ways. The most direct way requies an engine update to support type as level property. But you can still manually check other unique properties in those levels, or you can setglobalvar in level script then remove them in endlevelscript.



In your case, your character suse weapon travel in map stage, so you can check model name.

if("travel"!=getentityproperty(self, "model"))
{
     
}


You need to do that in both update.c and lvup.c, one for drawstring, the other for settextobj.
 
I would like to hide HUD and make it appear only when character dies so probably with script in his death animation, is type 2 accesible to script to change it like that?
 
Well type 2 is not designed to hide HUD, it is a blank level with no game over logic. So even if you can change, you game may become unplayable.

You can just script your own hud logic if you want a completely different look.
 
@bWWd - I'm using an updatescript for HUD, it checks if player exists then runs the script to setup the hud. 

You could just reverse the logic of this script and if player exists do nothing, else display the hud.  Then you just hide the default HUD offscreen by changing offsets.

example
Code:
void main()
{   	
//
    void p1 = getplayerproperty(0, "entity");
    //void p2 = getplayerproperty(1, "entity");
    //void p3 = getplayerproperty(2, "entity");
    //void p4 = getplayerproperty(3, "entity");
	//added
	int player = getlocalvar("player");
	void self = getplayerproperty(player, "ent");
	void self = getlocalvar("self");
	void target = getentityproperty(self, "opponent");
	

      
//HUD script player 1
    if(getentityproperty(p1, "exists")) {
        drawsprite(getglobalvar("hud01"), 0, 220, 1500, 0);
				
    }
  
	
	
    //if(getentityproperty(p2, "exists")) {
    //}

//    if(getentityproperty(p3, "exists")) {

//    }

//    if(getentityproperty(p4, "exists")) {

//    }



}
 
Back
Top Bottom