Jump to content

Photo

Disabling "End Game"


  • Please log in to reply
12 replies to this topic

#1 Korben

Korben

    Initiate

  • Members
  • Gender:Unspecified
  • Location:USA

Posted 22 February 2018 - 01:03 PM

Is there any way to disable the "End Game" function, but then still allow the player to save when they die (Or at least save somehow)?



#2 Russ

Russ

    Caelan, the Encouraging

  • Administrators
  • Gender:Male
  • Location:Washington

Posted 22 February 2018 - 05:05 PM

The only way to disable the F6 end game function is to check the quest rule that goes straight back to the main menu when you use F6 or die. I'd highly recommend against this, however, as you'd need to use save points and you would lose any progress on dying.

Edit: "Against" is an important word to forget.
  • Lightwulf likes this

#3 Korben

Korben

    Initiate

  • Members
  • Gender:Unspecified
  • Location:USA

Posted 22 February 2018 - 07:04 PM

Yeah, I tried that before and I agree, it wouldn't work well. I'm trying to link d-maps together without the player being able to go from d-map 1 by teleporting. For example say you work your way through d-map 1, then to 2, then to 3, I don't want the player to be able to get back to 1 from 3 by simply clicking "end game" and then continue, warping them back to the first screen of d-map 3, walking one screen to d-map 2, ending game again and warping to the first screen of d-map 2, then just walking into d-map 1. I want them to have to walk from d-map 3, through 2, and end up back in one. I hope I explained that well. Is there any way to do that and still be able to save normally?



#4 Avataro

Avataro

    Quest maker

  • Members
  • Real Name:Robin
  • Gender:Male
  • Location:Germany

Posted 23 February 2018 - 07:08 AM

No you won't be able to save normally, but there is a save point combo type. Just like russ said its gonna make dying punishing.


Edited by Avataro, 23 February 2018 - 07:08 AM.


#5 ZoriaRPG

ZoriaRPG

    The Timelord

  • ZC Developers
  • Gender:Unspecified
  • Location:Prydon Academy

Posted 23 February 2018 - 07:38 AM

Err, I could give you a simple script that allows saving on death before exiting the game, if you want that option. It's compatible with the No-F6 quest format.

#6 ZoriaRPG

ZoriaRPG

    The Timelord

  • ZC Developers
  • Gender:Unspecified
  • Location:Prydon Academy

Posted 23 February 2018 - 08:02 AM


It would look somewhat like this:

https://pastebin.com/NV2uc6vP

#7 Alucard648

Alucard648

    Adept

  • Members
  • Gender:Male
  • Location:castle Dracula

Posted 23 February 2018 - 08:31 AM

What about adding +1 to death counter and auto-saving on any F6? Wasted that valuable potion or superbomb? Mwahahaha!  :superevil:  


Edited by Alucard648, 23 February 2018 - 08:31 AM.


#8 Dimentio

Dimentio

    Procrastinator at heart

  • Members
  • Real Name:Joshua
  • Gender:Male
  • Location:America's Hat.

Posted 23 February 2018 - 09:32 AM

No, you cannot disable the end times. The coming entropy apocalypse cannot be stopped. We are helpless to stop the death of everything. 


  • Jared and Lightwulf like this

#9 ZoriaRPG

ZoriaRPG

    The Timelord

  • ZC Developers
  • Gender:Unspecified
  • Location:Prydon Academy

Posted 23 February 2018 - 09:41 AM

I did forget to increase the death counter. I'll remedy that in the finished version. For the present, here is an update:


https://pastebin.com/jYaxutzX

I changed the hardcoded Link sprites to use a sparkle lweapon. I'll need to set the first weapon to loop a few times, so that it doesn't waste tile space. I think that I can reset its deadstate to accomplish this.

Next, to-do: Complete string and cursor menu code.

#10 Korben

Korben

    Initiate

  • Members
  • Gender:Unspecified
  • Location:USA

Posted 23 February 2018 - 10:30 AM

Thanks for the help everyone. I'll definitely check out the script Zoria, thanks.



#11 ZoriaRPG

ZoriaRPG

    The Timelord

  • ZC Developers
  • Gender:Unspecified
  • Location:Prydon Academy

Posted 24 October 2018 - 05:52 AM

Thanks for the help everyone. I'll definitely check out the script Zoria, thanks.

 
 
Demo File
 
 
///////////////////////////////
/// Custom Game Over Screen ///
/// v1.2 for ZC 2.50.x      ///
/// 24th October, 2018      ///
/// By: ZoriaRPG            ///
//////////////////////////////////////
/// Requested by: Korben on PureZC ///
//////////////////////////////////////

import "std.zh"

// Sounds and MIDIs
const int SFX_WINKOUT 			= 38; //Sound to play during wink-out animation.
const int SFX_LINKDEATH 		= 28; //Sound to play when Link dies.
const int SFX_GAMEOVERSCREEN_CURSOR 	= 6;  //Sound to play when the player moves the game over cursor.
const int SFX_GAMEOVERSCREEN_SELECTION 	= 44; //Sound to play when the user selects a game over menu option.
const int MIDI_GAMEOVER 		= -4; //MIDI to play on Game Over screen.
	//Defaults: -3 is the internal Game Over, -2 is Level 9, -1 is Overworld
 
// Sprites (Weapons/Misc)
const int SPR_DEATH 		= 88; //Sprite of Link Spinning
const int SPR_DEATH_WINKOUT 	= 89; //Sprite of wink-out
// Sprite Timing
const int END_DEATH_SPIN 	= 40; //Frames to display death spin animation.
const int END_WINKOUT 		= 10; //Frames to display wink-out animation.

// Other Graphics and Colours
const int TILE_SAVECURSOR 	= 20;
const int TILE_SAVECURSOR_CSET 	= 1;    //CSet for minitile cursor. 
const int _COL_BLACK 		= 0x0F; //Black in the current palette
const int _COL_RED 		= 0x93; //Red in the current palette
const int _COL_WHITE 		= 0x01; //White in the current palette

// Menu Object Positions and Settings
const int DONT_SAVE_X 		= 102; //X position of the RETRY string.
const int SAVE_X 		= 102; //X position of the SAVE string.
const int DONT_SAVE_Y 		= 68;  //Y position of the RETRY string.
const int SAVE_Y 		= 54;  //X position of the SAVE string.
const int CURSOR_OFFSET 	= 26;  //X offset of the cursor from the text. 

//Global Variables and Arrays
int gameover[8] = {1,SAVE_Y,DONT_SAVE_Y, 0,0};
//Indices for gameover[]
const int MENU_SEL_STATE 	= 0; //The current selected menu option. 
const int MENU_SEL_POS_X 	= 1; //Stores where to draw menu selector.
const int MENU_SEL_POS_Y 	= 2; //Stores where to draw menu selector.
const int DEATH_LX 		= 3; //Cache of Link's last X position before death.
const int DEATH_LY 		= 4; //Cache of Link's last Y position before death.
const int DEATHFRAME 		= 5; //Timer for death animations. 
const int QUIT 			= 6; //The game 'QUIT' type, SAVE or RETRY


//Quit Types
const int quitSAVE = 1;
const int quitRETRY = 2;






global script noF6
{
	void run()
	{
		while(true)
		{
			//Normal pre-waitdraw functions go here.
		
			//UpdateGhostZH1();
			
			//Put any health refull code above this!
			//Run the check to see if Link is dying...
			if ( do_link_death_check() ) break; //LAST before Waitdraw()
			Waitdraw(); 
			
			//Normal post-waitdraw functions go here. 
	       
			//UpdateGhostZH2();
			
			Waitframe();
		}
		while(!gameover[QUIT])
		{
			//gameover[DEATH_LX] = Link->X;
			//gameover[DEATH_LY] = Link->Y;
			//Set game music to a silent MIDI.

			Link->HP = Link->MaxHP;
			Link->Invisible = true;
			Link->CollDetection = false;
			//Clean up screen objects
			clean_up_all_screen_objects();
			//Do Link Death animation
			do_death_animation();
			
			bool menu = true;
			Game->PlayMIDI(MIDI_GAMEOVER);//Play game over midi.
				
			while(menu) //menu loop
			{
				Link->PressStart = false; //No active subscreen for 2.50
				Link->InputStart = false;
		
				//    GAME OVER SCREEN
				draw_game_over_menu();
				menu = do_game_over_menu_choice();
				Waitdraw();
				Waitframe();
			}
			Waitdraw(); Waitframe();
		}
		if ( gameover[QUIT] == quitSAVE )
		{
			++Game->NumDeaths;
			Game->Save();
			Game->End();
		}
		else Game->End(); //Retry
	}
	bool do_link_death_check()
	{
		if ( Link->HP < 1 ) 
		{
			Link->HP = 1;
			Link->Invisible = true;
			Link->CollDetection = false;
			gameover[DEATH_LX] = Link->X;
			gameover[DEATH_LY] = Link->Y;
			return true;
		}
		return false;
	}
	void clean_up_all_screen_objects()
	{
		int q;
		if ( Screen->NumNPCs() )
		{
			for ( q = Screen->NumNPCs(); q > 0; --q ) 
			{ 
				npc n = Screen->LoadNPC(q); Remove(n); 
			}
		}
		if ( Screen->NumLWeapons() )
		{
			for ( q = Screen->NumLWeapons(); q > 0; --q ) 
			{ lweapon n = Screen->LoadLWeapon(q); Remove(n); }
		}
		if ( Screen->NumEWeapons() )
		{
			for ( q = Screen->NumEWeapons(); q > 0; --q ) 
			{ eweapon n = Screen->LoadEWeapon(q); Remove(n); }
		}
		if ( Screen->NumItems() )
		{
			for ( q = Screen->NumItems(); q > 0; --q ) 
			{ item n = Screen->LoadItem(q); Remove(n); }
		}
		//clear all ffcs
		for ( q = 1; q < 33; ++q )
		{
			ffc f = Screen->LoadFFC(q);
			f->Data = 0; f->Script = 0;
		}
	}
	void draw_game_over_menu()
	{
		int sv[]="SAVE";
		int dsv[]="RETRY";
		//Draw black background with Rectangle()
		Screen->Rectangle(5,0,0,256,256,_COL_BLACK,100, 0,0,0,true,128);

		if ( gameover[MENU_SEL_STATE] )
		{
			//int ss1[]="Drawing cursor and text.";
			//TraceS(ss1);
			Screen->FastTile(6,SAVE_X-CURSOR_OFFSET, SAVE_Y, TILE_SAVECURSOR, TILE_SAVECURSOR_CSET,128); 
			//draw strings, red for selected
			Screen->DrawString(6,SAVE_X,SAVE_Y,0,_COL_RED, -1,0,sv,128);
			Screen->DrawString(6,DONT_SAVE_X,DONT_SAVE_Y,0,_COL_WHITE, -1,0,dsv,128);
		}
		else
		{
			//Draw cursor
			Screen->FastTile(6,DONT_SAVE_X-CURSOR_OFFSET, DONT_SAVE_Y, TILE_SAVECURSOR, TILE_SAVECURSOR_CSET,128); 
			//draw strings, red for selected
			Screen->DrawString(6,SAVE_X,SAVE_Y,0,_COL_WHITE, -1,0,sv,128);
			Screen->DrawString(6,DONT_SAVE_X,DONT_SAVE_Y,0,_COL_RED, -1,0,dsv,128);
		}
	}
	bool do_game_over_menu_choice()
	{
		if ( Link->PressDown || Link->PressUp )
		{
			gameover[MENU_SEL_STATE] = Cond(gameover[MENU_SEL_STATE],0,1);
			Game->PlaySound(SFX_GAMEOVERSCREEN_CURSOR);
			return true;
		}
		//Screw it. This is why I added a way to disable the active subscreen to 2.55
		//Global scripts DO NOT LIKE to block the active subscreen!
		//if ( Link->PressStart )
		if ( Link->PressA || Link->PressB )
		{
			//Link->PressStart = false; 
			//Link->InputStart = false;
			Game->PlaySound(SFX_GAMEOVERSCREEN_SELECTION);
			if ( gameover[MENU_SEL_STATE] ) gameover[QUIT] = quitSAVE;
			else gameover[QUIT] = quitRETRY; //no save
			return false;
		}
		return true;
	}
	void do_death_animation()
	{
	if ( gameover[DEATHFRAME] == 0 ) Game->PlaySound(SFX_LINKDEATH);
		lweapon death = Screen->CreateLWeapon(LW_SPARKLE);
		
		death->UseSprite(SPR_DEATH);
		death->X = gameover[DEATH_LX];
		death->Y = gameover[DEATH_LY];

		while ( gameover[DEATHFRAME] < END_DEATH_SPIN )
		{
			++gameover[DEATHFRAME];
			//spin Link around by drawing his tiles, then make the wink out.
			NoAction(); Waitdraw(); Waitframe();
		}
		Remove(death);
		Game->PlaySound(SFX_WINKOUT);
		lweapon death2 = Screen->CreateLWeapon(LW_SPARKLE);
		death2->UseSprite(SPR_DEATH_WINKOUT);
		death2->X = gameover[DEATH_LX];
		death2->Y = gameover[DEATH_LY];
		while ( gameover[DEATHFRAME] < END_DEATH_SPIN+END_WINKOUT )
		{
			++gameover[DEATHFRAME];
			//wink-out
			NoAction();  Waitdraw(); Waitframe();
		}
		Remove(death2);
	}
}


#12 ZoriaRPG

ZoriaRPG

    The Timelord

  • ZC Developers
  • Gender:Unspecified
  • Location:Prydon Academy

Posted 24 October 2018 - 10:52 AM

For whatever it is worth, I also made an expanded version in 2.55, with a fully-scripted F6 Screen.

 

On pressing F6, you see this:

scripted_f6.png

 

Note that the quest has the No F6 rule enabled, but you can still read the F6 key with scripts. :D

 

If the player dies, they instead, see this:

scripted_gameover.png

 

You can view the script for this if you are curious; or download a demo quest for it.

 

It requires ZC Necromancer (2.55 Alpha 1-p16, or The 2018 PureZC Fall Expo Build or later) to play.


  • Jared likes this

#13 NoeL

NoeL

    Remilia looks better with grey/green hair.

  • Members
  • Real Name:Jerram
  • Gender:Male

Posted 24 October 2018 - 05:35 PM

Maybe I'm mistaken, but can't this be done with screen flags of some sort (I'd have to jump into ZC and check it out)? I think you can set ZC to remember the room you entered the dmap on and set the continue spot there, so walking from dmap 3 to dmap 2 then F6-ing out would have them continue at the end of dmap 2 rather than the beginning. Again, I could be wrong here.




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users