Aslickproductions.org/forum/index.php?PHPSESSID=5f0fck550j2m4m2fpbtkj2vkm1&topic=1781.0e:/My Web Sites/Slick Productions - FFIV Message Board/slickproductions.org/forum/indexa168-2.htmlslickproductions.org/forum/index.php?PHPSESSID=5f0fck550j2m4m2fpbtkj2vkm1&board=8.180e:/My Web Sites/Slick Productions - FFIV Message Board/slickproductions.org/forum/indexa168-2.html.zx?&h^4OKtext/htmlISO-8859-1gzip8:4Wed, 11 Mar 2020 00:00:24 GMT0 0P?&h^4 Event continuing after custom death subroutine.

Author Topic: Event continuing after custom death subroutine.  (Read 2010 times)

TheNattak

  • Garula
  • *
  • Posts: 203
  • Gender: Male
  • Mike
    • View Profile
    • Return of the Dark Sorcerer
Event continuing after custom death subroutine.
« on: November 11, 2012, 08:18:42 PM »
Here's an interesting one that is kinda hard to explain, but here goes...

I have what is basically a complete boss medley event, and am using a custom death subroutine after each battle, that instead of sending you to the normal game over subroutine with the 4F 'Exit the current location' command, (that makes it go back to the last save) it will go back to the map that the event takes place on, and the NPC there will kick you out of the map, back to the school map where the whole event is triggered in the first place...

Anyways, the problem is that when I put the FE command at the end of the new death routine, it will just go on to the next battle instead of ending the event like I want.
In other words, I am still technically inside the event, cause when I use FE, it'll simply return and load the next battle. If I leave the FE out, it will of course freeze the event and not allow the character to open the menu or move.

My question in a nut shell is: Is there by any chance a way that anyone can think of how I can end the event via the new death subroutine, without it continuing on to the next consecutive battle when it hits FE? The only similar thing in the game that I can think of is the Colosseum, so I looked at it to see how they do it there, but since the battles are not consecutive, it didn't help to solve much, although it got me thinking that I may need to use event bits and/or checks after each and every battle there in the boss medley code - I hope that's not what has to be done. =X

I know this is a rather odd event-related question, but I'm at a loss here and it never hurts to ask. =)

Thanks,
Mike
« Last Edit: November 11, 2012, 08:25:19 PM by TheNattak »

assassin

  • Bane of Retards
  • *
  • Posts: 1,033
  • space bears are not gentle!
    • View Profile
    • My Barren Webpage
Re: Event continuing after custom death subroutine.
« Reply #1 on: November 11, 2012, 10:59:51 PM »
paste or link some of your code.

TheNattak

  • Garula
  • *
  • Posts: 203
  • Gender: Male
  • Mike
    • View Profile
    • Return of the Dark Sorcerer
Re: Event continuing after custom death subroutine.
« Reply #2 on: November 12, 2012, 12:53:50 AM »
Sure thing.
Here's how the battles are set up back to back:

Code: [Select]
ex: 4D 06 4A B2 90 14 2F 4D 41 42 B2 90 14 2F etc. etc.

And here's the new death SR:

Code: [Select]
offset: F91490
          B7 40 B2 5E 00 B2 A0 14 2F FE FD FD FD FD FD FD
          F1 40 30 42 31 6B 87 01 08 0D C0 3D 2A FD FD FD
          2A 07 D5 08 0A CE E0 00 FF 43 2A 04 37 2A 22 41
          2A 41 31 38 30 03 C3 88 FF B5 04 96 95 FD B2 90
          38 01 B2 80 39 01 93 4B 21 0C 91 F4 03 93 55 A0
          F4 18 31 08 1F C7 C3 DD E0 04 9E FF 5A 08 5C FD
          6B 68 30 5E 31 C0 96 39 59 04 5C FE FF FF FF FF

Basically it just checks if you are dead, then loads the Sealed Gate map, and the NPC that's there says a dialog box and then kicks you out back to the school of learning map where it then goes right on to the next battle after the death SR.

Breakdown of what's happening:

4D 06 4A B2 90 14 2F (invoke battle & dies =X)
(goes to death routine and reads the FE there at the very end.)
4D 41 42 B2 90 14 2F (jumps back to this next battle instead of ending the event in the school like I want.)

I understand why it's doing it, but have been unsuccessful in finding a solution around it to make it stop.
« Last Edit: November 12, 2012, 02:11:53 PM by TheNattak »

Lenophis

  • Forum Overlord
  • *
  • Posts: 1,688
  • Gender: Male
  • I sad
    • View Profile
    • Slick Productions
Re: Event continuing after custom death subroutine.
« Reply #3 on: November 12, 2012, 01:18:37 AM »
Why use 4F at all? Just have the "game over" spit you out to whatever it is you want. You need to hack the auto-continue to do what you want.

119 bugs fixed and counting.

TheNattak

  • Garula
  • *
  • Posts: 203
  • Gender: Male
  • Mike
    • View Profile
    • Return of the Dark Sorcerer
Re: Event continuing after custom death subroutine.
« Reply #4 on: November 12, 2012, 01:31:01 AM »
But I'm NOT using the 4F command in this new death subroutine.
I have it spitting me out to the School of Learning map, where the next thing it does is go right on to the next battle.
I can't get the event to end once it gets me back to the school without it going back to the next battle.
« Last Edit: November 12, 2012, 01:36:19 AM by TheNattak »

assassin

  • Bane of Retards
  • *
  • Posts: 1,033
  • space bears are not gentle!
    • View Profile
    • My Barren Webpage
Re: Event continuing after custom death subroutine.
« Reply #5 on: November 12, 2012, 05:15:51 PM »
i guess you'll have to move your death tests outside of the extra function, so they're in between the battle invocations in the main function.  yes, this will take more bytes than currently used.

so it'll work like:

Invoke Battle 1
If not dead, branch to battle2
Branch to Custom death routine
battle2:
Invoke Battle 2
If not dead, branch to battle3
Branch to Custom death routine
battle3:
(etc, etc)

------------

now, if Command B7 lets you test for the bit being set versus being clear (like Command C0 lets you do), then you could consolidate these:
"If not dead, branch to battleX
Branch to Custom death routine"

into:
"If dead, branch to Custom death routine"

but i don't think it does, so oh well.

TheNattak

  • Garula
  • *
  • Posts: 203
  • Gender: Male
  • Mike
    • View Profile
    • Return of the Dark Sorcerer
Re: Event continuing after custom death subroutine.
« Reply #6 on: November 12, 2012, 05:37:33 PM »
Beautiful, thank you very much! I'll give it a shot.
It will be tedious, as there's around 50+ battles to re-code, but it looks like it will work. =)

assassin

  • Bane of Retards
  • *
  • Posts: 1,033
  • space bears are not gentle!
    • View Profile
    • My Barren Webpage
Re: Event continuing after custom death subroutine.
« Reply #7 on: November 12, 2012, 10:45:19 PM »
no prob.  50; eep!  it'd be nice if the event scripts could do indexing of data tables, and the Invoke Battle commands let you read from a variable, so you could call these things in a loop.

well, i hear repetition can be Zen..  may enlightenment come your way.

Lenophis

  • Forum Overlord
  • *
  • Posts: 1,688
  • Gender: Male
  • I sad
    • View Profile
    • Slick Productions
Re: Event continuing after custom death subroutine.
« Reply #8 on: November 13, 2012, 01:31:57 AM »
Who says they can't? Just make a new command to do it, since there's about 20 that can be snatched. :wink:

119 bugs fixed and counting.