Build Limits for units.
2 Dec 2022, 17:11 PM
#1
Posts: 16
Hello friends! I'm a newbie in the modding realm, and I've been messing around, trying to make a few new units. Now a problem I've run into is adding a build limit to an infantry squad. I've tried to look online for a solution, but all of them mention too many terms that I don't understand. If anyone knows how to create build limits, and can dumb down how it works so that I, the idiot, can understand?
2 Dec 2022, 18:02 PM
#2
Posts: 817 | Subs: 5
Welcome to the forum!
The 'sbps' category contains the squads. Open that category at 'Categories' in the menu and select your squad. In there should be a 'squad_requirement_ext', otherwise add it by right clicking on 'extensions' > 'add' at the top of the file. This 'requirement_ext' contains the requirements to build the squad. Add 'required_cap' to the requirement_table and set the 'max_cap' to your preferred limit.
The 'ui_name' is the text which is shown ingame after the limit is reached.
The 'reason' can be set to 'usage', this keeps the squad visible in the building, but locks the build option.
'usage_and_display' makes the whole squad button invisible (not recommended).
'display' should never be used, since hotkeys and the AI can still build the squad, but it is not visible in the building.
I hope this helps, just ask if something is not clear
The 'sbps' category contains the squads. Open that category at 'Categories' in the menu and select your squad. In there should be a 'squad_requirement_ext', otherwise add it by right clicking on 'extensions' > 'add' at the top of the file. This 'requirement_ext' contains the requirements to build the squad. Add 'required_cap' to the requirement_table and set the 'max_cap' to your preferred limit.
The 'ui_name' is the text which is shown ingame after the limit is reached.
The 'reason' can be set to 'usage', this keeps the squad visible in the building, but locks the build option.
'usage_and_display' makes the whole squad button invisible (not recommended).
'display' should never be used, since hotkeys and the AI can still build the squad, but it is not visible in the building.
I hope this helps, just ask if something is not clear
2 Dec 2022, 18:12 PM
#3
Posts: 16
Welcome to the forum!
The 'sbps' category contains the squads. Open that category at 'Categories' in the menu and select your squad. In there should be a 'squad_requirement_ext', otherwise add it by right clicking on 'extensions' > 'add' at the top of the file. This 'requirement_ext' contains the requirements to build the squad. Add 'required_cap' to the requirement_table and set the 'max_cap' to your preferred limit.
The 'ui_name' is the text which is shown ingame after the limit is reached.
The 'reason' can be set to 'usage', this keeps the squad visible in the building, but locks the build option.
'usage_and_display' makes the whole squad button invisible (not recommended).
'display' should never be used, since hotkeys and the AI can still build the squad, but it is not visible in the building.
I hope this helps, just ask if something is not clear
Well golly have I been overcomplicating things. I made a player upgrade that goes up every time I build the squad, and tried to basically disable the unit from being able to deploy if the value was >0. I tried my best to dig through the forums, and found a really old post that used this sorta tactic.
And, I know your mods! All units was really cool to play.
2 Dec 2022, 18:18 PM
#4
Posts: 817 | Subs: 5
Well golly have I been overcomplicating things. I made a player upgrade that goes up every time I build the squad, and tried to basically disable the unit from being able to deploy if the value was >0. I tried my best to dig through the forums, and found a really old post that used this sorta tactic.
And, I know your mods! All units was really cool to play.
In case of unit call-in abilities it is more complex and would need other solutions, but only buildable units is luckily much easier. Nice to hear that you liked it!
2 Dec 2022, 18:25 PM
#5
Posts: 16
In case of unit call-in abilities it is more complex and would need other solutions, but only buildable units is luckily much easier. Nice to hear that you liked it!
By the way, is there anything I can do to prevent someone from simply spam clicking on a unit to summon multiple of the same unit?
I'm not sure if this is what's even supposed to happen, but I can stack unit orders, and after one is spawned, the option to deploy that unit just vanishes.
Unfortunately, the unit order that was still in, doesn't, and so I get an extra unit.
Any ways to fix this issue?
Oh, I seem to have fixed it somehow. NEVERMIND!
2 Dec 2022, 18:38 PM
#6
Posts: 817 | Subs: 5
By the way, is there anything I can do to prevent someone from simply spam clicking on a unit to summon multiple of the same unit?
I'm not sure if this is what's even supposed to happen, but I can stack unit orders, and after one is spawned, the option to deploy that unit just vanishes.
Unfortunately, the unit order that was still in, doesn't, and so I get an extra unit.
Any ways to fix this issue?
Spam clicking should not be able to bypass that requirement. Have you set 'reason' in 'required_cap' to 'usage'? It sounds like it is set to 'display', if it vanishes.
Edit:
Oh, I seem to have fixed it somehow. NEVERMIND!
Nice
2 Dec 2022, 18:44 PM
#7
Posts: 16
Spam clicking should not be able to bypass that requirement. Have you set 'reason' in 'required_cap' to 'usage'? It sounds like it is set to 'display', if it vanishes.
Edit:
Nice
yeah, I'm pretty sure that's how I solved it. I barely had a clue what was the difference, but I think I got the hang of it!
PAGES (1)
1 user is browsing this thread:
1 guest
Livestreams
49 | |||||
21 | |||||
10 | |||||
3 | |||||
3 | |||||
230 | |||||
53 | |||||
24 | |||||
2 | |||||
1 |
Ladders Top 10
-
#Steam AliasWL%Streak
- 1.831222.789+37
- 2.34957.860+14
- 3.589215.733+4
- 4.1099614.642-1
- 5.280162.633+8
- 6.305114.728+1
- 7.916405.693-2
- 8.271108.715+22
- 9.721440.621+3
- 10.1041674.607-2
Replay highlight
VS
- cblanco ★
- 보드카 중대
- VonManteuffel
- Heartless Jäger
Einhoven Country
Honor it
9
Download
1231
Board Info
539 users are online:
1 member and 538 guests
mmp
mmp
1 post in the last 24h
7 posts in the last week
39 posts in the last month
7 posts in the last week
39 posts in the last month
Registered members: 49064
Welcome our newest member, cablingindfw
Most online: 2043 users on 29 Oct 2023, 01:04 AM
Welcome our newest member, cablingindfw
Most online: 2043 users on 29 Oct 2023, 01:04 AM