Path: blob/master/Sonic 1/Scripts/LZ/BeltActivation.txt
1480 views
// ----------------------------------1// RSDK Project: Sonic 12// Script Description: Belt Activation Object3// Script Author: Christian Whitehead/Simon Thomley4// Unpacked by Rubberduckycooly's script unpacker5// ----------------------------------67// ========================8// Aliases9// ========================1011private alias object.propertyValue : object.beltCount1213private alias object.value0 : object.endSlot14private alias object.value1 : object.startSlot151617// ========================18// Events19// ========================2021event ObjectUpdate22arrayPos0 = object.startSlot23while arrayPos0 < object.endSlot24object[arrayPos0].priority = PRIORITY_ACTIVE25arrayPos0++26loop27end event282930event ObjectDraw31// Even if it's a "Draw" event, there's not really much drawing that actually happens here32// Instead, it just does some more managing of priorities33// (Keep in mind, when the player's dead Updates aren't ran anymore but Draws are)3435arrayPos0 = object.startSlot36while arrayPos0 < object.endSlot37if stage.state == STAGE_RUNNING38object[arrayPos0].priority = PRIORITY_INACTIVE39else40object[arrayPos0].priority = PRIORITY_ACTIVE41end if4243arrayPos0++44loop45end event464748event ObjectStartup49foreach (TypeName[Belt Activation], arrayPos0, ALL_ENTITIES)50object[arrayPos0].priority = PRIORITY_XBOUNDS51arrayPos1 = arrayPos052object[arrayPos0].endSlot = object[arrayPos0].beltCount5354temp0 = false55while temp0 == false56if object[arrayPos1].type == TypeName[Belt Platform]57object[arrayPos0].startSlot = arrayPos158temp0 = true59else60arrayPos1++61if arrayPos1 >= 0x42062temp0 = true63end if64end if65loop6667object[arrayPos0].endSlot += object[arrayPos0].startSlot68next69end event707172// ========================73// Editor Events74// ========================7576event RSDKDraw77DrawSprite(0)7879if editor.showGizmos == true80editor.drawingOverlay = true8182arrayPos0 = object.entityPos8384GetObjectType(temp0, "Belt Platform")8586checkResult = true87while checkResult == true88checkNotEqual(object[arrayPos0].type, temp0)89arrayPos0 += checkResult9091if arrayPos0 >= 0x42092checkResult = false93end if94loop9596arrayPos1 = arrayPos097arrayPos1 += object.beltCount9899while arrayPos0 < arrayPos1100DrawLine(object.xpos, object.ypos, object[arrayPos0].xpos, object[arrayPos0].ypos, 0xFF, 0xFF, 0x00)101arrayPos0++102loop103104editor.drawingOverlay = false105end if106end event107108109event RSDKLoad110LoadSpriteSheet("Global/Display.gif")111SpriteFrame(-8, -8, 16, 16, 239, 239) // "Trigger" - #0112113SetVariableAlias(ALIAS_VAR_PROPVAL, "beltCount")114end event115116117