[v.17.6] SimpleComplete | General scripting plugin

There should be a setting that makes ModuleScripts that are descendants of a Script with a RunContext of Client or LocalScript unable to be required by the server. Vice versa for ModuleScripts that are descendants of a Script with a RunContext of Legacy/Server.

This can probably be easily implemented with a :FindFirstAncestorWhichIsA() check.

This would probably be most useful to people who are using module loaders and/or want to have two ModuleScripts with the same name.

1 Like

Idk the viability of this cuz you can set ModuleAncestors to be script-relative instead of game-relative

So like if you set the local setting of ModuleAncestors to script, it’d get all the modules under the currrently opened script

1 Like

most of the work is done through an .Init function (or something equivalent) in the module itself, meaning most of the coding takes place in the module and not the script

script.Parent might work though

k, instead of my previous option it would probably be better if you could set specific modules to certain contexts through tags

script relative doesn’t exactly work if you had both initiator scripts in replicatedstorage and modules in serverscriptservice for example

being able to autocomplete client modules on the server is pretty annoying so there should be some option to prevent this

Yeah the script relative ModuleAncestor works for modulescripts too, why wouldnt it

Yeah script.Parent is a valid ModuleAncestor entry

Yea i can do that

I feel like this is just bad practice, ig i can add computed values for ancestors tho (like --?module-ancestors {game.ServerScriptService[@self.Name]}) so u can use stuff with a specific name

Idk bro there isn’t really a good way to distinguish client modules other than tags since you can design your game in any way, maybe you have your client modules all fragmented or everywhere for example

1 Like

Yeah, tags would work, ancestor and individual

1 Like

Honestly Roblox should just add a RunContext-esque option for modulescripts

I’ll add a ModuleAncestorsExcluded setting to go along with ModuleExcludeTag aswell as a ModuleIncludeTag, also I just thought of a genius idea, what if scripts can only import modules with a ModuleIncludeTag if the script also has that tag?

E.g let’s say I wanna require ModuleA from ScriptA, ModuleA has a ModuleIncludeTag of “Foo”, but ScriptA doesn’t so it isn’t autocompleted, but if you add the ModuleIncludeTag to ScriptA now it can import it

1 Like

This doesn’t really solve the current problem but yeah should be implemented

There should be a way to determine if a module is a client module then only allow you to autocomplete it if you’re on the client

Honestly, this should probably be a setting, having to set it in the script you’re working on sounds like a hassle

1 Like

The ModuleIncludeTag would fix this, simply add a Client tag to your requiring script and your module and it’ll include it

I should probably make ModuleIncludeTag a list like ModuleAncestors is, so you can have multiple tags, each tag essentially being a “group” of modules which can autoimport eachother

1 Like

Oh yeah you cooked, sounds perfect actually.

1 Like

Patch 16.8

  • Added the ModuleIncludeTag setting which is Server, Client by default, if you tag 2 LuaSourceContainers with one of the tags, they are able to autoimport eachother (if the other is a ModuleScript)
1 Like

Do you plan to add support for setting this to ancestors later?

I mean yeah I can do that, but you still have to add the tag to your requiring script anyway so I think ModuleIncludeTag will suffice

Both scripts are under folders lol

How would I know what folder to use? Maybe the closest one to the module, maybe the one above that, maybe the first one with the tag (this would be really slow if you have alot of tags, i have to traverse the ancestor tree for each one), i dunno it just seems way too specific

1 Like

Guess it’s time for ModuleIncludeSearchMode (“Children” | “Descendants”)

This is getting a less simple every moment…

Wdym by this, wouldn’t I just apply the tag to both folders and be able to require everything in said folder?

1 Like

That’s what ModuleAncestorTag is for bro… ModuleSearchMode can be set to children

ok i mixed up my words there

If I applied ModuleIncludeAncestorTag to a singular folder, would I only be able to require things in that folder? Or would I also be able to ALSO require everything that doesn’t have the ModuleIncludeTag tag at all, aka global modules?

ModuleIncludeSearchMode would determine if ModuleIncludeAncestorTag only searched the children of objects that have the tag or descendants of objects that have the tag. I don’t think it should be the same as ModuleSearchMode considering people may want to check the descendants of instances in a service.

You would be able to require everything inside of it

You know I could probably add another value for ModuleSearchMode like useIncludeTag which uses the ModuleIncludeTags setting but only inside the ancestor

1 Like