Spaces:
Running
Running
Corentin Cailleaud
commited on
Commit
•
d9c9227
1
Parent(s):
b064e25
cubzh.lua
CHANGED
@@ -723,23 +723,26 @@ Client.OnWorldObjectLoad = function(obj)
|
|
723 |
if obj.Name == "pirate_ship" then
|
724 |
obj.Scale = 1
|
725 |
end
|
726 |
-
|
727 |
-
|
728 |
-
|
729 |
-
|
730 |
-
|
731 |
-
|
732 |
-
|
733 |
-
|
734 |
-
|
735 |
-
|
736 |
-
|
737 |
-
|
738 |
-
|
739 |
local pos = obj.Position:Copy()
|
740 |
-
gigaxWorldConfig.
|
741 |
-
gigaxWorldConfig.NPCs[
|
742 |
-
|
|
|
|
|
|
|
743 |
obj:RemoveFromParent()
|
744 |
end
|
745 |
end
|
@@ -782,7 +785,7 @@ Client.OnStart = function()
|
|
782 |
pathfinding:createPathfindingMap()
|
783 |
|
784 |
gigax:setConfig(gigaxWorldConfig)
|
785 |
-
|
786 |
local randomNames = { "aduermael", "soliton", "gdevillele", "caillef", "voxels", "petroglyph" }
|
787 |
Player.Avatar:load({ usernameOrId = randomNames[math.random(#randomNames)] })
|
788 |
end
|
|
|
723 |
if obj.Name == "pirate_ship" then
|
724 |
obj.Scale = 1
|
725 |
end
|
726 |
+
|
727 |
+
local locationsIndexByName = {}
|
728 |
+
for k, v in ipairs(gigaxWorldConfig.locations) do
|
729 |
+
locationsIndexByName[v.name] = k
|
730 |
+
end
|
731 |
+
local npcIndexByName = {
|
732 |
+
NPC_scientist = 1,
|
733 |
+
NPC_baker = 2,
|
734 |
+
NPC_pirate = 3,
|
735 |
+
}
|
736 |
+
|
737 |
+
local index = npcIndexByName[obj.Name]
|
738 |
+
if index then
|
739 |
local pos = obj.Position:Copy()
|
740 |
+
gigaxWorldConfig.NPCs[index].position = pos
|
741 |
+
gigaxWorldConfig.NPCs[index].rotation = obj.Rotation:Copy()
|
742 |
+
|
743 |
+
local locationName = gigaxWorldConfig.NPCs[index].currentLocationName
|
744 |
+
local locationIndex = locationsIndexByName[locationName]
|
745 |
+
gigaxWorldConfig.locations[locationIndex].position = pos
|
746 |
obj:RemoveFromParent()
|
747 |
end
|
748 |
end
|
|
|
785 |
pathfinding:createPathfindingMap()
|
786 |
|
787 |
gigax:setConfig(gigaxWorldConfig)
|
788 |
+
|
789 |
local randomNames = { "aduermael", "soliton", "gdevillele", "caillef", "voxels", "petroglyph" }
|
790 |
Player.Avatar:load({ usernameOrId = randomNames[math.random(#randomNames)] })
|
791 |
end
|