Jump to content

Recommended Posts

Hello there,

I'm currently trying to do a mod that changes the way the placement of structures coming from the city planning tab work.

Indeed, these structure currently can only be placed on specific points, just like walls. This makes no sense to me, especially because it does not allow players to place these buildings in the middle of a tile. This placement makes sense for walls, but not for such structures.

I've started searching how such placement is handle, and I have narrowed down my search to a component named gridnudger that seems to be added only to structures with such placement constraints.

This is done by the following statement :

inst:AddComponent("gridnudger")

I then tried to change that behaviour by implementing the following function :

AddPrefabPostInit("city_lamp", function(inst)
   inst:RemoveComponent("gridnudger")
end)

That supposedly removes the gridnudger aspect from the city lamp, but the problem is it does not work. In my opinion, the reason for that is that it only removes the gridnuger aspect from the lamps after it has been placed, which makes the whole process pointless.

My question is as follow:

How do I change this aspect BEFORE the prefabs are placed, thus making this process relevant.

Thank you for your help.

Edited by MonsieurO

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...