Jump to content

Recommended Posts

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?

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

  • Thanks 1
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!

  • Like 1

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
×
  • Create New...