Giter Club home page Giter Club logo

Comments (14)

Lucke0051 avatar Lucke0051 commented on May 27, 2024

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?

from core.

1ForeverHD avatar 1ForeverHD commented on May 27, 2024

Try placing the loader in ServerScriptService as apposed to Workspace

from core.

thenimas avatar thenimas commented on May 27, 2024

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

from core.

1ForeverHD avatar 1ForeverHD commented on May 27, 2024

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...

image

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()

from core.

thenimas avatar thenimas commented on May 27, 2024

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.

from core.

1ForeverHD avatar 1ForeverHD commented on May 27, 2024

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!

from core.

thenimas avatar thenimas commented on May 27, 2024

By repo place you mean replicate the setup and add you as team create?

from core.

1ForeverHD avatar 1ForeverHD commented on May 27, 2024

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.

from core.

thenimas avatar thenimas commented on May 27, 2024

HDAdminSaveAsyncRepo.zip

Here it is. Just open StarterPlace.rbxl, read what it says in Workspace.README and you'll be all good I think.

from core.

1ForeverHD avatar 1ForeverHD commented on May 27, 2024

I've setup the places and uncopylocked both, although keep receiving this error:
image

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

from core.

thenimas avatar thenimas commented on May 27, 2024

There's usually two possible causes for that error:

  • TemplatePlace is not a member of StartPlace's Game Universe.
  • You need to enable Create Place API and Save Place API in TemplatePlace (located under Configure Place, then Games).

from core.

1ForeverHD avatar 1ForeverHD commented on May 27, 2024

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)

from core.

thenimas avatar thenimas commented on May 27, 2024

(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).

from core.

1ForeverHD avatar 1ForeverHD commented on May 27, 2024

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

from core.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.