Language…
12 users online: anonimzwx, BarsSimpson, codfish1002, crm0622,  Fernap, GrenudoGames, Kaputon, Morph Moth, PuffleDreemurr, RedYoshi87, Zavok, Zoreo - Guests: 87 - Bots: 195
Users: 62,817 (2,619 active)
Latest user: Kaputon

Teleport At Timer Value by quietmason

File Name: Teleport At Timer Value
Submitted: by quietmason
Authors: quietmason
Type: Level
Includes GFX: No
Includes Hijack: No
Featured: No
Description: This simple level UberASM will teleport the player to another level when the timer reaches a specified value.

Configurable items: sound played, level teleported to (and if you want it to be a secondary exit/water level), and time to teleport at.

Note that you may set the time to 0, but the death sound will play, and you will then have to manually start the music in the level you teleport to.
Tags: lorom, sa-1, timer
Screenshots:
Rejected for working incorrectly in Lunar Magic 3.00+ big levels.

This code is a very simple timer check that gets fed to a teleport routine lifted from GPS. The version of this routine that was copied, however, appears to be an old version, as it does not include the check of the !EXLEVEL define as it appears in the current version (1.4.3 as of this log). This often causes incorrect data to be fetched when teleporting from a big level, warping to the wrong destination (generally 000/100).

Further, the code allows setting a destination level to be a water level if desired. The bit that controls this behavior had its purpose altered in newer versions of Lunar Magic, and it now doubles as a "start at midway" flag if separate midway entrance settings are enabled in the destination level (see $19D8). The code's "water level" settings thus don't always behave as expected.

Finally, while not a rejection reason, the transplanted routine is no longer running in the context of a block, and can be optimized a bit (axe PHX : PHY / PLY : PLX and ORA #$04). As a piece of general advice, I also recommend putting your SA-1 modifiers directly on RAM addresses set in defines (i.e. !sfx_bank = $1DFC|!addr & STA !sfx_bank instead of !sfx_bank = $1DFC & STA !sfx_bank|!addr).

Tested with Asar 1.81, Lunar Magic 3.31, SA-1 1.40, Snes9x 1.59.2.