Disable life bars

Need help with using DizzyAGE then look here
Post Reply
Kalle Neumann
Your Backpack is Empty
Posts: 14
Joined: Sat Jan 18, 2020 5:16 pm

Disable life bars

Post by Kalle Neumann » Sat Jan 25, 2020 7:56 pm

Hello and good evening everyone.

2 questions:
I am currently considering how it would be possible to deactivate Dizzy for messages and to make them appear again after MessagePop.
I suspect the command PlayerSet (P_DISABLE, 0); plays a big role. I also think it should be added to the messages.gs file in the message preferences. Hmm ... but with which command line?
Furthermore, I do not want the well-intentioned life announcement. Is it enough if I delete these lines from handlers.gs?

Code: Select all

// lifebar
	lifeid = 2; // life tile
	w = 55*PlayerGet(P_LIFE)/100;
	h = 6;
	HudDrawTile( lifeid, 152, 5, w, h, 0, 0, w, h, 0, 0 );
Or is that too easy for me? :v2_dizzy_confused2:
That’s it for today.

Best regards

Kalle
Last edited by Kalle Neumann on Mon Jan 27, 2020 10:39 am, edited 1 time in total.

Grandad
Hard Boiled Egg
Posts: 1544
Joined: Sat Aug 08, 2009 10:47 am
Location: Balham - gateway to the south

Re: Disable life bars and dizzy on messages

Post by Grandad » Sun Jan 26, 2020 9:50 am

Not really sure what you're on about Kalle.

1) The game pauses whenever a message appears on screen. MessagePop restarts the game. If you want messages to reappear you have to open a new message before using the command 'return' (which ends the function without reading any further commands in that particular function).

if you mean make Dizzy vanish when a message appears on screen and reappear when you press MessagePop then you're right in using the disable command:

Message0 (4,4, "\"You're a big fat plonker\"");
PlayerSet(P_DISABLE, 1);
MessagePop();
PlayerSet(P_DISABLE, 0);

I don't really know to manipulate the Message.gs file to ensure that Dizzy vanishes just as each message starts. Personally, if I want to use a message to hide Dizzy I just change the the numbers at the start of the message - first number is screen width position, second is screen height position.

2) the coding you show only disables the 'health bar' picture that goes down when Dizzy gets hurt. The 'death' message is in the PlayerDeathMessage (death) is near the start of the Game.gs file. I've never felt the need to disable the death message, so it's something I've never tried to do. Sorry.

Kalle Neumann
Your Backpack is Empty
Posts: 14
Joined: Sat Jan 18, 2020 5:16 pm

Re: Disable life bars and dizzy on messages

Post by Kalle Neumann » Sun Jan 26, 2020 7:00 pm

Good evening Grandad,
Thanks for your quick reply. :)
I simply inserted the "PlayerSet" before and after the Message1 template. It works fine.

Code: Select all


/////////////////////////////////////////////////////////////////////////////////
// IN: int; x; horizontal coordinate in characters, multiple of 8 pixels
// IN: int; y; vertical coordinate in characters, multiple of 8 pixels
// IN: str; text; message text
// quick call for Message() with player color settings
/////////////////////////////////////////////////////////////////////////////////
func Message1( x, y, text )
{
	PlayerSet(P_DISABLE, 1);
	Message( x, y, text, COLOR_MAGENTA, COLOR_GREEN ); //dizzy speak
	PlayerSet(P_DISABLE, 0);
}

Ohhje. then google translated incorrectly. It is of course about the 'health bar'. I would like to deactivate it. Dizzy is said to traditionally die. hit = dead. So I don't need the hurt function. For that it would be good to know how I realize that Dizzy dies immediately with every hit. He is currently rolling to the end before the death message appears. I've seen a post on this topic here in the forum - but can't find it anymore.
Maybe someone can help me?

Best regards

Kalle

User avatar
Noggin the Nog
Hard Boiled Egg
Posts: 437
Joined: Sun Jul 01, 2012 12:04 am

Re: Disable life bars and dizzy on messages

Post by Noggin the Nog » Sun Jan 26, 2020 10:21 pm

Hi Kalle,

I'm not sure I understand your questions either, but I'll do my best. :)

If you want to remove the death message, you can just delete if from PlayerDeathMessage, leaving the quotation marks:

Code: Select all

func PlayerDeathMessage( death )
{
	if(death==-1)					return "";
	// ...
	return "";		// default
}
Are you thinking of having Dizzy die like in Dizzy I? Where he flies apart every time he touches a bird? That would mean changing functions in the handlers.gs and player.gs files.

Kalle Neumann
Your Backpack is Empty
Posts: 14
Joined: Sat Jan 18, 2020 5:16 pm

Re: Disable life bars

Post by Kalle Neumann » Mon Jan 27, 2020 11:21 am

Hello everybody,
hi noggin the nog,

I presumably described my question incorrectly.
I do not want to delete the death messages. I want to disable the energy bar and its function. I don't need it. :say_no:
Are you thinking of having Dizzy die like in Dizzy I? Where he flies apart every time he touches a bird? That would mean changing functions in the handlers.gs and player.gs files.
Yes, that's exactly what I'm trying to do. :tup:
I have already created the death animation (Dizzy's body shrinks).
I think that the flying arms and legs have to be coded with x-y coordinates / player position / room position. The same then mirrored in the respawn. Has this been implemented in a DizzyAGE game so far? :v2_dizzy_confused3:

Best regards

Kalle

Grandad
Hard Boiled Egg
Posts: 1544
Joined: Sat Aug 08, 2009 10:47 am
Location: Balham - gateway to the south

Re: Disable life bars

Post by Grandad » Mon Jan 27, 2020 12:57 pm

If you disable the health bar Kalle, then you'll also need to amend or make a new hud tile otherwise you'll just have a black space where the health bar used to be.

The health bar is activated by objects having a class of 'hurt'. As long as the class is ''klil' Dizzy will die whenever activated by an action or collision.

The easiest way to have your own 'death' tile is to make it animated and just swap it with the tile '15 Diz_dead' (or what the number of the death define is in the 'def,gs' file) as when Dizzy dies, the game plays the 'death' tile once from frame 0 to the last frame and then pauses for a bit before respawning, so there's no need to start faffing around with setting coordinates if the tile is properly animated.

Kalle Neumann
Your Backpack is Empty
Posts: 14
Joined: Sat Jan 18, 2020 5:16 pm

Re: Disable life bars

Post by Kalle Neumann » Mon Jan 27, 2020 9:09 pm

Good evening and hello Grandad.

I tried to implement your suggestion. The death animation works just fine. Unfortunately, the position is different.
I drew Dizzy's body in the middle of the animation template.tga and in 4 directions (beam-shaped) arms and legs. A total of 26 pictures. In theory, dizzy's body should be at the bottom of the animation template. Or the dead-animation coordinates have to be changed.
Do you have any idea? :v2_dizzy_confused2:

Best regards

Kalle

User avatar
Noggin the Nog
Hard Boiled Egg
Posts: 437
Joined: Sun Jul 01, 2012 12:04 am

Re: Disable life bars

Post by Noggin the Nog » Mon Jan 27, 2020 9:46 pm

Kalle Neumann wrote:
Mon Jan 27, 2020 11:21 am
Are you thinking of having Dizzy die like in Dizzy I? Where he flies apart every time he touches a bird? That would mean changing functions in the handlers.gs and player.gs files.
Yes, that's exactly what I'm trying to do. :tup:
I have already created the death animation (Dizzy's body shrinks).
I think that the flying arms and legs have to be coded with x-y coordinates / player position / room position. The same then mirrored in the respawn. Has this been implemented in a DizzyAGE game so far? :v2_dizzy_confused3:

Best regards

Kalle
There is a remake of Dizzy I on yolkfolk.com. The best thing would be to look at the code in that.

But I can help you with one thing. To make Dizzy die instantly, find this part of HandlerPlayerUpdate()

Code: Select all

// Check Player must die
	if(PlayerGet(P_LIFE)<0) PlayerSet(P_LIFE,0);

	if(PlayerGet(P_LIFE)<=0 && PlayerGet(P_STATUS)!=STATUS_SCRIPTED)
		if( (PlayerGet(P_MATCENTER)==MAT_WATER) || PlayerGet(P_STATUS)==STATUS_IDLE ) // only if in water or in idle
		{
			if(PlayerGet(P_MATCENTER)==MAT_WATER)
				ScrRequest( gs_fid("PlayerPlayDeadWater") );
			else
				ScrRequest( gs_fid("PlayerPlayDead") );
		}
...and delete everything except this:

Code: Select all

// Check Player must die
	if(PlayerGet(P_LIFE)<0) PlayerSet(P_LIFE,0);

	if(PlayerGet(P_LIFE)<=0 && PlayerGet(P_STATUS)!=STATUS_SCRIPTED)
		
			ScrRequest( gs_fid("PlayerPlayDead") );
The only problem would be if you wanted to have water play in your game - I've deleted the bit that makes Dizzy drown.

Grandad
Hard Boiled Egg
Posts: 1544
Joined: Sat Aug 08, 2009 10:47 am
Location: Balham - gateway to the south

Re: Disable life bars

Post by Grandad » Tue Jan 28, 2020 8:40 am

Kalle, you will have to faff around changing coordinates when implementing Simon's suggestion for killing Dizzy instantly and displaying the new tile. But then again that would only work for being killed in the air - you can't have his legs disappear into the ground, so you would also have to set different coordinates so that all 'death' situations are covered.

Personally I think it's far too complicated and think it would much easier to do something like other games where he turns into a fried egg, or exploding, or something where you don't have various bits going off in all directions. But, it's your game, so it's also your choice. So good luck on whatever method you try to implement :v2_dizzy_cheers:

Kalle Neumann
Your Backpack is Empty
Posts: 14
Joined: Sat Jan 18, 2020 5:16 pm

Re: Disable life bars

Post by Kalle Neumann » Thu Jan 30, 2020 4:18 pm

Hello Hello,
I have replaced the lines of code and that works with the immediate die.
I spent half a day opening several games to see if my death variant was included. Then I finally found the game of PeterTeal "Dizzy Tuca" with great joy. Password protected. Annoying :umm:
Anyway, I will continue to concentrate on the level design and the puzzles. Thank you for your help so far. :v2_dizzy_cheers:

Best regards

Kalle

Post Reply