panzer corps 2 scenario: visualization of limited supplies

A forum to discuss custom scenarios, campaigns and modding in general.

Moderator: Panzer Corps 2 Moderators

Post Reply
silnac
Private First Class - Wehrmacht Inf
Private First Class - Wehrmacht Inf
Posts: 9
Joined: Thu Nov 10, 2022 10:33 am

panzer corps 2 scenario: visualization of limited supplies

Post by silnac »

Hello,
I'm preparing a scenario (Italian Alpine Corps retreat at Nikolajevka) and I'd like to add some limitations (ammo, fuel, elite replacements and prestige).
I solve the problem of the prestige starting with 0 prestige and improve it conquering Soviet flags.
For ammo, fuel and elite replacement limits, I add them in the scenario parameters, but I'm not able to write a LUA with the correct lines to visualize on the screen the amount remaining available during the battle (like air transports or navy).

I wrote this lua:

function OnMapStart()
local player = world:GetPlayer(0)
player.resource1_icon = "/Game/Gui/GameplayUI/hud_ammo_icon"
player.resource1 = AmmoPool
player.resource1_tooltip = NSLOCTEXT("common", "ammo.pool", "Ammo Pool")
UpdateAmmoPool()
player.resource2_icon = "/Game/Gui/GameplayUI/hud_fuel_pool_icon"
player.resource2 = FuelPool
player.resource2_tooltip = NSLOCTEXT("common", "fuel.pool", "Fuel Pool")
UpdateFuelPool()
player.resource3_icon = "/Game/Gui/GameplayUI/hud_elite_pool_icon"
player.resource3 = ElitePool
player.resource3_tooltip = NSLOCTEXT("common", "elite.pool", "ElitePool")
UpdateElitePool()

end



function elite_start()
local player = world:GetPlayer(0)
player.fuel = 10000
player.ammo = 700
player.elite = 70

end


function fuel_ammoupdate()
if world.round < 1 then return end
local player = world:GetPlayer(0)
player.resource1 = player.ammo
player.resource2 = player.fuel
player.resource2 = player.elite

end

I add the triggers, and only the ammo icon appears, but with the wrong amount (sometime 5, sometime 0).
Someone could help me?

Thanks
Silnac
Grondel
Brigadier-General - 15 cm Nblwf 41
Brigadier-General - 15 cm Nblwf 41
Posts: 1918
Joined: Mon Aug 04, 2014 10:07 pm

Re: panzer corps 2 scenario: visualization of limited supplies

Post by Grondel »

silnac wrote: Wed Mar 19, 2025 10:58 am For ammo, fuel and elite replacement limits, I add them in the scenario parameters, but I'm not able to write a LUA with the correct lines to visualize on the screen the amount remaining available during the battle (like air transports or navy).
If u use the editor fields for fuel/ammo/elites(be sure to have something in both slots) u don´t need to do anything to make them show, game will do it for u.

Regarding fuel, u will notice that it becomes obsolete as soon as planes are involved.

sers,
Thomas
silnac
Private First Class - Wehrmacht Inf
Private First Class - Wehrmacht Inf
Posts: 9
Joined: Thu Nov 10, 2022 10:33 am

Re: panzer corps 2 scenario: visualization of limited supplies

Post by silnac »

[/quote][/img]
Grondel wrote: Wed Mar 19, 2025 2:48 pm
silnac wrote: Wed Mar 19, 2025 10:58 am For ammo, fuel and elite replacement limits, I add them in the scenario parameters, but I'm not able to write a LUA with the correct lines to visualize on the screen the amount remaining available during the battle (like air transports or navy).
If u use the editor fields for fuel/ammo/elites(be sure to have something in both slots) u don´t need to do anything to make them show, game will do it for u.

Regarding fuel, u will notice that it becomes obsolete as soon as planes are involved.

sers,
Thomas


Thanks for your quick reply Grondel!
No airplanes involved. Only ground units.
I leaved the Soviet's slot empty (unlimited supplies) in scenario parameters.
I need to see the total amount and the update every turn.
It's necessary to have an immediate reference in the upper part of the screen to value if I must avoid a fight or not.
More or less like on the Kuybyshev43 scenario NHEast1943 campaign.
I attached a screenshot to explain my idea.
Attachments
ScreenShot_2.jpg
ScreenShot_2.jpg (104.07 KiB) Viewed 454 times
Grondel
Brigadier-General - 15 cm Nblwf 41
Brigadier-General - 15 cm Nblwf 41
Posts: 1918
Joined: Mon Aug 04, 2014 10:07 pm

Re: panzer corps 2 scenario: visualization of limited supplies

Post by Grondel »

silnac wrote: Wed Mar 19, 2025 4:02 pm I need to see the total amount and the update every turn.
Image
Sadly u cannot manualy influence the tooltips of the fuel/ammo/elites icons.
Image
This is the best i can come up with.
Image

sers,
Thomas
silnac
Private First Class - Wehrmacht Inf
Private First Class - Wehrmacht Inf
Posts: 9
Joined: Thu Nov 10, 2022 10:33 am

Re: panzer corps 2 scenario: visualization of limited supplies

Post by silnac »

Thanks Thomas,
I'll try to find a solution.
best
Silnac

Grondel wrote: Wed Mar 19, 2025 7:12 pm
silnac wrote: Wed Mar 19, 2025 4:02 pm I need to see the total amount and the update every turn.
Image
Sadly u cannot manualy influence the tooltips of the fuel/ammo/elites icons.
Image
This is the best i can come up with.
Image

sers,
Thomas
Post Reply

Return to “Panzer Corps 2 Scenario Design”