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.
Create Build Limit On Units
4 Sep 2017, 06:08 AM
#1
Posts: 59
4 Sep 2017, 17:39 PM
#2
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
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.
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
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
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
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.
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
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.
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.
PAGES (1)
1 user is browsing this thread:
1 guest
Livestreams
33 | |||||
13 | |||||
7 | |||||
173 | |||||
18 | |||||
4 | |||||
4 | |||||
3 | |||||
1 | |||||
1 |
Ladders Top 10
-
#Steam AliasWL%Streak
- 1.831222.789+37
- 2.34957.860+14
- 3.589215.733+4
- 4.1101614.642+2
- 5.305114.728+1
- 6.916405.693-2
- 7.271108.715+22
- 8.721440.621+3
- 9.1041674.607-2
- 10.17146.788+1
Replay highlight
VS
- cblanco ★
- 보드카 중대
- VonManteuffel
- Heartless Jäger
Einhoven Country
Honor it
9
Download
1231
Board Info
1186 users are online:
1186 guests
1 post in the last 24h
8 posts in the last week
38 posts in the last month
8 posts in the last week
38 posts in the last month
Registered members: 49082
Welcome our newest member, 23winlocker
Most online: 2043 users on 29 Oct 2023, 01:04 AM
Welcome our newest member, 23winlocker
Most online: 2043 users on 29 Oct 2023, 01:04 AM