Kuribo64
Views: 8,767,089 Home | Forums | Uploader | Wiki | Object databases | IRC
Rules/FAQ | Memberlist | Calendar | Stats | Online users | Last posts | Search
09-24-18 05:29 PM
Guest:

0 users reading ASM Hack Example: Bouncy Grass | 1 bot

Main - General SM64DS hacking - ASM Hack Example: Bouncy Grass New reply


StarPants
Posted on 04-22-18 06:21 AM (rev. 2 of 04-22-18 06:33 AM) Link | #94146
I got asked if I could make a custom CLPS behavior. So, here it is.



Doing this was relatively simple thanks to mibts' header files. Here's the code:

#include "SM64DS_2.h"

void hook_0200da0c() // This address found by dy is called every frame just before rendering
{
if (PLAYER_ARR[0]->wmClsn.sphere.floorResult.clps.BehaviorID() == 0x1E && !PLAYER_ARR[0]->isInAir)
{
PLAYER_ARR[0]->speed.y = 0x40000_f;
}
}

It basically checks if the triangle in which the player is standing on has behavior type of 0x1E (30 in decimal) and sets player's y speed to 64 fxu/frame. To make your own CLPS behavior, just change the code inside that if-block.

Edit: Oh I forgot the xdelta

____________________
my newish yt channel for sm64ds stuff


Main - General SM64DS hacking - ASM Hack Example: Bouncy Grass New reply

Page rendered in 0.016 seconds. (2048KB of memory used)
MySQL - queries: 26, rows: 189/189, time: 0.013 seconds.
[powered by Acmlm] Acmlmboard 2.064 (2018-07-20)
© 2005-2008 Acmlm, Xkeeper, blackhole89 et al.