Update cubzh.lua
Browse files
cubzh.lua
CHANGED
|
@@ -27,8 +27,8 @@ function spawnSquirrelAbovePlayer(player)
|
|
| 27 |
return squirrel
|
| 28 |
end
|
| 29 |
|
| 30 |
-
local SIMULATION_NAME = "
|
| 31 |
-
local SIMULATION_DESCRIPTION = "
|
| 32 |
|
| 33 |
|
| 34 |
local skills = {
|
|
@@ -226,75 +226,108 @@ local skills = {
|
|
| 226 |
end,
|
| 227 |
action_format_str = "{protagonist_name} summoned a flying squirrel! It's vibrating with excitement!",
|
| 228 |
},
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 229 |
}
|
| 230 |
|
| 231 |
local locations = {
|
| 232 |
-
|
| 233 |
-
|
| 234 |
-
|
| 235 |
-
|
| 236 |
-
|
| 237 |
-
|
| 238 |
-
|
| 239 |
-
|
| 240 |
-
|
| 241 |
-
|
| 242 |
-
|
| 243 |
-
|
| 244 |
-
{
|
| 245 |
-
name = "Center",
|
| 246 |
-
description = "Center point between the three islands.",
|
| 247 |
-
},
|
| 248 |
}
|
| 249 |
|
| 250 |
local NPCs = {
|
| 251 |
-
|
| 252 |
-
|
| 253 |
-
|
| 254 |
-
|
| 255 |
-
|
| 256 |
-
|
| 257 |
-
|
| 258 |
-
|
| 259 |
-
|
| 260 |
-
|
| 261 |
-
|
| 262 |
-
|
| 263 |
-
|
| 264 |
-
|
| 265 |
-
|
| 266 |
-
|
| 267 |
-
|
| 268 |
-
|
| 269 |
-
|
| 270 |
-
|
| 271 |
-
|
| 272 |
-
|
| 273 |
-
|
| 274 |
-
|
| 275 |
-
|
| 276 |
-
|
| 277 |
-
|
| 278 |
-
|
| 279 |
-
|
| 280 |
-
|
| 281 |
-
|
| 282 |
-
|
| 283 |
-
|
| 284 |
-
|
| 285 |
-
|
| 286 |
-
|
| 287 |
-
},
|
| 288 |
-
},
|
| 289 |
}
|
| 290 |
|
| 291 |
local gigaxWorldConfig = {
|
| 292 |
-
|
| 293 |
-
|
| 294 |
-
|
| 295 |
-
|
| 296 |
-
|
| 297 |
-
|
| 298 |
}
|
| 299 |
|
| 300 |
findLocationByName = function(targetName, config)
|
|
|
|
| 27 |
return squirrel
|
| 28 |
end
|
| 29 |
|
| 30 |
+
local SIMULATION_NAME = "Code Island Adventure" .. tostring(math.random())
|
| 31 |
+
local SIMULATION_DESCRIPTION = "An interactive coding adventure on floating islands."
|
| 32 |
|
| 33 |
|
| 34 |
local skills = {
|
|
|
|
| 226 |
end,
|
| 227 |
action_format_str = "{protagonist_name} summoned a flying squirrel! It's vibrating with excitement!",
|
| 228 |
},
|
| 229 |
+
{
|
| 230 |
+
name = "TEACH_LOOP",
|
| 231 |
+
description = "Teach the concept of looping in programming",
|
| 232 |
+
parameter_types = {"character"},
|
| 233 |
+
callback = function(client, action)
|
| 234 |
+
local npc = client:getNpc(action.character_id)
|
| 235 |
+
if not npc then print("Can't find npc") return end
|
| 236 |
+
|
| 237 |
+
dialog:create("Let's learn about loops! They help us repeat actions easily.", npc.avatar.Head)
|
| 238 |
+
Timer(3, function()
|
| 239 |
+
dialog:create("Imagine you're collecting treasures. Instead of writing 'collect treasure' 5 times, we can use a loop!", npc.avatar.Head)
|
| 240 |
+
end)
|
| 241 |
+
Timer(6, function()
|
| 242 |
+
dialog:create("It looks like this: for i = 1, 5 do collect_treasure() end", npc.avatar.Head)
|
| 243 |
+
end)
|
| 244 |
+
end,
|
| 245 |
+
action_format_str = "{protagonist_name} taught {target_name} about loops in programming."
|
| 246 |
+
},
|
| 247 |
+
{
|
| 248 |
+
name = "LOOP_DEMO",
|
| 249 |
+
description = "Demonstrate a loop visually",
|
| 250 |
+
parameter_types = {"character"},
|
| 251 |
+
callback = function(client, action)
|
| 252 |
+
local npc = client:getNpc(action.character_id)
|
| 253 |
+
if not npc then print("Can't find npc") return end
|
| 254 |
+
|
| 255 |
+
dialog:create("Watch this loop in action!", npc.avatar.Head)
|
| 256 |
+
for i = 1, 5 do
|
| 257 |
+
Timer(i, function()
|
| 258 |
+
local treasure = Shape(Items.pratamacam.squirrel) -- Using squirrel as "treasure" for demo
|
| 259 |
+
treasure.LocalScale = 0.3
|
| 260 |
+
treasure.Position = npc.object.Position + Number3(i*2, 5, 0)
|
| 261 |
+
World:AddChild(treasure)
|
| 262 |
+
dialog:create("Collected treasure " .. i .. "!", npc.avatar.Head)
|
| 263 |
+
end)
|
| 264 |
+
end
|
| 265 |
+
end,
|
| 266 |
+
action_format_str = "{protagonist_name} demonstrated a loop by collecting treasures."
|
| 267 |
+
}
|
| 268 |
}
|
| 269 |
|
| 270 |
local locations = {
|
| 271 |
+
{
|
| 272 |
+
name = "Code Island",
|
| 273 |
+
description = "A vibrant island filled with interactive coding elements.",
|
| 274 |
+
},
|
| 275 |
+
{
|
| 276 |
+
name = "Loop Lagoon",
|
| 277 |
+
description = "A beautiful lagoon where loops come to life.",
|
| 278 |
+
},
|
| 279 |
+
{
|
| 280 |
+
name = "Algorithm Archipelago",
|
| 281 |
+
description = "A chain of small islands, each representing a step in an algorithm.",
|
| 282 |
+
}
|
|
|
|
|
|
|
|
|
|
|
|
|
| 283 |
}
|
| 284 |
|
| 285 |
local NPCs = {
|
| 286 |
+
{
|
| 287 |
+
name = "npcteacher",
|
| 288 |
+
gameName = "Professor Loop",
|
| 289 |
+
physicalDescription = "Energetic, with wild hair and a colorful lab coat",
|
| 290 |
+
psychologicalProfile = "Enthusiastic and creative, loves to explain concepts through interactive demonstrations",
|
| 291 |
+
currentLocationName = "Code Island",
|
| 292 |
+
initialReflections = {
|
| 293 |
+
"Welcome to Code Island! I'm Professor Loop, and I'm excited to teach you about the magic of loops in programming!",
|
| 294 |
+
"Loops are like a merry-go-round of code. They help us do repetitive tasks without writing the same thing over and over.",
|
| 295 |
+
"I've set up some fun demonstrations around the island. Are you ready to dive in and explore the world of loops?",
|
| 296 |
+
},
|
| 297 |
+
},
|
| 298 |
+
{
|
| 299 |
+
name = "npcpirate",
|
| 300 |
+
gameName = "Captain Iterate",
|
| 301 |
+
physicalDescription = "Charismatic, with a glowing digital eyepatch and a keyboard for a peg leg",
|
| 302 |
+
psychologicalProfile = "Adventurous and outgoing, loves to challenge students with coding puzzles",
|
| 303 |
+
currentLocationName = "Loop Lagoon",
|
| 304 |
+
initialReflections = {
|
| 305 |
+
"Ahoy, code sailor! Welcome to Loop Lagoon, where we'll embark on a looping adventure!",
|
| 306 |
+
"Ye see, loops be the secret to efficient coding. They be like a treasure map that tells ye to dig in the same spot multiple times!",
|
| 307 |
+
"Ready to set sail and loop around some coding challenges?",
|
| 308 |
+
},
|
| 309 |
+
},
|
| 310 |
+
{
|
| 311 |
+
name = "npcexplorer",
|
| 312 |
+
gameName = "Dr. Algo",
|
| 313 |
+
physicalDescription = "Curious and observant, with a magnifying glass and a notebook full of algorithms",
|
| 314 |
+
psychologicalProfile = "Analytical and imaginative, enjoys breaking down complex concepts into simple steps",
|
| 315 |
+
currentLocationName = "Algorithm Archipelago",
|
| 316 |
+
initialReflections = {
|
| 317 |
+
"Greetings, fellow code explorer! Welcome to the Algorithm Archipelago!",
|
| 318 |
+
"Here, we'll discover how loops fit into larger algorithms. It's like piecing together a grand puzzle!",
|
| 319 |
+
"Each island represents a step in our algorithm. Shall we embark on this looping journey together?",
|
| 320 |
+
},
|
| 321 |
+
}
|
|
|
|
|
|
|
| 322 |
}
|
| 323 |
|
| 324 |
local gigaxWorldConfig = {
|
| 325 |
+
simulationName = SIMULATION_NAME,
|
| 326 |
+
simulationDescription = SIMULATION_DESCRIPTION,
|
| 327 |
+
startingLocationName = "Code Island",
|
| 328 |
+
skills = skills,
|
| 329 |
+
locations = locations,
|
| 330 |
+
NPCs = NPCs,
|
| 331 |
}
|
| 332 |
|
| 333 |
findLocationByName = function(targetName, config)
|