sman1975
Emperor
Hello,
I'm working on a mod that adds a lot of content in the early game, including a few new improvements.
Unfortunately, in the second half of the game (Industrial Era and later), building many of these improvements don't make sense and harm the immersive qualities of the mod. I mean, who besides Americans in Las Vegas need to be able to construct a Ziggurat in the Information Era?
I've looked for an equivalent game event like "PlayerCanBuild" that you could use like you do when you prevent Buildings or Promotions. So, far, nothing looks promising.
Found the "Unit:CanBuild" method, but that looks more like a Boolean return that informs the code if a specific unit can perform a specific build action type on a certain plot. I'm trying to prevent the build icon from appearing in as a unit action in the first place. Agent Ransack tells me this method isn't used at all in the /Assets folders of the game.
Would appreciate it if anyone has a suggestion on preventing obsolete improvements from appearing in the Unit Action popup that Workers see when loitering on an unimproved tile.
Thanks!
P.s. I've seen the game event PlayerCanBuild - have written a function to try and return false for specific improvements, but it never seems to fire.
And yes, I know I could rewrite UnitPanel.LUA, but was hoping to find something a bit more on the nose. Thanks.
I'm working on a mod that adds a lot of content in the early game, including a few new improvements.
Unfortunately, in the second half of the game (Industrial Era and later), building many of these improvements don't make sense and harm the immersive qualities of the mod. I mean, who besides Americans in Las Vegas need to be able to construct a Ziggurat in the Information Era?
I've looked for an equivalent game event like "PlayerCanBuild" that you could use like you do when you prevent Buildings or Promotions. So, far, nothing looks promising.
Found the "Unit:CanBuild" method, but that looks more like a Boolean return that informs the code if a specific unit can perform a specific build action type on a certain plot. I'm trying to prevent the build icon from appearing in as a unit action in the first place. Agent Ransack tells me this method isn't used at all in the /Assets folders of the game.
Would appreciate it if anyone has a suggestion on preventing obsolete improvements from appearing in the Unit Action popup that Workers see when loitering on an unimproved tile.
Thanks!
P.s. I've seen the game event PlayerCanBuild - have written a function to try and return false for specific improvements, but it never seems to fire.
And yes, I know I could rewrite UnitPanel.LUA, but was hoping to find something a bit more on the nose. Thanks.
Last edited: