GameBanana shows no ads to members. Sign up now!
Ads keep us online. Without them, we wouldn't exist. We don't have paywalls or sell mods - we never will. But every month we have large bills and running ads is our only way to cover them. Please consider unblocking us. Thank you from GameBanana <3

How to Renderhook Objects

A Tutorial for Sonic 3 A.I.R

Do you want to customise non-character sprites but don't want to use rawdata? Well, this tutorial is for you! This isn't a very good explanation, but renderhooks are a thing that you can use to customise the sprites of most objects in the game. For this example, we'll be using the barrel from CNZ. First, you'll want to copy paste the function seen in the image into your script. You can see where it is in the picture.

Then, you'll want find the objA0.update_address of the thing you're trying to change. Needless to say, you'll most likely find it in the object's script, so let's take a look there. I recommend using search and replace to find it. Just make sure that you don't replace it.
Then, you'll want to take the update address and turn it into a renderhook. Take something like the ICZ snowboard and duplicate it, but make sure to change the update address to be the one of the object you're trying to change. Then, copy Renderer.drawCustomSprite("XXX", px, py, 0x00, prioFlag ? SPRITE_FLAG_PRIO : 0, renderQueue, YYY, ZZZ) to replace the first two lines inside the bracket. Replace XXX with the sprite key of the sprite you plan to use. For this example, I'll use the sprite key of the S&K logo. Replace YYY with the rotation of the sprite. Keep it at 0 if you want to keep the sprite upright. Replace ZZZ with the opacity, or transparency, of the sprite. I'll be keeping it at max opacity, which is at 255.

And that's all you have to do to renderhook objects. If you want it to have multiple frames, you can refer to the picture below. With this, it'll be the S&K logo one frame, then the HUD icon for time, next. You can change stuff up if you want the sprites to appear for longer than 1 frame, but this is just an example. You can do things like change the rotation or opacity between frames, if you want to add extra effects.
And now, the S&K logo and time icon will take turns appearing. Putting pictures of both would be repetitive, so I'll just put a picture of the S&K logo over it.
Sign up to access this!

Embed

Share banner
Image URL
HTML embed code
BB embed code
Markdown embed code

Announcement

Enjoy!
- Lave sIime

Credits

Key Authors
Lave sIime avatar
Lave sIime username pic Joined 2mo ago
Offline
3,329 points Ranked 2,639th
16 medals 2 rare
  • Submitted 20 Gamefiles Medal icon
  • 10 submissions featured Medal icon
  • Submitted 5 Gamefiles Medal icon
  • Submission featured Medal icon
  • Reached 1,000 Points Medal icon
  • Returned 100 times Medal icon
Making the tutorial, its example, and the mod used to get screenshots without HUD or the player
Original Authors
Sega
Making the barrel of doom, the S&K logo, and the time HUD icon

Submitter

Lave sIime avatar
Lave sIime username pic Joined 2mo ago
Offline
3,329 points Ranked 2,639th
16 medals 2 rare
  • Submitted 20 Gamefiles Medal icon
  • 10 submissions featured Medal icon
  • Submitted 5 Gamefiles Medal icon
  • Submission featured Medal icon
  • Reached 1,000 Points Medal icon
  • Returned 100 times Medal icon
Lave sIime avatar
Lave sIime

Creator
Sign up to access this!
Sign up to access this!
Sign up to access this!

Game

Sign up to access this!

Category

Details

Difficulty Level
Advanced

Attributes

Share

  • Share on Reddit
  • Share on Twitter
  • Share on Facebook
  • Today's Pick
    Featured on Jul 26 2020
  • 4
  • 618
  • 11
  • 13d
  • 13d

More from Submitter

More Script Modding Tutorials