pickleplayer Posted February 11, 2021 Share Posted February 11, 2021 I'm no stranger to editing components, but I recently realized that one of the files in the components folder, "map.lua" seems to be an imposter... AddComponentPostInit("map", function(self) Doesn't have any effect, and AddClassPostConstruct("components/map", function(self) crashes the game because it says the file path doesn't exist. Also, all of the functions in the file are actually called as if it's part of TheWorld itself, and not a component. TheWorld.Map:CanDeployRecipeAtPoint() So then how do I edit a function like this? Link to comment Share on other sites More sharing options...
Hornete Posted February 11, 2021 Share Posted February 11, 2021 3 minutes ago, pickleplayer said: I'm no stranger to editing components, but I recently realized that one of the files in the components folder, "map.lua" seems to be an imposter... AddComponentPostInit("map", function(self) Doesn't have any effect, and AddClassPostConstruct("components/map", function(self) crashes the game because it says the file path doesn't exist. Also, all of the functions in the file are actually called as if it's part of TheWorld itself, and not a component. TheWorld.Map:CanDeployRecipeAtPoint() So then how do I edit a function like this? require("components/map") function GLOBAL.Map:FunctionYouWantToEdit(parameters) end like this! Yeah Map isn't a "real" component like other components haha 1 Link to comment Share on other sites More sharing options...
pickleplayer Posted February 11, 2021 Author Share Posted February 11, 2021 4 minutes ago, Hornete said: require("components/map") function GLOBAL.Map:FunctionYouWantToEdit(parameters) end like this! Yeah Map isn't a "real" component like other components haha A refreshingly simple solution, thank you! 1 Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now