Language…
10 users online:  AmperSam, ClaireChan, DanMario24YT, Darolac, mathie, MorrieTheMagpie, Nayfal, PaceTheAce, simon.caio, Sweetdude - Guests: 262 - Bots: 346
Users: 64,795 (2,378 active)
Latest user: mathew

Line-Guided Any Sprite v1.2

SMW Sprites → Line-Guided Any Sprite v1.2

This file is obsolete. The latest version is Line-Guided Any Sprite v1.3. For other versions, check the version history.

Submission Details

Name: Line-Guided Any Sprite v1.2
Authors: Kevin, dtothefourth
Added:
Version History: View
Tool: PIXI
Type: Standard
Dynamic: No
Disassembly: No
Includes GFX: No
Description: This sprite acts as a wrapper for any normal or custom sprite*, allowing it to easily be made line-guided at the cost of an extra sprite slot.
Check out the asm file for info on how to use it.

Original sprite by dtothefourth, I optimized it a bit and made some fixes:
- Now it works properly with Yoshi and with carryable sprites.
- Now it works properly when Yoshi or Baby Yoshi eat the sprite.
- Now the sprite won't respawn when the wrapped sprite is killed or collected (e.g. sprite killed with a spin jump, collected powerup).
- Now compatible with Line Guide Acts-Like fix.

v1.1 update:
- Small code optimizations.
- Added an option in the 4th extra byte to be used with platforms: if set, Mario will move with the platform instead of sliding on it (like normal line-guided platforms do).
- Now the sprite uses 8 extra bytes: the last 4 set the 4 extra bytes for the spawned sprite.

v1.2 update:
- Fixed a bug where if the wrapped sprite failed to spawn (due to sprite slots being full) the wrapper would be erased forever, instead of being able to respawn (thanks to MarioFanGamer for pointing this out).
- Added a second platform option, to make it compatible with sprites that use custom platform code (for example, this) (thanks to MarioFanGamer for suggesting this).
- Now the sprite uses 9 extra bytes: the 5th one sets the speed multiplier for the sprite (if you want to make it move faster).
- Fixed an issue where the sprite would despawn immediately after spawning when using a non-zero offset and spawning it from a specific direction.

*Some sprites may not work properly, for example Rotating Platform and Ball n' Chain.
Tags: line-guided lorom sa-1
Comments: 24 (jump to comments)
Rating:
0.0 (0 ratings)
No rating
Download 5.33 KiB | 909 downloads

Screenshots

View all

Comments (24)

 Mellonpizza Link
Discovered that currently, the sprite performs undefined behavior on init where it calls a wrapper for SMW's vanilla lineguide routine twice, then offsets the wrapped spawned sprite. The latter routine expects Y to point to the spawned sprite, but the former routine clobbers it, and it is not restored. It seems most of the time, this points to an empty sprite slot and causes no issues. However this can 'snap' an occupied slot if Y returns pointing to one. I did not check if it could return beyond the max sprite slot, but regardless, this would be trivial to fix by simply adding phy before and ply after the 2 jsr HandleLineGuide calls in the init routine.
Lizstar Link
Originally posted by KevinM
The spawn issue might be because keyholes normally don't despawn when offscreen, causing both them and the wrapper to stay loaded. Try using this patch and see if it fixes it.
About the color issue, I have no clue really.


Well now I feel like a dummy. I had NO idea about the keyhole thing. So yeah, not an issue with this sprite at ALL.

As for the color thing, I still have no clue, but I can at least work around that. Probably just not working with something or other in the code, though the specifics of it are very strange. Anyway, thank you KevinM for the great sprite and also putting up with my general incompetence lmao
 Kevin Author Link
Originally posted by Lizstar
Having the strangest issues with this sprite, two of them specifically. The first is I don't think it despawns properly. If I put in enough of this sprite (which I'm having as a keyhole, by the way), eventually any sprites don't spawn later in the later. Like, way later. Its not a matter of them being too close. I've done a lot of testing with but it's pretty consistent.

The second I'm really not sure whats going on. If I enter a pipe and exit where there's a lineguided keyhole, it just destroys the colors. It changes depending where it is. I've had it go all white, all purple, or just make the backgrounds messed up. The only things visible are sprites. The level loads in perfectly fine if I remove the lineguided sprite from that area.

This all confounds me cause this has been around for a bit and I can NOT be the first person to do these things. The despawn issues happen with a fresh rom, but not the color issues. I have NO idea why that happens, though I don't have much in my rom yet, pretty much just line-fix. I can work around that I guess, but I can't work around the sprites not loading in issue.

The spawn issue might be because keyholes normally don't despawn when offscreen, causing both them and the wrapper to stay loaded. Try using this patch and see if it fixes it.
About the color issue, I have no clue really.
Lizstar Link
Having the strangest issues with this sprite, two of them specifically. The first is I don't think it despawns properly. If I put in enough of this sprite (which I'm having as a keyhole, by the way), eventually any sprites don't spawn later in the later. Like, way later. Its not a matter of them being too close. I've done a lot of testing with but it's pretty consistent.

The second I'm really not sure whats going on. If I enter a pipe and exit where there's a lineguided keyhole, it just destroys the colors. It changes depending where it is. I've had it go all white, all purple, or just make the backgrounds messed up. The only things visible are sprites. The level loads in perfectly fine if I remove the lineguided sprite from that area.

This all confounds me cause this has been around for a bit and I can NOT be the first person to do these things. The despawn issues happen with a fresh rom, but not the color issues. I have NO idea why that happens, though I don't have much in my rom yet, pretty much just line-fix. I can work around that I guess, but I can't work around the sprites not loading in issue.
olgdeldnem Link
This reminds me of SMM's tracks.
JamesD28 Link
Tested with:

• Lunar Magic 3.21
• SA-1 Pack v1.32
• PIXI v1.2.15
• Snes9x v1.60
• bsnes plus v05
• Super Mario World 2: Yoshi's Island - Numbered Platform (for 2nd platform option)

Works as intended, so, update accepted. The speed multiplier is a nice feature, but be careful with it - Mario can be pushed through platforms if the speed is too fast. At the highest speeds, Mario (and thus the camera) can be pushed horizontally so fast (via the platform options) that tile columns can't be updated fast enough and appear glitched. However, in my opinion the highest speeds are too fast to be useful anyway, so this is unlikely to be an issue.
 Kevin Author Link
Small update: additional bug fix and added speed option.
Knight of Time Link
Originally posted by KevinM
Originally posted by Knight of Time
I like that there is now an option to make this sprite compatible with sprites that use custom platform code, though just wondering how I can make it work with this? This sprite may very well be the only sprite which shouldn't automatically move if on a line guide.

You cannot.

Shoot, I was afraid of that. Could you explain in a little more detail, please? I'm guessing I'll need to add code to the other sprite to attach it to a line guide, right?
 Kevin Author Link
Originally posted by Knight of Time
I like that there is now an option to make this sprite compatible with sprites that use custom platform code, though just wondering how I can make it work with this? This sprite may very well be the only sprite which shouldn't automatically move if on a line guide.

You cannot.
Knight of Time Link
I like that there is now an option to make this sprite compatible with sprites that use custom platform code, though just wondering how I can make it work with this? This sprite may very well be the only sprite which shouldn't automatically move if on a line guide.
JamesD28 From older version: Line-Guided Any Sprite v1.1 Link
Tested with:

• Lunar Magic 3.11
• SA-1 Pack v1.32
• PIXI v1.2.15
• Snes9x v1.60

Tested with custom sprites:

• Koopas + Shells + Disco Shell
• Info Box
• Claymore
• Carryable Sprite Killer
• Super Mario Bros & SMW Themed Flag/Flagpole

The original file included didn't fix the platforms sliding issue, but this was fixed by the author. There is still a small movement when Mario's on a platform, but it is much better and shouldn't be an issue in practice. The extra bytes get set correctly for spawned custom sprites, and everything else works as intended, so, update accepted.
 Kevin Author From older version: Line-Guided Any Sprite v1.1 Link
New update: I added the option to set the 4 extra bytes in the spawned sprite.
 Kevin Author From older version: Line-Guided Any Sprite Link
I found that the bug where line-guided sprites eaten and then spit by Yoshi wouldn't interact with the ground was because of a typo (BNE Kill instead of BNE Kill2). I fixed it now, so it should work as expected.
JamesD28 From older version: Line-Guided Any Sprite Link
Tested with:

• Lunar Magic 3.11
• SA-1 Pack v1.32
• PIXI v1.2.15
• Snes9x v1.60

Also tested with:

• Sprite Properties Depending on the Extra Bit
• Line Guide Acts-Like Fix
• Asar v1.71

A very nice sprite! This certainly opens up a lot of new innovative uses for vanilla and custom sprites, and has a little sprinkle of good jank that's sure to be used creatively. Considering most sprites were never intended to be line-guided, I was surprised at how many of them actually behaved well when line-guided - even Lemmy and Wendy Koopa will follow the line! (but their dummies won't). Keep in mind though that some sprites will behave oddly, and some just won't work at all (such as sprite E0 mentioned below). To fix the issue with the chained rotating sprites alternating direction, use the Sprite Properties Depending on the Extra Bit patch.

A few things to keep in mind:

- Most of the vanilla sprites will not align with the lines properly by default. The offset function proves very useful here: XY offsets F8,F8 or F8,F4 work well for a lot of sprites, but you will have to tweak and experiment with them to find the best results.

- Some non-line-guided platforms which move/oscillate will still attempt to move Mario at their hardcoded speeds instead of relative to the line-guided speed, causing him to sometimes slide across the platforms even when no directional buttons are held.

- To get a line-guided Flying Hammer Brother, use this sprite to spawn the flying turnblocks (sprite 9C), then place the Hammer Bro above the sprite.

- Sprites which are coded to move by themselves may shake/jitter when on the line, depending on what their movement is.

- Sprites eaten by Yoshi will not interact with objects when spat out.
Thiago678 From older version: Line-Guided Any Sprite Link
#smrpg{y}
Thiago678 From older version: Line-Guided Any Sprite Link
YES hahahaa
Final Theory From older version: Line-Guided Any Sprite Link
YAS!
MegaSonic1999 From older version: Line-Guided Any Sprite Link
Similar to super Mario maker.
 Kevin Author From older version: Line-Guided Any Sprite Link
Sprite E0 (like DA-DF) is expected to not work, because it's a special sprite not supposed to be spawned directly like this sprite does.
For the rotating sprites, the issue is that they use their X position to determine if to rotate clockwise or counterclockwise, but they do so in their main routine: so if they move horizontally, they'll end up switching direction. If you want to fix it, you can use this patch which changes them to use the extra bit instead (so you can also set their direction with the 4th extra byte).
Anas From older version: Line-Guided Any Sprite Link
No problem then. Thought it indeed would work with every sprite, but it seems not. There's already a line-guided version of sprite E0 by RussianMan anyway, and the erratic rotation of the latter two sprites I mentioned isn't all bad.
 Kevin Author From older version: Line-Guided Any Sprite Link
Yes, not all sprites will interact properly with this, deal with it
Anas From older version: Line-Guided Any Sprite Link
Okay, tested this quickly and for some reason, setting sprite E0 (three gray platforms on a chain) with this crashes the game, no matter what state, and setting sprite C4 or A3 (ball 'n chain or lone gray platform) in state 1 will make either sprite not rotate properly on its chain, but they do move along the line guide properly.
 Kevin Author From older version: Line-Guided Any Sprite Link
What
Anas From older version: Line-Guided Any Sprite Link
Hey, won't this now obsolete any and every line-guided custom sprite we have so far?

Edit: Initially I assumed that this was a patch without even looking at the section it was submitted in and proceeded to patch it to my ROM, only to come across a slew of errors. Looked at it again, and I realized that it's a sprite! That's actually really nice and much safer than a patch imo.