Closed thenimas closed 4 years ago
I'm guessing it saves the loaded HD Admin and then when you start the game again, it loads in again so there is two versions which break eachother?
Try placing the loader in ServerScriptService as apposed to Workspace
10:10:02 -- Could not create collision group, one with that name already exists. Stack Begin Script 'ReplicatedStorage.HDAdminClient.SharedModules.MainFramework.MainVariables', Line 92 - function SetupMainVariables Script 'Model.MainModule.Client.SharedModules.MainFramework', Line 276 - function Initialize Script 'Model.MainModule', Line 5 - function Initialize Script 'ServerScriptService.HD Admin.Settings.Loader', Line 13 Stack End
Essentially what is happening here is HD Admin is being initialised twice (this is due to the SavePlace/CreatePlace API which you ideally should not be using as its deprecated).
To solve this, in the Loader script...
Replace:
local loaderFolder = script.Parent.Parent
local mainModule = require(3239236979)
mainModule:Initialize(loaderFolder)
loaderFolder:Destroy()
With:
local loaderFolder = script.Parent.Parent
local mainModule = require(3239236979)
if not mainModule.Activated then
mainModule:Initialize(loaderFolder)
end
loaderFolder:Destroy()
So I added that, and the admin script showed similar behavior; loading the first time, and then being completely unresponsive on subsequent rejoinings, except with no output in console. The script appears to not have loaded twice, yet it still refuses to load.
After adding print statements to the HDAdminStarterPlayer script, it appears to hang when the Initalize() function is called.
-- << RETRIEVE FRAMEWORK >>
local main = require(game:GetService("ReplicatedStorage"):WaitForChild("HDAdminSetup")):GetMain(true)
print("main has been obtained")
main:Initialize("Client")
print("main has been initalized for client")
"main has been obtained" prints but not "main has been initialized for client".
As a sidenote, I actually had no idea CreatePlaceASync and SavePlaceASync were depreciated since they're not marked as such on the Developer wiki.
Can you setup a repo place for this please. V2 is typically not maintained anymore, although I'll see if I can add a quick fix for your issue.
My bad, I assumed you were referring to the old DataModel:xPlace methods, AssetService:CreatePlaceAsync
and AssetService:SavePlaceAsync
are fine to use!
By repo place you mean replicate the setup and add you as team create?
Essentially a watered down separate place with HD Admin and the bug you're experiencing. Don't worry about team create, that often causes addition issues.
Here it is. Just open StarterPlace.rbxl, read what it says in Workspace.README and you'll be all good I think.
I've setup the places and uncopylocked both, although keep receiving this error:
Start place: https://www.roblox.com/games/5448094062/thenimas-START-PLACE Template place: https://www.roblox.com/games/5448104669/thenimas-TEMPLATE
Are you familiar with this error? The only documentation on this appears to have been removed: https://wiki.roblox.com/index.php?title=Dynamic_place_creation_and_saving&redirect=no#Enabling_place_creation_and_saving
There's usually two possible causes for that error:
Cheers! I finally got round to fully testing. It appears the problem is an issue with your Reset pad, which meant your test place was not being updated to the new version of HD Admin with your fix.
Instead of calling
Data:SetAsync("current",nil) -- this will error
do:
Data:RemoveAsync("current")
There was also an additional error being thrown by the Reset pad. To fix both, simply replace your entire code within the Reset pad with:
local DataStoreService = game:GetService("DataStoreService")
local Data = DataStoreService:GetDataStore("BuildIDs")
local de = true
script.Parent.Touched:Connect(function(part)
if not de then
return
end
de = false
local plr = game.Players:GetPlayerFromCharacter(part.Parent)
if plr then
print("reset touched by ".. plr.Name)
local id = Data:GetAsync("current")
if id then
print("resetting created place.")
--Data:SetAsync("current",nil)
Data:RemoveAsync("current")
end
end
wait(3)
de = true
end)
(Apologies for taking so long to respond, I was having technical issues with my computer)
That doesn't seem to have fixed it. Maybe I was being unclear about my intent with this place: I wanted to use the Build Place as sort of a place where creations are stored semi-permanently. Again, when I used the ;save command ingame, and then rejoined, the admin still fails to load. The reset button was for debugging purposes (i.e if the place needed to be reset in order to update the admin).
My bad, turns out it was blindingly obvious - simply remove the loader:Destroy()
within the loader:
local loaderFolder = script.Parent.Parent
local mainModule = require(3239236979)
if not mainModule.Activated then
mainModule:Initialize(loaderFolder)
end
--loaderFolder:Destroy()
Previously the loader was being destroyed then saved, meaning on rejoin HD Admin was never required at all and initialised.
V2 was never really intended to be used for 'saveable' places therefore I recommend using with caution. I will explore truly supporting this ability (such as more robust cleanup) for v3
I'm trying to use HD admin in a building game that involves saving creations. Essentially, I've created a place using Create Place API for people to build in, which is then saved using Save Place API. When the place is first created, the Admin functions as normal. However, when the place is saved, then re-entered, the script completely breaks, and everything I've tried to hotfix it has been to no avail.
I'm not entirely sure if this sort of application is anything HD Admin was built for, but I just ask that this be looked into, and have Created Places be supported officially.