Path: blob/master/Sonic 1/Scripts/SYZ/EdgeStabilizer.txt
1483 views
// ----------------------------------1// RSDK Project: Sonic 12// Script Description: Edge Stabilizer Object3// Script Author: Christian Whitehead/Simon Thomley4// Unpacked by Rubberduckycooly's script unpacker5// ----------------------------------67// The object name is a bit odd so I'll just clarify here -8// This object's purpose is to make the player not sink at the edge of a triangle chunk9// Well I suppose that's an equally as odd description, but since images are worth a thousand words, it's meant to prevent things like this10// https://randomsonicnet.org/taxman_sage2007/collisionbug.png1112// ========================13// Aliases14// ========================1516// Player Aliases17private alias object.ypos : player.ypos18private alias object.gravity : player.gravity19private alias object.collisionBottom : player.collisionBottom202122// ========================23// Events24// ========================2526event ObjectUpdate27foreach (GROUP_PLAYERS, currentPlayer, ACTIVE_ENTITIES)28if player[currentPlayer].gravity == GRAVITY_GROUND29BoxCollisionTest(C_TOUCH, object.entityPos, -8, -8, 8, 8, currentPlayer, C_BOX, C_BOX, C_BOX, C_BOX)30if checkResult == true31temp0 = player[currentPlayer].collisionBottom32temp0 *= -0x1000033temp0 -= 0x8000034temp0 += object.ypos35if player[currentPlayer].ypos > temp036player[currentPlayer].ypos = temp037end if38end if39end if40next41end event424344// ========================45// Editor Events46// ========================4748event RSDKDraw49DrawSprite(0)5051if editor.showGizmos == true52editor.drawingOverlay = true5354// Draw the sensor hitbox55temp0 = 8; temp1 = 8; temp2 = 8; temp3 = 8;56CallFunction(EditorHelpers_DrawHitbox)5758editor.drawingOverlay = false59end if60end event616263event RSDKLoad64LoadSpriteSheet("Global/Display.gif")65SpriteFrame(-8, -8, 16, 16, 239, 239) // "Trigger" - #06667SetVariableAlias(ALIAS_VAR_PROPVAL, "unused")68end event697071