{"id":"nightcycle/local-package","name":"local-package","scope":"nightcycle","platform":"roblox","description":"using procedural models to create local packages","version":"0.1.0","latest":"0.1.0","versions":["0.1.0"],"license":"Apache-2.0","licenseRating":"safe","licenseCaveats":["Modified files must carry a notice of changes. If the package ships a NOTICE file, its attributions must be preserved."],"licenseVerified":true,"dependencies":{"nightcycle/index-util":{"version":"^3.1.0","alias":"IndexUtil"},"osyrisrblx/t":{"version":"^3.1.1","alias":"Type"}},"integrity":"0433715f36c84fb05a4a90ff9c3e097ea3204f06cf229d917380b30fa77274e0","likes":0,"downloads":0,"install":"forest install nightcycle/local-package","url":"https://forest.dev/p/roblox/nightcycle/local-package","files":"https://api.forest.dev/ai/package/roblox/nightcycle/local-package/files","readme":"# local-package\r\n\r\nUsing ProceduralModels to get flexible source referencing.\r\n\r\n## usage\r\n\r\nWithin the ProceduralModel set the ModuleScript to this:\r\n```luau\r\nreturn require(game.ReplicatedStorage.Packages.LocalPackage).Generator.new()\r\n```\r\n\r\nYou can also append to it. I recommend storing the edited version in some central location then having the modules require a constructor from there, instead of littering bespoke ModuleScripts throughout the workspace.\r\n```luau\r\nreturn function()\r\n\treturn require(game.ReplicatedStorage.Packages.LocalPackage).Generator.append({\r\n\t\tColor = Color3.new(1,0,0)\r\n\t}, function(generatedInstance: Model | BasePart, parameters: GenerationFunctionParams<DefaultAttributes & { Color: Color3 }>, targetContainer: GeneratedFolder)\r\n\t\tif generatedInstance:IsA(\"BasePart\") then\r\n\t\t\tgeneratedInstance.Color = parameters.Attributes.Color\r\n\t\tend\r\n\tend)\r\nend\r\n```\r\n\r\n## source configuration\r\n\r\nIn order to connect to a template you must use the \"SourcePath\" attribute, or whatever attribute you like as they're all configurable at `LocalPackage.ENV` as well as through the `_G` variable with a `__LOCALPACKAGE__` prefix. When a source is a folder it will randomly select a valid (any BasePart or Model) descendant. If you'd like to restrict an attribute, most can also be embedded into the source as an ovveride. It also supports a \"Size\" attribute and \"PivotOffset\" attribute for overriding the inputs regarding the placement math.\r\n","readmeTruncated":false}