Is it possible, with a script, to have a setup where, if Link dies on one screen, he'll respawn (after the game over screen) on another screen? But if he dies anywhere else (before or after visiting either screen) it respawns Link where he normally would (i.e. the continue screen).
Set another screen as Continue Screen
#1
Posted 15 August 2020 - 07:15 PM
#2
Posted 15 August 2020 - 07:22 PM
ffc script ContinueOnDeath{ void run(int Screen, int DMap){ while(true){ if(Link->HP <= 0){ Game->ContinueDMap = DMap; Game->ContinueScreen = Screen; Game->LastEntranceDMap = DMap; Game->LastEntranceScreen = Screen; } Waitframe(); } } }D0 on the FFC is Screen, D1 is DMap.
The Screen number needs to be in decimal, not hexadecimal (which is what ZQ lists screens as).
Edit: For clarification, you'll need a separate script if you want to customize the continue Screen/DMap combo again, ZC only keeps track of the latest one by default and you'd need a global solution if you want to track further back (for re-setting).
Edited by Mani Kanina, 15 August 2020 - 07:25 PM.
#3
Posted 15 August 2020 - 07:34 PM
Well that was fast!
I'll check if it works in the morning (over here), but thanks.
By the edit, do you mean that, after being on the death screen, the original continue screen for the dungeon won't be returned? As in, going onto that screen will permanently change the continue screen?
If that's the case, I suppose the solution is to add another copy of this script onto every screen that can be accessed directly by the death one. Which should work fine, tbh, especially as it's generally only one or two screens total.
In any case, thanks again, and I'll get back if there's an issue.
#4
Posted 15 August 2020 - 07:51 PM
The original continue screen for the dungeon will not be returned, it's unrelated to going onto any screen, it's as you wanted set to the scripts values when the player dies on the screen where this FFC script is running.By the edit, do you mean that, after being on the death screen, the original continue screen for the dungeon won't be returned? As in, going onto that screen will permanently change the continue screen?
Well, no, not unless you want the player to also die on the second screen to go back?If that's the case, I suppose the solution is to add another copy of this script onto every screen that can be accessed directly by the death one.
I can modify the script to be dual purpose if you wish.
ffc script ContinueOnDeath{ void run(int Screen, int DMap, int Returning){ if(Returning > 0){ Waitframe(); Game->ContinueDMap = DMap; Game->ContinueScreen = Screen; Game->LastEntranceDMap = DMap; Game->LastEntranceScreen = Screen; return; } while(true){ if(Link->HP <= 0){ Game->ContinueDMap = DMap; Game->ContinueScreen = Screen; Game->LastEntranceDMap = DMap; Game->LastEntranceScreen = Screen; } Waitframe(); } } }If you set the FFC's D2 value to 1 or higher in this new version then the defined continue point will be set as soon as Link enters the screen rather than if Link dies on the screen.
- klop422 likes this
#5
Posted 16 August 2020 - 06:06 AM
Wait, so with the original script, the continue screen is only set when Link dies. What I'm confused about now is what happens when he then goes to another screen, after dying the first time, and dies again. Does he go to the normal continue screen, or to the continue screen that was set when he died?
EDIT: If the latter, I suppose I need the second anyway.
Edited by klop422, 16 August 2020 - 06:07 AM.
#6
Posted 16 August 2020 - 05:49 PM
The continue screen that was set the first time he died, would be the direct answer.Wait, so with the original script, the continue screen is only set when Link dies. What I'm confused about now is what happens when he then goes to another screen, after dying the first time, and dies again. Does he go to the normal continue screen, or to the continue screen that was set when he died?
Moving around from screen to screen within a DMap does not set the continue point. The basic and most common way ZC updates your continue point is when you take a warp to a dmap that has the continue here flag set.
This means that if you want to mess with custom scripted continue points you need to set it again every time you want it to be different than it currently is.
#7
Posted 16 August 2020 - 06:38 PM
Thanks for clearing that all up.
And, after testing, it all works like a charm! Thanks!
1 user(s) are reading this topic
0 members, 1 guests, 0 anonymous users