Corentin Cailleaud commited on
Commit
3d3b96f
1 Parent(s): 5b12f63
Files changed (1) hide show
  1. cubzh.lua +15 -12
cubzh.lua CHANGED
@@ -27,6 +27,9 @@ end
27
  easy_onboarding.next = function(self)
28
  steps[currentStep].stop(self, stopCallbackData)
29
  currentStep = currentStep + 1
 
 
 
30
  stopCallbackData = steps[currentStep].start(self, currentStep)
31
  end
32
 
@@ -515,7 +518,7 @@ local skills = {
515
  print("Can't find npc")
516
  return
517
  end
518
- dialog:create(action.content, npc.avatar)
519
  print(string.format("%s: %s", npc.name, action.content))
520
  end,
521
  action_format_str = "{protagonist_name} said '{content}' to {target_name}",
@@ -532,13 +535,13 @@ local skills = {
532
  return
533
  end
534
  local npc = client:getNpc(action.character_id)
535
- dialog:create("I'm going to " .. targetName, npc.avatar)
536
  print(string.format("%s: %s", npc.name, "I'm going to " .. targetName))
537
  local origin = Map:WorldToBlock(npc.object.Position)
538
  local destination = Map:WorldToBlock(targetPosition) + Number3(math.random(-1, 1), 0, math.random(-1, 1))
539
  local canMove = pathfinding:moveObjectTo(npc.object, origin, destination)
540
  if not canMove then
541
- dialog:create("I can't go there", npc.avatar)
542
  return
543
  end
544
  end,
@@ -555,7 +558,7 @@ local skills = {
555
  return
556
  end
557
 
558
- dialog:create("<Greets you warmly!>", npc.avatar)
559
  print(string.format("%s: %s", npc.name, "<Greets you warmly!>"))
560
 
561
  npc.avatar.Animations.SwingRight:Play()
@@ -573,7 +576,7 @@ local skills = {
573
  return
574
  end
575
 
576
- dialog:create("<Jumps in the air!>", npc.avatar)
577
  print(string.format("%s: %s", npc.name, "<Jumps in the air!>"))
578
 
579
  npc.object.avatarContainer.Physics = PhysicsMode.Dynamic
@@ -595,7 +598,7 @@ local skills = {
595
  return
596
  end
597
 
598
- dialog:create("I'm following you", npc.avatar)
599
  print(string.format("%s: %s", npc.name, "I'm following you"))
600
 
601
  followHandler = pathfinding:followObject(npc.object, Player)
@@ -620,11 +623,11 @@ local skills = {
620
  end
621
 
622
  require("explode"):shapes(npc.avatar)
623
- dialog:create("*boom*", npc.avatar)
624
  --print(string.format("%s: %s", npc.name, "EXPLODING"))
625
  npc.avatar.IsHidden = true
626
  Timer(5, function()
627
- dialog:create("Aaaaand... I'm back!", npc.avatar)
628
  npc.avatar.IsHidden = false
629
  end)
630
  end,
@@ -643,7 +646,7 @@ local skills = {
643
  shape.Scale = 4
644
  Player:EquipRightHand(shape)
645
 
646
- dialog:create("Here is an apple for you!", npc.avatar)
647
  end,
648
  action_format_str = "{protagonist_name} gave you a piece of bread!"
649
  },
@@ -656,7 +659,7 @@ local skills = {
656
  if not npc then print("Can't find npc") return end
657
 
658
  npc.object.Scale = npc.object.Scale * 2
659
- dialog:create("I am taller than you now!", npc.avatar)
660
  end,
661
  action_format_str = "{protagonist_name} doubled his height!"
662
  },--]]
@@ -677,7 +680,7 @@ local skills = {
677
  end)
678
  Player:EquipHat(obj)
679
  end)
680
- dialog:create("Let's get the party started!", npc.avatar)
681
  end,
682
  action_format_str = "{protagonist_name} gave you a piece of bread!",
683
  },
@@ -693,7 +696,7 @@ local skills = {
693
  end
694
 
695
  local squirrel = spawnSquirrelAbovePlayer(Player)
696
- dialog:create("Wooh, squirrel!", npc.avatar)
697
  -- make it disappear after a while
698
  Timer(5, function()
699
  squirrel:RemoveFromParent()
 
27
  easy_onboarding.next = function(self)
28
  steps[currentStep].stop(self, stopCallbackData)
29
  currentStep = currentStep + 1
30
+ if not steps[currentStep] then
31
+ return
32
+ end
33
  stopCallbackData = steps[currentStep].start(self, currentStep)
34
  end
35
 
 
518
  print("Can't find npc")
519
  return
520
  end
521
+ dialog:create(action.content, npc.avatar.Head)
522
  print(string.format("%s: %s", npc.name, action.content))
523
  end,
524
  action_format_str = "{protagonist_name} said '{content}' to {target_name}",
 
535
  return
536
  end
537
  local npc = client:getNpc(action.character_id)
538
+ dialog:create("I'm going to " .. targetName, npc.avatar.Head)
539
  print(string.format("%s: %s", npc.name, "I'm going to " .. targetName))
540
  local origin = Map:WorldToBlock(npc.object.Position)
541
  local destination = Map:WorldToBlock(targetPosition) + Number3(math.random(-1, 1), 0, math.random(-1, 1))
542
  local canMove = pathfinding:moveObjectTo(npc.object, origin, destination)
543
  if not canMove then
544
+ dialog:create("I can't go there", npc.avatar.Head)
545
  return
546
  end
547
  end,
 
558
  return
559
  end
560
 
561
+ dialog:create("<Greets you warmly!>", npc.avatar.Head)
562
  print(string.format("%s: %s", npc.name, "<Greets you warmly!>"))
563
 
564
  npc.avatar.Animations.SwingRight:Play()
 
576
  return
577
  end
578
 
579
+ dialog:create("<Jumps in the air!>", npc.avatar.Head)
580
  print(string.format("%s: %s", npc.name, "<Jumps in the air!>"))
581
 
582
  npc.object.avatarContainer.Physics = PhysicsMode.Dynamic
 
598
  return
599
  end
600
 
601
+ dialog:create("I'm following you", npc.avatar.Head)
602
  print(string.format("%s: %s", npc.name, "I'm following you"))
603
 
604
  followHandler = pathfinding:followObject(npc.object, Player)
 
623
  end
624
 
625
  require("explode"):shapes(npc.avatar)
626
+ dialog:create("*boom*", npc.avatar.Head)
627
  --print(string.format("%s: %s", npc.name, "EXPLODING"))
628
  npc.avatar.IsHidden = true
629
  Timer(5, function()
630
+ dialog:create("Aaaaand... I'm back!", npc.avatar.Head)
631
  npc.avatar.IsHidden = false
632
  end)
633
  end,
 
646
  shape.Scale = 4
647
  Player:EquipRightHand(shape)
648
 
649
+ dialog:create("Here is an apple for you!", npc.avatar.Head)
650
  end,
651
  action_format_str = "{protagonist_name} gave you a piece of bread!"
652
  },
 
659
  if not npc then print("Can't find npc") return end
660
 
661
  npc.object.Scale = npc.object.Scale * 2
662
+ dialog:create("I am taller than you now!", npc.avatar.Head)
663
  end,
664
  action_format_str = "{protagonist_name} doubled his height!"
665
  },--]]
 
680
  end)
681
  Player:EquipHat(obj)
682
  end)
683
+ dialog:create("Let's get the party started!", npc.avatar.Head)
684
  end,
685
  action_format_str = "{protagonist_name} gave you a piece of bread!",
686
  },
 
696
  end
697
 
698
  local squirrel = spawnSquirrelAbovePlayer(Player)
699
+ dialog:create("Wooh, squirrel!", npc.avatar.Head)
700
  -- make it disappear after a while
701
  Timer(5, function()
702
  squirrel:RemoveFromParent()