Skip to content

Refuel - Make destruction effects longer, Rework terrain init#11416

Open
Dystopian wants to merge 8 commits into
acemod:masterfrom
Dystopian:refuel_restore_vanilla_explosion
Open

Refuel - Make destruction effects longer, Rework terrain init#11416
Dystopian wants to merge 8 commits into
acemod:masterfrom
Dystopian:refuel_restore_vanilla_explosion

Conversation

@Dystopian

@Dystopian Dystopian commented Jun 28, 2026

Copy link
Copy Markdown
Contributor

When merged this pull request will:

  • make destruction effects last longer;
  • improve terrain fuel pump init;
  • improve init tracing (move from mission start to game start);
  • fix init of refuel objects without ACE config.

When a fuel source (either a pump or a vehicle) is destroyed, the vanilla fuel cargo is restored. This makes the destruction effects last much longer. Uses a more reliable approach than the one used in #7613 (comment).

The allObjects command is very fast. Pump location configs for worlds are no longer needed and slow nearObjects-based init has been removed.

@johnb432 johnb432 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

On Cam Lao Nam from SOG, I'm getting the following:

nearObjects:

[
    ["Land_vn_b_prop_fueldrum_01",78],
    ["Land_vn_fuel_tank_stairs",20],
    ["Land_vn_b_prop_fueldrum_03",32],
    ["Land_vn_b_prop_fueldrum_02",32],
    ["Land_vn_fuelstation_02_pump_f",11],
    ["Land_vn_fuelstation_feed_f",21]
]

allObjects 0:

[
    ["Land_vn_b_prop_fueldrum_01",14],
    ["Land_vn_b_prop_fueldrum_03",32],
    ["Land_vn_b_prop_fueldrum_02",32],
    ["Land_vn_fuelstation_02_pump_f",11],
    ["Land_vn_fuelstation_feed_f",21]
]

Land_vn_b_prop_fueldrum_02 and Land_vn_b_prop_fueldrum_03 inherit from Land_vn_b_prop_fueldrum_01, which means the you have to remove those counts from the 78 found, making it 78 - (32 + 32) = 14, which is correct. (It's just a weakness in the old code.)

However, what's not ok is that Land_vn_fuel_tank_stairs is completely ignored. It's in the QGVAR(cacheRefuelClassesStatic) hashmap and I've checked that allObjects can't find it, even if you run -1 allObjects 0. getObjectType on an objects of Land_vn_fuel_tank_stairs returns 1.

@Dystopian

Copy link
Copy Markdown
Contributor Author

I added a warning for such cases.

Static objects with transportFuel become slow vehicles from the perspective of allObjects, see T168937 for partial explanation. As a result, they are visible to allObjects.

Land_vn_fuel_tank_stairs was added in #10049 and is not vanilla refuel object (transportFuel = 0). It is not slow vehicle and is missed in allObjects.

We could just add transportFuel value > 0 to it but then when opening the editor on Cam Lao Nam we get a warning:
Warning Message: WARNING: Used restricted combination of settings for "Land_vn_fuel_tank_stairs". Shape class == "house" and it has supply ability in a same time. Binarization of the map may provide unstable results and game can even crash when used.

I ran into the same warning when I tried to make the CUP Repair Center a repair facility. I couldn't find any useful information about it, so I dropped the idea.

@Dystopian

Copy link
Copy Markdown
Contributor Author

@johnb432 I checked, and it isn't important for Static objects without transportFuel to be initialized. ACE Refuel interaction works for them anyway. The only difference is that they won't burn as refuel objects.

I can't test Land_vn_fuel_tank_stairs, but I have just tested Land_Kiosk_blueking_F instead, and it works correctly without transportFuel.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants