Path: blob/master/Sonic 2/Scripts/MPZ/BeltActivation.txt
1480 views
// ----------------------------------1// RSDK Project: Sonic 22// Script Description: Belt Activation Object3// Script Author: Christian Whitehead/Simon Thomley4// Unpacked by Rubberduckycooly's script unpacker5// ----------------------------------67// ========================8// Aliases9// ========================1011private alias object.value0 : object.endSlot12private alias object.value1 : object.startSlot131415// ========================16// Events17// ========================1819event ObjectUpdate20arrayPos0 = object.startSlot21while arrayPos0 < object.endSlot22object[arrayPos0].priority = PRIORITY_ACTIVE23arrayPos0++24loop25end event262728event ObjectDraw29arrayPos0 = object.startSlot30while arrayPos0 < object.endSlot31if stage.state == STAGE_RUNNING32object[arrayPos0].priority = PRIORITY_INACTIVE33else34object[arrayPos0].priority = PRIORITY_ACTIVE35end if36arrayPos0++37loop38end event394041event ObjectStartup42foreach (TypeName[Belt Activation], arrayPos0, ALL_ENTITIES)43object[arrayPos0].priority = PRIORITY_XBOUNDS44arrayPos1 = arrayPos045object[arrayPos0].endSlot = object[arrayPos0].propertyValue4647temp0 = false48while temp0 == false49if object[arrayPos1].type == TypeName[Belt Platform]50object[arrayPos0].startSlot = arrayPos151temp0 = true52else53arrayPos1++54if arrayPos1 >= 0x42055// Hit the temp object list, break56temp0 = true57end if58end if59loop60object[arrayPos0].endSlot += object[arrayPos0].startSlot61next62end event636465// ========================66// Editor Events67// ========================6869event RSDKDraw70DrawSprite(0)7172if editor.showGizmos == true73editor.drawingOverlay = true7475arrayPos0 = object.entityPos7677GetObjectType(temp0, "Belt Platform")7879checkResult = true80while checkResult == true81checkNotEqual(object[arrayPos0].type, temp0)82arrayPos0 += checkResult8384if arrayPos0 >= 0x42085checkResult = false86end if87loop8889arrayPos1 = arrayPos090arrayPos1 += object.propertyValue9192while arrayPos0 < arrayPos193DrawLine(object.xpos, object.ypos, object[arrayPos0].xpos, object[arrayPos0].ypos, 0xFF, 0xFF, 0x00)94arrayPos0++95loop9697editor.drawingOverlay = false98end if99end event100101102event RSDKLoad103LoadSpriteSheet("Global/Display.gif")104SpriteFrame(-8, -8, 16, 16, 168, 18) // "trigger" - #0105106SetVariableAlias(ALIAS_VAR_PROPVAL, "activateCount")107end event108109110