-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathScramble Chip Rack.py
More file actions
115 lines (87 loc) · 2.46 KB
/
Scramble Chip Rack.py
File metadata and controls
115 lines (87 loc) · 2.46 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
import RLPy
import random
def RotateChip(chipName):
#-- Loop through props --#prop
prop = RLPy.RScene.FindObject(RLPy.EObjectType_Prop, chipName)
#-- Get Transform Control and Data --#
ts_control = prop.GetControl("Transform")
ts_data_block = ts_control.GetDataBlock()
# hard coded for now #
randomValue = random.randint(101771, 124193) % 59 - 29;
print(randomValue)
#-- Set Rotation Z = by a random amount
ts_data_block.SetData("Rotation/RotationZ", RLPy.RTime(0), RLPy.RVariant(randomValue * RLPy.RMath.CONST_DEG_TO_RAD))
# Red Chips #
sum = 0
n = 82
propName = "RedChip"
chipName = ""
for counter in range(2, n+1):
if (counter != 51):
chipName = propName + str(counter)
print ("attempting to rotate " + chipName)
RotateChip(chipName)
sum += 1
# show a message #
print("Rotated " + str(sum) + " Red Chips.");
# Black Chips #
sum = 0
n = 50
propName = "BlackChip"
chipName = ""
for counter in range(2, n+1):
chipName = propName + str(counter)
print ("attempting to rotate " + chipName)
RotateChip(chipName)
sum += 1
# show a message #
print("Rotated " + str(sum) + " Black Chips.");
# Purple Chips #
sum = 0
n = 30
propName = "PurpleChip"
chipName = ""
for counter in range(2, n+1):
chipName = propName + str(counter)
print ("attempting to rotate " + chipName)
RotateChip(chipName)
sum += 1
# show a message #
print("Rotated " + str(sum) + " Purple Chips.");
# Gold Chips #
sum = 0
n = 20
propName = "GoldChip"
chipName = ""
for counter in range(2, n+1):
chipName = propName + str(counter)
print ("attempting to rotate " + chipName)
RotateChip(chipName)
sum += 1
# show a message #
print("Rotated " + str(sum) + " Gold Chips.");
# White Chips #
sum = 0
n = 50
propName = "WhiteChip"
chipName = ""
for counter in range(2, n+1):
chipName = propName + str(counter)
print ("attempting to rotate " + chipName)
RotateChip(chipName)
sum += 1
# show a message #
print("Rotated " + str(sum) + " White Chips.");
# Green Chips #
sum = 0
n = 82
propName = "GreenChip"
chipName = ""
for counter in range(2, n+1):
if (counter != 51):
chipName = propName + str(counter)
print ("attempting to rotate " + chipName)
RotateChip(chipName)
sum += 1
# show a message #
print("Rotated " + str(sum) + " Green Chips.");