Sign in to follow this  
pickleplayer

Editing the Map "component" file

Recommended Posts

pickleplayer    193

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?

Share this post


Link to post
Share on other sites
Hornete    11210
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

Share this post


Link to post
Share on other sites
pickleplayer    193
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

Share this post


Link to post
Share on other sites

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
Sign in to follow this