Jump to content

Photo

When Link dies it skips death animation script request


  • Please log in to reply
17 replies to this topic

#1 TheRock

TheRock

    Go glitches

  • Members
  • Gender:Male

Posted 20 November 2019 - 03:58 PM

I would like a script that does this: When Link dies it skips the death animation. In other words when Link dies it's like he pressed f6. 

Thanks in advance!



#2 venrob

venrob

    Scripter / Dev

  • ZC Developers
  • Real Name:Rob
  • Gender:Male

Posted 20 November 2019 - 04:19 PM

What version of ZC. This MUST be mentioned for all requests.

Also, this should be in the 'Script Requests' forum, not the 'Scripting Discussion' forum.

#3 TheRock

TheRock

    Go glitches

  • Members
  • Gender:Male

Posted 20 November 2019 - 06:44 PM

What version of ZC. This MUST be mentioned for all requests.

Also, this should be in the 'Script Requests' forum, not the 'Scripting Discussion' forum.

Ooops! My bad! 2.50.2



#4 venrob

venrob

    Scripter / Dev

  • ZC Developers
  • Real Name:Rob
  • Gender:Male

Posted 20 November 2019 - 06:53 PM

Firstly, 2.50.2 is an unsupported version. Update to AT LEAST 2.53.0R2, if not 2.53.1 beta or 2.55 alpha. zeldaclassic.com has the downloads.
Secondly, this would be far easier in the 2.55 alphas would make this far easier, because you can make custom F6 scripts, and onDeath scripts.

#5 TheRock

TheRock

    Go glitches

  • Members
  • Gender:Male

Posted 20 November 2019 - 06:59 PM

Firstly, 2.50.2 is an unsupported version. Update to AT LEAST 2.53.0R2, if not 2.53.1 beta or 2.55 alpha. zeldaclassic.com has the downloads.
Secondly, this would be far easier in the 2.55 alphas would make this far easier, because you can make custom F6 scripts, and onDeath scripts.

If that is the case then I will update to version 2.55 alphas. 



#6 Dimentio

Dimentio

    P-put me down!

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

Posted 20 November 2019 - 07:06 PM

Really? It seems pretty easy to do.
 

void DeathSkip()
{
	if (Link->HP <= 0)
	{
		Game->ShowSaveQuitScreen();
		Link->Warp(Game->LastEntranceDMap, Game->LastEntranceScreen);
		Link->HP = Link->MaxHP;
		Game->NumDeaths++;
	}
}

Untested, but it *should* work. Stick that function in your global script; either experiment before or after Waitdraw, or put it in both. Let me know if it doesn't work as intended.


  • TheRock likes this

#7 TheRock

TheRock

    Go glitches

  • Members
  • Gender:Male

Posted 20 November 2019 - 07:19 PM

Thanks a bunch! It works great! But I want you to be able to continue or save. Other then that it works great!



#8 venrob

venrob

    Scripter / Dev

  • ZC Developers
  • Real Name:Rob
  • Gender:Male

Posted 20 November 2019 - 07:23 PM

I'll post a 2.55 version with more options when I get home

#9 TheRock

TheRock

    Go glitches

  • Members
  • Gender:Male

Posted 20 November 2019 - 07:45 PM

All right! it works great! I just had to change the Game->NumDeaths++; to be at the top and Game->ShowSaveQuitScreen(); to Game->ShowSaveScreen(); Here's what the code looks like now for those who would want to use it.

global script slot2 {
void run() {
while (true) {

	if (Link->HP <= 0)
	{


		Game->NumDeaths++;
		Game->ShowSaveScreen();
		Link->Warp(Game->LastEntranceDMap, Game->LastEntranceScreen);
		Link->HP = Link->MaxHP;
		
	}
   Waitframe();
}
}
}

  • Dimentio likes this

#10 venrob

venrob

    Scripter / Dev

  • ZC Developers
  • Real Name:Rob
  • Gender:Male

Posted 20 November 2019 - 07:48 PM

The only 2 issues with this are, really:
1. Could interfere with a 'fairy in a bottle' script, unless you set the timing up right
2. Requires merging your global script

Given, in 2.50.2/2.53.x, this is the best you can do. 2.55 can do better though, so I'll see what fancy 2.55 I can write when I get home.

#11 venrob

venrob

    Scripter / Dev

  • ZC Developers
  • Real Name:Rob
  • Gender:Male

Posted 20 November 2019 - 09:17 PM

Honestly should just be this

hero script onDeath
{
    void run()
    {
        Game->ShowSaveScreen();
    }
}


#12 ZoriaRPG

ZoriaRPG

    The Timelord

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

Posted 21 November 2019 - 12:03 AM

namespace death
{
    void SkipAnimation(bool allowContinue)
    {
        if ( Link->HP < 1 )
        {
            if ( allowContinue ) Game->ShowContinueScreen();
            else Game->ShowSaveScreen();
        }
    }
}

//call death::SkipAnimation(bool) in any scrip.
          

  • TheRock likes this

#13 venrob

venrob

    Scripter / Dev

  • ZC Developers
  • Real Name:Rob
  • Gender:Male

Posted 21 November 2019 - 12:34 AM

Actually, 'ShowSaveScreen()' probably isn't what you want here at all; you want 'ShowContinueScreen()', period. That will call EXACTLY the F6 screen; which is what normally pops up; including calling an F6 script, if you have one assigned.



#14 Dimentio

Dimentio

    P-put me down!

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

Posted 21 November 2019 - 01:52 AM

yes but pretty sure that didn't exist in 2.50.2/2.53.



#15 venrob

venrob

    Scripter / Dev

  • ZC Developers
  • Real Name:Rob
  • Gender:Male

Posted 21 November 2019 - 04:58 AM

yes but pretty sure that didn't exist in 2.50.2/2.53.

 

If that is the case then I will update to version 2.55 alphas. 




2 user(s) are reading this topic

0 members, 2 guests, 0 anonymous users