Advertisement
Guest User

Untitled

a guest
Jul 3rd, 2020
64
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 5.09 KB | None | 0 0
  1. --- Anon ---
  2.  
  3. Hello!
  4. I just played your rom hack and wow, i'm still impressed. I think that is the most incredible SMW rom hack i've ever played until today. Really amazing job!
  5.  
  6. I'm still a beginner with making SMW rom hacks but I'm trying to learn new things... I wanted to ask you: how you animated some of the cutscenes? Like that plate of spaghetti with the meat face incoming or the awakening of Sponge at the bad ending...or the "victory screen" of the U.N. squadron section? I would be very interested to know because I would like to do similar things with my hack in future.
  7.  
  8.  
  9. --- Eminus ---
  10.  
  11. Hi! Thanks, I'm glad you liked it!
  12.  
  13. So the answer for the 2 cutscenes you mentioned is exAnimations and one-shot triggers. You can learn more about the different triggers in the Lunar Magic help file, but one-shot exAnimations are simply animations that play once. I triggered them at a certain time by having uberASM code that makes invisible Mario move forward. Then, there's code that checks for when Mario reaches a certain position. If it's reached, the exAnimation is triggered. Now, this can also be done by using a timer instead of a moving Mario, which is necessary when you also want Mario on screen (I used a timer for the blue will smith faces appearing in the backgroundat the beginning of the "rewind time" section)
  14.  
  15. As for the UN Squadron victory cutscene, it was done in a very janky way. The portrait of Sponge is 4 sprites that move and stop (whether they move or not is controlled by freeRAM. FreeRAM is an unused RAM address that you can use as a timer or a flag. Here it's used as a flag). The image of Sponge riding Yoshi doesn't actually move, it's the invisible player who is propelled towards it, to the right. The 4 sprites that constitute the portrait also go right but faster than the player. Boosting the player to the right like I did was one of different ways to move the game's camera
  16.  
  17.  
  18. --- Anon ---
  19.  
  20. I see, i never used exAnimations before but i think i understood the process. I see in the UberASM section here that there are codes for making Mario invisible and move forward automatically (and disable buttons i suppose).
  21. Did you use some specific blocks to check when Mario reaches certains spots and trigger the one-shot animation? For the timer version, how do you set it?
  22.  
  23.  
  24. --- Eminus ---
  25. Yeah you could use a custom block to trigger the exanimation, in fact it's what I'd do before I learned how to do it through code. You could even use conveyor belt blocks to make mario go right, only needing uberasm to make him invisible and disable input. But once you know how to do everything through code, it makes more sense to have everything in one place. Here is the code to do it all through uberasm (from the "meat coming out of the spaghetti" cutscene):
  26.  
  27. [Code start]
  28.  
  29. Main:
  30. LDA #$FF ;\ Hide the player's graphics
  31. STA $78 ;/
  32. LDA #$0B ;\ Set the player's state to "frozen"
  33. STA $71 ;/
  34. LDA #$07 ;\ Set the player's x speed
  35. STA $7B ;/
  36.  
  37. REP #$20 ;we need to go into 16-bit mode to read $XXXX values
  38. LDA $7E ;\the player's X position
  39. CMP #$004A ;|this value is the position that you want mario to attain to trigger the animation
  40. BNE .skip ;/if it's not the compared value, skip
  41.  
  42. LDA $7FC0F8 ;\
  43. ORA #$0001 ;| one-shot trigger 00
  44. STA $7FC0F8 ;/
  45.  
  46. .skip
  47. LDA $7E
  48. CMP #$00A0 : BCC Return ; same deal here (":" counts as a line break!)
  49. SEP #$20 ; go back to 8-bit mode, we're about to mess with $XX values again!
  50. LDA #$06 ;\
  51. STA $71 ;|
  52. STZ $89 ;|
  53. STZ $88 ;/ this teleports the player, with the current screen exit as the level destination
  54. Return:
  55. SEP #$20 ; always go back to 8-bit mode before ending code, i THINK it's necessary
  56. RTL
  57.  
  58. [Code end]
  59.  
  60.  
  61. Note that setting the player's state to #$0B does unwanted things such as disabling HDMA effects. So you might prefer setting the "disable button" flags:
  62.  
  63. [Code start]
  64.  
  65. LDA #$FF :\
  66. STA $0DAA|!addr ;| Disable controller
  67. STA $0DAC|!addr ;/
  68.  
  69. [Code end]
  70.  
  71.  
  72. I would recommend looking up $0DAA and 0DAC on the RAM map, you'll see that you can disable certain buttons if you set certain bits of those 2 RAM addresses, it may come in handy!
  73.  
  74. Also if you don't know, BCC means "if it's less than equal". In what you see above, it ensures that the code will continously run even if mario keeps advancing. it's not something you want with the first position check though, or the one-shot animation would be triggered over and over
  75.  
  76.  
  77. --- Eminus ---
  78.  
  79. There are a couple things I forgot to say: storing #$FF to $0DAA and $0DAC sometimes doesn't completely work, in my experience, like the player could still jump. Setting $71 to #$0B always works to disable all movement so that's why I prefer using it.
  80.  
  81. The ram address $7E is the player's X position within the borders of the screen, which is likely to be used if doing something in a level that has one screen only. Then there's also RAM addresses that indicate the player's X position within the level ($94). Since a screen is 256 pixels wide, and that 256 in hex is 100, #$0100 means the player is on screen 01, #$0200 is 02 and so on
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement