Is it possible to make it where a player can only build one of each type of building?
For example: If I have a custom bunker called House and player 1 builds a house he can no longer build anymore houses. If he tries to build one it says he already has one and needs to destroy it before building another house. I'm kind of new and not sure where or how to approach this.
Create a requirement, and in the 'Requirements +' part, under the 'Use' section, add a requirement mode. Under type, put 'Not'. Then, create a new requirement node under that, and set type to 'Count unit', the alias as your unit name, and the state as completed. Then, in the build ability, go to 'Info +' and pick your build ability. Give it your new requirement under 'info - button - requirements' and it should work as expected.
Just a quick check, I'm trying to learn about upgrades and restrictions myself, but wouldn't it be better to set the state as Queued or Better? Completed would only check for completed units, right? While the former would make sure you can't start building two or more at the same time, thus - I guess - going around the requirement and allowing the construction to finish on all units. Correct me if I'm wrong.
Edit: Yeah, it does indeed work that way. I made quick test map. The Use section is for when you can use the ability/button, and the Show is apparently for when it should show up on the command card. Learned something new. I don't know how to display a tooltip with the proper requirement though. :(
Just wanted to say thanks to alejrb, it works perfectly!
I also wanted to say thanks to Zinatic for pointing out the potential abuse in being able to build multiple structures of the same type as long as they are not completed. Changing the state to queued or better fixed it :D
Rollback Post to RevisionRollBack
To post a comment, please login or register a new account.
Is it possible to make it where a player can only build one of each type of building?
For example: If I have a custom bunker called House and player 1 builds a house he can no longer build anymore houses. If he tries to build one it says he already has one and needs to destroy it before building another house. I'm kind of new and not sure where or how to approach this.
Any help is appreciated
Sure it is.
Create a requirement, and in the 'Requirements +' part, under the 'Use' section, add a requirement mode. Under type, put 'Not'. Then, create a new requirement node under that, and set type to 'Count unit', the alias as your unit name, and the state as completed. Then, in the build ability, go to 'Info +' and pick your build ability. Give it your new requirement under 'info - button - requirements' and it should work as expected.
Enjoy! :)
@alejrb: Go
Just a quick check, I'm trying to learn about upgrades and restrictions myself, but wouldn't it be better to set the state as Queued or Better? Completed would only check for completed units, right? While the former would make sure you can't start building two or more at the same time, thus - I guess - going around the requirement and allowing the construction to finish on all units. Correct me if I'm wrong.
Edit: Yeah, it does indeed work that way. I made quick test map. The Use section is for when you can use the ability/button, and the Show is apparently for when it should show up on the command card. Learned something new. I don't know how to display a tooltip with the proper requirement though. :(
Just wanted to say thanks to alejrb, it works perfectly!
I also wanted to say thanks to Zinatic for pointing out the potential abuse in being able to build multiple structures of the same type as long as they are not completed. Changing the state to queued or better fixed it :D