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

Posted 20 November 2019 - 04: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 Emily

Emily

    Scripter / Dev

  • ZC Developers

Posted 20 November 2019 - 05: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

Posted 20 November 2019 - 07: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 Emily

Emily

    Scripter / Dev

  • ZC Developers

Posted 20 November 2019 - 07: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

Posted 20 November 2019 - 07: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 Deedee

Deedee

    Bug Frog Dragon Girl

  • Moderators
  • Real Name:Deedee
  • Pronouns:She / Her, They / Them
  • Location:Canada

Posted 20 November 2019 - 08: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

Posted 20 November 2019 - 08: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 Emily

Emily

    Scripter / Dev

  • ZC Developers

Posted 20 November 2019 - 08:23 PM

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

#9 TheRock

TheRock

    Go glitches

  • Members

Posted 20 November 2019 - 08: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();
}
}
}

  • Deedee likes this

#10 Emily

Emily

    Scripter / Dev

  • ZC Developers

Posted 20 November 2019 - 08: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 Emily

Emily

    Scripter / Dev

  • ZC Developers

Posted 20 November 2019 - 10:17 PM

Honestly should just be this

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


#12 Timelord

Timelord

    The Timelord

  • Banned
  • Location:Prydon Academy

Posted 21 November 2019 - 01: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 Emily

Emily

    Scripter / Dev

  • ZC Developers

Posted 21 November 2019 - 01: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 Deedee

Deedee

    Bug Frog Dragon Girl

  • Moderators
  • Real Name:Deedee
  • Pronouns:She / Her, They / Them
  • Location:Canada

Posted 21 November 2019 - 02:52 AM

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



#15 Emily

Emily

    Scripter / Dev

  • ZC Developers

Posted 21 November 2019 - 05: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. 




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users