Code Monkey home page Code Monkey logo

prefabs's People

Contributors

vocksel avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

Forkers

jjx003

prefabs's Issues

Add support for variants

This would allow us to take an existing prefab and modify it to create a variant of the base prefab.

We can technically do this right now, but having a feature to group a variant with the base would be good, as well as having a method for easily swapping between variants.

Add option to disable support for the Tag Editor

This is a slightly intrusive behavior. Whether or not you have the Tag Editor installed, this plugin will create the folders TagList and TagGroupList under ServerStorage. TagList is then propagates with the corresponding tag for each added/updated prefab.

It would be nice to add this as a checkbox in the options menu detailed in #52, so that the user can choose to opt out of this behavior.

(Also later on down the line we should add support for cleaning up all the prefab tags, and adding them back in if the user opts in again)

Add an API to delete prefabs

We have APIs for registering, updating, and renaming, but not to remove a prefab.

Removal of a prefab can be done manually by deleting it from the folder in ServerStorage, but if any tags were picked up by the tag editor (which we'll be handling automatically in the future, see: #16), this can leave some garbage behind.

A simple delete(prefab) and deleteSelection() API would take care of both removing the prefab model and the tag associated with it.

A deleteClones() API (or similar) would also be good to have. This would take care of deleting any copies of the prefab from the Workspace, as well as ServerStorage.

Make tag cleanup automatic

Using GetInstanceRemovedSignal we can listen for a prefab being removed. When all prefabs of the same type are removed we can remove the tag as well.

Right now we have a manual clean function in the API that will remove the tag on all prefabs of the same type. This is a use case we don't really need. I can't see the user wanting to unlink all of one prefab.

Add a setting to make all PrimaryParts the same color

Just a small addition. It would be nice to have a way to keep all PrimaryParts a single consistent color, as I always make them a hot pink so they're clearly visible. Having an option to make it the same color every time (instead of "eh close enough") would just be a nice little change I want to see

Add a way to rename prefabs

This would be a simple API that allows you to take an existing prefab and reassign its tag.

Usage:

_G.prefabs.rename("existing", "new-name")

Where every prefab that was registered with the name existing will then be changed to new-name. This change will also be applied to all prefabs with the same name.

Add support for renaming tags

Specifically with the Tag Editor plugin. Now that we have support for registering tags with it, we need a way to remove those tags when a prefab is renamed and its tag changes. This will likely be able to use the same functionality as #29

Add effects when actions are performed

The terrain editor has a nice "pop" effect when you delete/paste. Having a similar effect when a prefab is updated/deleted could add some nice flair to the plugin

Allow new prefabs to be easily registered

Currently when you create a new model you have to manually tag it and add it to the folder where all your prefabs are.

This should be streamlined to allow the user to press a key or use a plugin button to quickly register the prefab. Registering would be a simple TextBox prompt to give it a name for the tag, and off it goes.

Overhaul toasts

  • Strip out filename and line number from error messages
  • Add a close button
  • Do not auto-hide a toast when it is hovered
  • Dynamically scale height based off the message
  • Add a sound effect for popup
  • Add a sound effect for closing
  • Color toasts based on success/error

Allow prefabs to be used inside of each other

Currently, it's impossible to use prefabs inside of each other. The best you have is to copy/paste an existing prefab into a larger one, but that defeats the purpose of the reusability this plugin brings.

Allowing small compositional prefabs (trees, lamps, benches) to be used in larger models would be a welcome addition

Implement hot reloading

The development flow should be the same as the UnicodeVisualizerPlugin:

  1. Install Rojo and Hotswap.
  2. Install dependencies via git submodule update --init.
  3. Create a new place.
  4. Set HTTP enabled in the Game Settings window.
  5. Sync using Rojo.
  6. Set the hotswap target to ReplicatedStorage.UnicodeVisualizerPlugin by selecting it in Studio and opening the Hotswap window.
  7. Enter play solo.
  8. In play solo, you can sync or toggle polling to update as you edit. It will hot reload without having to restart play solo.

The only thing we're missing is hot reloading, which would make development a much less painful experience. Our current workflow involves syncing in once, saving and exiting the place, and reloading the place for Local Plugins to reload everything.

Add an options interface

Currently the user has no way to configure anything about how the plugin behaves.

What we release now is hands off enough where this is okay, but if we are to reintroduce the now removed functionality of making PrimaryParts invisible and disabling collisions on them, we would need an options menu.

It just needs to be a simple list, similar to Studio's settings menu with a name field and check box on the right. I think that'd be plenty for us for right now

Add support for per-prefab modifications

Back when the prefab system was changed to use models instead of placeholder parts+models, I had to remove the option to modify an individual prefab (just in the form of changing its scale)

This was due to not having a way of associating configurable values with the cloned in prefabs, since the clone just erases the one that was there.

Adding back scale isn't much of a priority, but we do need a solution for being able to modify individual prefabs, especially if we want more per-prefab features in the.

Something like adding a Configuration instance to a prefab in the workspace would be good. But making sure that doesn't get erased will be a little tricky, since right now we just clone a new copy of the source prefab each time an update occurs.

Consider disabling intrusive primaryPart behaviors

This is a matter of portability and instrusivness:

Some creators may have existing models they wish to convert to prefabs. These models may have a crucial visible PrimaryPart already defined in their model. Instead of encouraging wrapping these models with an ancestor Model, it would be nice if the Transparency + CanCollide off behavior was a configuration set by the developer.

Rename should be a part of Update

Instead of giving Rename its own dedicated button, merge its functionality into Update so that when you change the name of a prefab, pressing Update will replicate that change.

Remove the use of placeholder Parts

These have been problematic since I started the plugin. They have a lot of issues currently, most notably #11. They also don't provide you any visuals unless you're viewing all your prefabs.

I think it would be much less problematic and overall a better experience if the placeholder parts were removed in favor of just copy/pasting prefabs around the map. When needed, these prefabs can then be swapped out for updated ones from a single source, like we're doing now (just without the placeholders).

Add support for scaling on a per-prefab basis

A NumberValue could be added to any placeholder for a prefab. The value would determine how much the prefab gets scaled up/down when it's added to the workspace.

This would remove a lot of the uniformity with the current implementation, as all your models won't be the same size when added in.

It uses the value as a percentage of how much to change the scale, and will expand/contract away from or towards the placeholder, respectively (i.e. it won't scale towards the center, which would mess with the offset of its placement)

Add a way to easily edit prefabs

Currently, prefabs have to be stored in the Workspace to easily edit them. But this also means you have to fly all the way over to where your prefabs are, which is a major time sink.

The ideal setup is having your prefabs folder under ServerStorage and being able to quickly load a prefab at your camera to edit. After editing, you can choose to save or cancel your changes. Afterwards, if there were any saved changes, the prefab overrides the existing one in ServerStorage.

Add a README

Mostly a reminder for myself so I actually write up some docs later

Add quick placing of prefabs

Right now you have to copy/paste prefabs around the map manually, either by finding an existing on in the workspace or using the base prefab in ServerStorage.

It would be a lot more convenient if you could insert a new copy of the prefab and have it follow the mouse to choose where you place it.

Add notification UI when something succeeds

Currently the user has no feedback (other than some prints) when the action they performed succeeds.

It would be helpful to display a notification when an action is successfully completed, such as registering or updating a prefab.

Will this finally be the introduction of Roact?

Remove the toggle button

update and updateWithSelection are new additions which allow you to update a prefab (and all the existing clones) with a new model. Prior to this we've been using the toggle button (which should have been renamed to "refresh" a while back) which updates all prefab clones with the ones in ServerStorage.

This causes a massive slowdown in larger maps with lots of prefabs, as it has to update everything at once. The new update functions only update the single model, which is almost always more desirable.

Fix placeholders being permanently deleted

#9 introduced a bug where placeholders can be deleted with no way to get them back. I'm not sure on the specifics of this yet but I'm thinking it's something to do with the the prefab-to-placeholder link getting broken in some way, leading to the plugin removing placeholders when it shouldn't.

For the time being I think it's safest to disable any deletion of placeholders, especially until we have ChangeHistoryService integration.

Add support for deleting tags

We now have support for creating the tags and tag groups for the Tag Editor plugin, but we don't have a method of cleaning that up yet.

Tack on support for deleting the TagList entries in the delete APIs so that there's no tags lingering around when a prefab is removed.

Strip any existing prefab tags when registering a prefab again

There are times where you want to make variants of your prefabs. To do this currently you have to manually remove the existing prefab tag before you can register the prefab as a new one.

Stripping the tag would make it quick and easy to edit and register a variant of a prefab.

Add UI for inserting

This will create an interface for the prefabs.insert function.

It's very painful to insert a prefab as you have to know the name off hand, or you have to dig through ServerStorage to find the prefab you're looking for.

Needed features:

  • Lists all of the prefabs
  • Uses the physical model in the UI to show which prefabs you have available

For later:

  • Immediately selects a TextBox that will fuzzyfind as you start typing

Only refresh prefabs that change

Right now you have to refresh every prefab in the entire game to get your changes synced.

Instead we should have a way to edit a prefab, and then update all prefabs of the same type with those changes.

The flow should be:

  • Select a prefab (either the base one or any clone)
  • With it selected, press a "Refresh" button that will use the edited model as the base prefab

Fix not being able to rename and register a prefab

  • Create a prefab
  • Register it
  • Rename it
  • Register again

Expected result:

  • The model is registered as a prefab

Actual result:

  • The plugin errors, claiming the prefab already exists.

There's some internally that's wrong. We should be stripping any existing prefab tag and re-registering the model when the name doesn't match one with the same name.

Allow updating a prefab by selecting any descendant

Small quality of life change: being able to update all prefabs of the same type by selecting a descendant of the prefab you want to update.

Right now you have to make sure you select the prefab model when you update, otherwise it won't go through. While editing a model, you don't have the model itself selected. Being able to edit a prefab and update it without having to change selections would be a nice tedium fix

Add button for updating

This will give a proper interface to the prefabs.updateWithSelection function.

It will essentially be the same thing as running the command, but you'll be able to press a button instead.

Add support for the Tag Editor plugin

The Tag Editor is the defacto tool for dealing with CollectionService tags.

It exposes folders in ServerStorage where it keeps all of the tags it has access to. If the user has the plugin installed, we can retroactively add created prefab tags to this folder when registering new prefabs.

We can also create a group for the created tags so they don't clutter the user's existing tags.

Decouple cloned models from the placeholder parts

When prefabs are shown, each one is cloned inside of the placeholder part that represents the prefab.

This is a bad practice for a number of reasons. The biggest problem is Roblox's default grabber tools in Studio can overlook the part and move only the model inside. This ends up repositioning the model, but the placeholder is still in its last position. When you toggle your prefabs, the one you moved ends up at its previous position unexpectedly.

Overall it's a hacky implementation and we can do better. The new proposed implementation will involve moving the placeholders out of the workspace, and using ObjectValues to map a prefab to its associated placeholder.

A problem with this implementation is we won't get movement for free. Moving a model while its shown will now always move it back to the placeholder position. You'll be forced to move the placeholder itself. This will need a separate issue to sync the model with the placeholder.

Todo

Showing:

  • Move all the placeholders out of the workspace.
  • For each placeholder:
    • Move it to a folder in ServerStorage.
    • Clone in the prefab the placeholder represents.
    • Create an ObjectValue mapping the placeholder to the newly cloned prefab.

Hiding:

  • Set the CFrame of each placeholder to the PrimaryPart CFrame of its associated model.

  • Clean up all the garbage from showing the prefabs.

  • If the ObjectValue's Value is missing, delete the placeholder.

  • Remove the addition of changing CanCollide on placeholder parts (db4cbd5). Since they no longer exist in the workspace there's no need to mess around with their collisions.

Preview prefabs above the placeholder

This could come in the form of a bounding box above the placeholder that shows the size of the Model it represents.

Really anything to give a quick visual representation of what the placeholder is going to take up when switching to the prefab view.

Fix inserted prefabs going inside other parts

This can be remedied with the animation editor's code for inserting rigs:

function getCameraLookat(maxRange)
	if maxRange == nil then maxRange = 10 end
	local cam = game.Workspace:findFirstChild("Camera")
	if cam then
		local ray = Ray.new(cam.CFrame.p, cam.CFrame.lookVector * maxRange)
		local hit, pos = game.Workspace:FindPartOnRay(ray)
		cam.Focus = CFrame.new(pos)
		return pos
	else
		--Default position if they did weird stuff
		print("Unable to find default camera.")
		return Vector3.new(0,5.2,0)
	end
end

And using it like:

rig:MoveTo(getCameraLookat(10))

Where rig would just be the prefab.

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.