Page 1 of 1
Using 2 different status bars for 2 different player classes
Posted: Sat Jun 01, 2024 9:21 am
by IBA
Hello, I tried googling and reading on this forum and couldn’t find what I was hoping to get an answer to.
I have 2 player classes in my wad that you could choose to play as, if I wanted player class 1 to have a different status bar than player class 2 is that even possible? And if so how would I go about it?
Re: Using 2 different status bars for 2 different player classes
Posted: Sat Jun 01, 2024 2:20 pm
by Jarewill
How is your status bar written?
If you used SBARINFO, you will have to use a PlayerClass / PlayerType command to start a new block and put your status bar there, for example like this:
Code: Select all
PlayerType Player1
{
DrawImage "SHOTA0", 100, 100;
}
Else PlayerType Player2
{
DrawImage "SGN2A0", 200, 100;
}
If you used ZScript, you can just check if the player's class is the one you want and draw the status bar, like this:
Code: Select all
If(CPlayer.mo is "Player1"){Draw();}
Else If(CPlayer.mo is "Player2"){DrawOther();}
Now if you just have 2 player classes, then you don't need the second check and can just use Else, I put it there for the sake of completeness.
Re: Using 2 different status bars for 2 different player classes
Posted: Tue Jun 04, 2024 8:38 am
by peewee_RotA
The hexen status bar changes elements based on class. It's a good guide to follow:
https://github.com/ZDoom/gzdoom/blob/46 ... ar.zs#L113