Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
rubberduckycooly
GitHub Repository: rubberduckycooly/Sonic-1-Sonic-2-2013-Script-Decompilation
Path: blob/master/Sonic 2/Scripts/SCZ/ObjectActivator.txt
1478 views
1
// ----------------------------------
2
// RSDK Project: Sonic 2
3
// Script Description: Object Activator Object
4
// Script Author: Christian Whitehead/Simon Thomley
5
// Unpacked by Rubberduckycooly's script unpacker
6
// ----------------------------------
7
8
// Object Name is a bit general, while yes this does indeed activate objects,
9
// it's used pretty much only for triplets of Nebulas since they should all by synced together
10
11
// ========================
12
// Aliases
13
// ========================
14
15
private alias object.propertyValue : object.activateCount
16
17
18
// ========================
19
// Events
20
// ========================
21
22
event ObjectUpdate
23
// Activate some following objects
24
25
arrayPos0 = object.entityPos
26
arrayPos0++
27
28
temp0 = 0
29
30
while temp0 < object.activateCount
31
object[arrayPos0].priority = PRIORITY_ACTIVE
32
arrayPos0++
33
temp0++
34
loop
35
36
// Clear this object, it's no longer needed
37
object.type = TypeName[Blank Object]
38
end event
39
40
41
// ========================
42
// Editor Events
43
// ========================
44
45
event RSDKDraw
46
DrawSprite(0)
47
48
if editor.showGizmos == true
49
// draw a line to the objects that'll be activated
50
51
temp0 = 0
52
arrayPos1 = object.entityPos
53
while temp0 < object.activateCount
54
arrayPos1++
55
DrawLine(object.xpos, object.ypos, object[arrayPos1].xpos, object[arrayPos1].ypos, 0xFF, 0xFF, 0x00)
56
temp0++
57
loop
58
end if
59
end event
60
61
62
event RSDKLoad
63
LoadSpriteSheet("Global/Display.gif")
64
SpriteFrame(-8, -8, 16, 16, 168, 18) // "Trigger" - #0
65
66
SetVariableAlias(ALIAS_VAR_PROPVAL, "activateCount")
67
end event
68
69