Login

russian armor

Build Limits for units.

2 Dec 2022, 17:11 PM
#1
avatar of TheGiftLucas

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
avatar of SneakEye
Senior Modmaker Badge

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 :)
2 Dec 2022, 18:12 PM
#3
avatar of TheGiftLucas

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
avatar of SneakEye
Senior Modmaker Badge

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
avatar of TheGiftLucas

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
avatar of SneakEye
Senior Modmaker Badge

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 :thumb:
2 Dec 2022, 18:44 PM
#7
avatar of TheGiftLucas

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 :thumb:


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!
0 user is browsing this thread:

Ladders Top 10

  • #
    Steam Alias
    W
    L
    %
    Streak
Data provided by Relic Relic Entertainment

Replay highlight

VS
  • U.S. Forces flag cblanco ★
  • The British Forces flag 보드카 중대
  • Oberkommando West flag VonManteuffel
  • Ostheer flag Heartless Jäger
uploaded by XXxxHeartlessxxXX

Board Info

839 users are online: 839 guests
2 posts in the last 24h
8 posts in the last week
39 posts in the last month
Registered members: 49079
Welcome our newest member, Rodfg15
Most online: 2043 users on 29 Oct 2023, 01:04 AM