Build Limits for units.
2 Dec 2022, 17:11 PM
#1
Posts: 17
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: 17
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: 17
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: 17
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
31 | |||||
17 | |||||
9 | |||||
6 | |||||
3 | |||||
1 | |||||
1 | |||||
1 |
Ladders Top 10
-
#Steam AliasWL%Streak
- 1.655231.739+15
- 2.842223.791+5
- 3.35157.860+16
- 4.599234.719+7
- 5.934410.695-1
- 6.278108.720+29
- 7.307114.729+3
- 8.645.928+5
- 9.10629.785+7
- 10.527.881+18
Replay highlight
VS
- cblanco ★
- 보드카 중대
- VonManteuffel
- Heartless Jäger
Einhoven Country
Honor it
11
Download
1259
Board Info
546 users are online:
546 guests
0 post in the last 24h
12 posts in the last week
25 posts in the last month
12 posts in the last week
25 posts in the last month
Registered members: 49851
Welcome our newest member, Eovaldis
Most online: 2043 users on 29 Oct 2023, 01:04 AM
Welcome our newest member, Eovaldis
Most online: 2043 users on 29 Oct 2023, 01:04 AM