Find your base building and set "Techtree - Dependency Equivalents" to all building types it changes into.
Example:
I have Scout Tower, which can change into Guard Tower, Cannon Tower or Arcane Tower. I want to limit my game so only one Scout Tower (or one of its upgraded versions) can be built per player.
First, I will limit number of Scout Towers that can be build via the trigger action I posted in my previous post. Next, I open Scout Tower in Object Editor and find the "Techtree - Dependency Equivalents" and add to that field the Guard, Cannon and Arcane Tower.
This will set the player so he can have only one of the 4 tower types.
Do be aware of creating circular dependence (e.g. Scout Tower has dependency set to Guard Tower, Guard Tower has dependency set to Scout Tower; or larger circles), else the game will crash when you open build menu with such building.