Login

russian armor

[Mod] Fixing decrewed vehicles popcap

6 Apr 2017, 13:28 PM
#1
avatar of Mr.Smith

Posts: 2636 | Subs: 17

I've found a way to fix the feature known as "USF popcap abuse" (i.e., jump out of your vehicles to deflate your popcap). Unfortunately, the scope-monster is strong, and it might be a while until the time is ripe to deploy the fix.

In the meantime, I thought that you guys might be interested in implementing a fix in this for your mods (especially, if you've decided to give vehicle crews to all factions).

Since I don't have enough time to write the mod, I'll write a sketch of what you need to do. In the future, I'll write and distribute a prototype that fixes USF popcap for the Jackson. That way, you can more easily incorporate that for your mods.

The base parts:

Create an entity that holds the popcap



- Copy a retreat antenna entity
- Make the entity invisible
- Give the entity a popcap value

If we wanted to fix the Jackson, which has 14 popcap, the crew has 4 popcap. Thus, I would give the entity a popcap value of 10

Think of the possible states for your vehicle



Ideally, you want to link the popcap (soul) of the vehicle to give popcap while the vehicle is alive and abandoned.

Thus:
- If the vehicle is dead: no popcap
- If the vehicle is occupied by someone: the antenna shouldn't spawn. The vehicle already gives popcap to the occuping player
- At any other point in time, the (neutral) vehicle should have a player-owned (invisible) popcap antenna attached to it

Spawn the antenna when the conditions holds



The easiest way to keep track of the state of the vehicle is create a custom upgrade that keeps track of the state. The upgrade should be tied to the entity, so that the upgrade persists if the vehicle is decrewed.

Let's name the entity upgrade as "vehicle_decrewed_upgrade_mp".

Add a requirement action on the ebps file of your vehicle (jackson), to spawn a player-owned antenna for 99999 seconds while the upgrade is present.

Control when the conditions should hold



Given that you've determined that the antenna should spawn when the vehicle is decrewed, there are 3 types of event to consider:
1. When the vehicle dies, the upgrade should be removed
2. When the vehicle becomes captured, the antenna-upgrade should be removed.
3. When the player disembarks from he vehicle, the vehicle should receive the antenna-upgrade

1 is solved auto-magically by the game. When the vehicle dies, so does the requirement action.

To address 2, you can put an action_apply_ext in the sbps of the vehicle to remove the upgrade. Since action apply only executes once when a squad is formed (i.e., when a vehicle is captured), this is the ideal solution.

To address 3, you need to modify the vehicle_decrew abilities. There are currently 3 abilities; one for generic crew, one for m20 crew and one for medics. Ideally you want to do the same.

The trick to modifying the disembarkation abilities is make it so that the upgrade is applied right before the vehicle becomes neutral. If the upgrade comes too late, the spawned antenna-entity will not belong to the player; it will belong to the neutral player.

To do this, if the disembarkation has a delay of 2 seconds, apply the upgrade with a delay of 1.5 seconds (so that it occurs 0.5 seconds before the disembarkation).

If the disembarkation has no delay, then add one, accordingly.

Test and apply your mod



For the initial stages, you might make the popcap antenna visible, so that you can see if you've gotten that right. Then, when everything looks set, you can make it invisible again.

Remember that you need to apply the same procedure for every vehicle:
- ebps -> requirement action -> popcap antenna (with popcap tailored to the vehicle in question)
- sbps -> remove upgrade

For the live version, the list of vehicles should apply to all factions' vehicles, as USF crews can hop in and out of captured vehicles as well.

Additional ideas



Since you've fixed USF popcap, why not give them a bit of a bonus somewhere else too. How about making their ambulances worth 0 popcap to allow for more mobile play?

However, how do you prevent ambulances from being used to "hide" squads and deflate popcap in the same way?

First of all, you set your ambulance to 0 popcap. Then, while the ambulance is crewed, you want to check whether there is a medic squad occupying it (no change), or there's somebody else hiding in there (in which case, you want to apply a 4 popcap penalty to the ambulance).

In the ambulance's ebps, look for driver_action_apply. This one applies actions to the driver squad. What you want to do here is check whether the driver squad is a medic squad. You do this with a requirement action for the unit type.

Then, to apply the popcap antenna to the ambulance, do a change_target_action (self) inside the requirement action, and spawn the antenna, if necessary.
6 Apr 2017, 13:42 PM
#2
avatar of __deleted__

Posts: 4314 | Subs: 7

7 Apr 2017, 03:49 AM
#3
avatar of Mistah_S

Posts: 851 | Subs: 1

Smith <444>3


You should post a link to your paypal or something so we can drop some thank you coin
21 Jun 2017, 23:41 PM
#4
avatar of GizmoX64

Posts: 52

I'll write a sketch of what you need to do. In the future, I'll write and distribute a prototype that fixes USF popcap for the Jackson


Looking forward to a cut and paste, or step by step instructions.
22 Jun 2017, 18:43 PM
#5
avatar of LoopDloop

Posts: 3053

Finally no more excuse for 6 pop major kappa.
23 Jun 2017, 20:06 PM
#6
avatar of ZombiFrancis

Posts: 2742

I think the creation/activation of the decrewed upgrade that governs the spawning of a popcap entity would have to be tied to the disembark ability which would then apply it to the vehicle ebps in question. Else I am not sure how a vehicle decrewed by combat wouldn't spawn pop cap for the player that lost it.
29 Jun 2017, 15:07 PM
#7
avatar of Mr.Smith

Posts: 2636 | Subs: 17

So, we've implemented the popcap fix for our mod here:
https://github.com/xxpatch/consmod

To implement popcap-fix for jackson and the sherman, you need to look at the following files:

The popcap-holder state, under upgrades:
- popcap_holder_mp.xml

All the decrew abilities


The popcap holder for sherman/jackson:


The condition that spawns the popcap holder entities, under ebps:
- action_apply_ext for the sherman/jackson EBPS files

The recrewing condition that clears the popcap-holder state:
- squad_action_apply_ext for sherman/jackson SBPS files
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

573 users are online: 1 member and 572 guests
donaldfufu
0 post in the last 24h
5 posts in the last week
33 posts in the last month
Registered members: 49186
Welcome our newest member, 12betripp
Most online: 2043 users on 29 Oct 2023, 01:04 AM