Login

russian armor

Create Build Limit On Units

4 Sep 2017, 06:08 AM
#1
avatar of TheChosenOne

Posts: 59

Ok, I started working my mod. Started from scratch because of the recent changes. I've accomplished

as much as I felt I needed to. Although, there are some units I want to make a one time build. An

example of that would be the Tiger Ace under the Wehrmacht. I would like to change some vehicles to

only be built a certain number of times and then the ability to build the unit would lock out for

the remainder of the game. Any help on how I can accomplish this would be appreciated as always.
4 Sep 2017, 17:39 PM
#2
avatar of SneakEye
Senior Modmaker Badge

Posts: 817 | Subs: 5

The Tiger Ace adds an upgrade to the player and the ability requires 0 upgrades. You can make something like this. Add an upgrade to the player and set a player_upgrade requirement on your unit which has minimum of 0 and a maximum of 3 for example.
4 Sep 2017, 20:45 PM
#3
avatar of TheChosenOne

Posts: 59

I will look into it further and I'll let you know if I can get it to work. I figured out how the Tiger Ace modifies the players resource income too.

I also used the idea from the Ardennes Assault Rangers the Limited Demo Charges. Granted, it's an ability, so I made it a reinforcement action, but that didn't operate the way I thought it would.
5 Sep 2017, 21:17 PM
#4
avatar of Lugie
Senior Modmaker Badge

Posts: 327

For squads, its easier to use required_not with required_squad (or something similar, cant remember the proper name). There you can set the max amount of that squad a player can have. You can do this in the action_apply of the squad you want to limit.
5 Sep 2017, 22:53 PM
#5
avatar of TheChosenOne

Posts: 59

I know about limiting the max number of units on the field. What I'm trying to do is make certain units buildable and after that you can produce no more for the rest of the match. So when a unit is destroyed, mainly tanks, you can't not build anymore. More or less using the same concept for the Tiger Ace.
6 Sep 2017, 09:19 AM
#6
avatar of Mr.Smith

Posts: 2636 | Subs: 17

Say you want to allow people to create no more than 4 Panthers throughout the entire game.

We have already implemented something like this for Lieutenant/Captain/Major in the Revamp mod, to make their squad shield visible while you tech:
- https://github.com/xxpatch/consmod

Basically, what we did (and you have to copy by substituting Lieutenant with Panther) is:
- the lieutenant_first squad is an invisible squad captures the cost of the lieutenant tier
- When the lieutenant_first squad is built, the squad orders the main building to call-in a real lieutenant squad, and the fake lieutenant squad suicides

In your case you want to extend this as follows:

- Create a panthers_built player upgrade that can stack up to at least 4 times (local_limit >= 4)
- your panther_fake squad also adds a player_target_action -> add upgrade (panthers_built) for each Panther built
- Add a requirement for panther_fake for fewer-than 3 panthers_built slot items
- Keep the squad_requirement for panther_first for 1; that way players can't building 3 panthers, and then queue 3 panthers to cheat the limit

PS: Make sure you test your mod against what happens if you have multiple T4 buildings laid down. Our workaround works for USF because you can only ever have one of each building as USF.
PS2: if you want to allow players to queue panther-built commands, there is still away to implement this and be secure, but it's a bit more complicated:

have a look at bren_lmg_governor_upgrade. This upgrade controls that sapper squads can't get more than 1 Bren at the same time. if somebody queued multiple buy commands, the squad still gets one bren, and the rest are refunded (so that you don't pay munition for nothing). You can copy the requirement_action structure and remove the panther_fake squad requirement.

6 Sep 2017, 21:42 PM
#7
avatar of TheChosenOne

Posts: 59

I'll have to try your system.

My main goal is to make all vehicles produced per match limited to a unique amount. Once that amount of vehicles are built, you cannot build anymore of those vehicles for that type of unit. Say you can build 4 M4 Shermans, but you can only build 2 Stuarts. Once those vehicles are destroyed, you cannot produce anymore. Think of it like a allotment for your faction. Each faction would have the tanks and vehicles limited given on their faction and somewhat historical numbers.
1 user is browsing this thread: 1 guest

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

909 users are online: 909 guests
0 post in the last 24h
8 posts in the last week
34 posts in the last month
Registered members: 49107
Welcome our newest member, Falac851
Most online: 2043 users on 29 Oct 2023, 01:04 AM