Jump to content

Handling the placing of the City Planning structures


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 :


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

AddPrefabPostInit("city_lamp", function(inst)

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.

Link to comment
Share on other sites


This topic is now archived and is closed to further replies.

Please be aware that the content of this thread may be outdated and no longer applicable.

  • Create New...