Panzer Corps 2 - v1.02.02 Update

A new story begins...
The sequel to a real classic: Panzer Corps is back!

Moderator: Panzer Corps 2 Moderators

Post Reply
AlbertoC
Slitherine
Slitherine
Posts: 1865
Joined: Wed Mar 09, 2016 5:22 pm

Panzer Corps 2 - v1.02.02 Update

Post by AlbertoC » Tue Nov 23, 2021 4:18 pm

We're releasing a new update today, this one consisting of a number of fixes.

You can find the full changelog below.

Change log:
- Fixed crashes and errors when assigning heroes outside the Deployment Phase (both manually or from scripts)
- Fixed crashes which some people experienced with "Show Instances" option turned off
- Fixed tooltips over difficulty levels
- Fixed red selection getting stuck in "import core" popup
- Fixed encirclement markers not showing for allied players

Retributarr
Captain - Heavy Cruiser
Captain - Heavy Cruiser
Posts: 908
Joined: Wed Jun 04, 2014 7:44 pm

Re: Panzer Corps 2 - v1.02.02 Update

Post by Retributarr » Tue Nov 23, 2021 5:34 pm

I need an 'Update' to correct a process failure in the consecutive process progression sequencing in the Game relating to... going from 'the first successfully completed Scenario' to the following subsequent follow-up Scenario... without having to deal with the constant 'Crashing' of usually... the 2nd-Scenario in a Campaign when the 2nd-Scenario in a Campaign is initially-initiated.

I have dutifully posted my distressing issue at... " Panzer Corps 2: Tech Support" as... titled..."My Grumpy Complaint"... but!... have had 'Zero-Response' to resolving this problematic problem???. No-Help at all???.

So!... as "YODA" in 'Star-Wars'... said... "Do or Do-Not... there is No-Try!". Therefore!... I would appreciate some kind of 'Resolution' on this and with this... particular consternation.

asuser
Sergeant Major - Armoured Train
Sergeant Major - Armoured Train
Posts: 576
Joined: Tue May 28, 2013 8:48 pm

Re: Panzer Corps 2 - v1.02.02 Update

Post by asuser » Thu Nov 25, 2021 10:52 am

Thank you for the new patch!

Unfortunately the bug with the hero assignments was only partially eliminated.
If you want to assign a hero to a spawned unit in the same round, you will get an error message
"attempt to index a nil value (local ‘unit’)".

If you want to assign a hero to the spawned unit one round later, the game crashes.
The ID number was triple proofed.

Could that be repaired, please?

nexusno2000
Sr. Colonel - Battleship
Sr. Colonel - Battleship
Posts: 1613
Joined: Mon Feb 24, 2014 5:15 pm

Re: Panzer Corps 2 - v1.02.02 Update

Post by nexusno2000 » Thu Nov 25, 2021 11:50 am

I can no longer open multiple instances of the editor, nor can I directly open the editor from .pz2scn files.
Green Knight
https://www.youtube.com/c/GreenKnight2001

scorehouse
Master Sergeant - U-boat
Master Sergeant - U-boat
Posts: 549
Joined: Thu Jun 27, 2019 1:56 am

Re: Panzer Corps 2 - v1.02.02 Update

Post by scorehouse » Thu Nov 25, 2021 1:01 pm

what's a spawned unit?

asuser
Sergeant Major - Armoured Train
Sergeant Major - Armoured Train
Posts: 576
Joined: Tue May 28, 2013 8:48 pm

Re: Panzer Corps 2 - v1.02.02 Update

Post by asuser » Thu Nov 25, 2021 1:43 pm

scorehouse wrote:
Thu Nov 25, 2021 1:01 pm
what's a spawned unit?
Unit comes with a LUA command on the map. Core-, AI or Enemy unit is possible.

scorehouse
Master Sergeant - U-boat
Master Sergeant - U-boat
Posts: 549
Joined: Thu Jun 27, 2019 1:56 am

Re: Panzer Corps 2 - v1.02.02 Update

Post by scorehouse » Thu Nov 25, 2021 2:16 pm

computer language I don't understand. r they generated by messing with code, cheats, etc. or a naturally occuring part of the game?

dalfrede
Lieutenant Colonel - Panther D
Lieutenant Colonel - Panther D
Posts: 1256
Joined: Wed Mar 15, 2017 7:48 pm

Re: Panzer Corps 2 - v1.02.02 Update

Post by dalfrede » Thu Nov 25, 2021 5:01 pm

scorehouse wrote:
Thu Nov 25, 2021 2:16 pm
computer language I don't understand. r they generated by messing with code, cheats, etc. or a naturally occuring part of the game?
Think of LUA scripts as a list of subroutine calls used during the running of a scenario.
They are written [copied and pasted most times] by the scenario designer as a way to control things.
An LUA file is included in the scenario directory along with the map.
PzC1 had triggers imbedded in the map, PzC2 has triggers placed in an external LUA file.
This keeps the map file 'simpler' by place such commands in an external text file.
scorehouse wrote: what's a spawned unit?

When a new unit appears 'out of thin air' it is called a spawned unit.

In PzC1 the AI would spawned new units around the last VH, which irritated some players.
So in PzC2 the AI does not buy new units, the AI only gets new units when the scenario designer adds them.
There comes a time on every project when it is time to shoot the engineer and ship the damn thing.

nexusno2000
Sr. Colonel - Battleship
Sr. Colonel - Battleship
Posts: 1613
Joined: Mon Feb 24, 2014 5:15 pm

Re: Panzer Corps 2 - v1.02.02 Update

Post by nexusno2000 » Thu Nov 25, 2021 6:06 pm

Moscow '41

Relevant parts of the script file below. The script format is LUA.

(basically it lays out 2 "spawn zones" which are a collection of hexes, and then there are 5 different waves to randomly pick from on each of turns 6,7,8,13,14,15,19,20)

---

normal_wave_turns = {6,7,8,13,14,15,19,20}

-- *** Hex zones ***
-- Spawn zones
-- When spawning a set of units, the script will scan spawn zones hex by hex, in the order specified, and spawn units in free hexes it finds
-- If the script runs out of hexes, the remainder of the units will not be spawned.
ru_spawn_zone1 = {{27,1},{29,1},{30,2},{31,2},{32,2},{30,3},{31,3},{32,3},{31,4},{32,4},{33,4},{31,5},{32,5},{33,5}}
ru_spawn_zone2 = {{34,10},{35,10},{34,11},{35,11},{35,12},{36,12},{35,13},{36,13},{35,14},{36,14},{34,15},{35,15},{36,15},{36,16},{37,16},{36,17}}

-- *** Enemy waves ***
-- Each unit set is a list of blocks in the following format: { "<Unit ID>", "<Transport ID>", overstrength, experience }
-- If no organic transport is needed, its respective field should be empty string ("").

-- Soviet waves
ru_wave1 = { {"Regular", "", 1, 900}, {"Regular", "", 1, 900}, {"SUHWInf", "SUTruck", 2, 900}, {"T34-41", "", 1, 900}, {"BT7", "", 2, 900}, {"122mmM1938", "SUTruck", 2, 900} }
ru_wave2 = { {"Regular", "", 1, 900}, {"Regular", "", 1, 900}, {"SUHWInf", "SUTruck", 2, 900}, {"T34-41", "", 1, 900}, {"BT7", "", 2, 900}, {"BM13Katyusha", "SUTruck", 2, 900} }
ru_wave3 = { {"Regular", "", 2, 900}, {"Regular", "", 2, 900}, {"SUHWInf", "SUTruck", 3, 900}, {"SUCavalry", "", 1, 900}, {"SUMntInf", "", 1, 900}, {"45mmM1937", "SUTruck", 2, 900}, {"BA10", "", 1, 900} }
ru_wave4 = { {"KV1-41", "", 1, 900}, {"T28", "", 1, 900}, {"T50", "", 2, 900}, {"T34-41", "", 1, 900}, {"BT7", "", 2, 900}, {"T34-41", "", 2, 900}, {"37mmM1939AA", "SUTruck", 2, 900}, {"122mmM1938", "SUTruck", 2, 900} }
ru_wave5 = { {"Regular", "", 1, 900}, {"BA10", "", 1, 900}, {"KV2TNK", "", 1, 900}, {"BT7A-ATY", "", 2, 900}, {"BM13Katyusha", "", 1, 900}, {"GazAAMG-AA", "", 2, 900}, {"Il2Shturmovik", "", 0, 900} }

-- There can be any number of waves in this list, the game will pick a random one every time
ru_waves = {ru_wave1, ru_wave2, ru_wave3, ru_wave4, ru_wave5}

-- There can be any number of zones in this list, the game will pick a random one every time
ru_zones = {ru_spawn_zone1, ru_spawn_zone2}

function SpawnWave(player, zone, units)
local owner = world:GetPlayer(player)

local cur_hex = 1

-- Iterate through all units and spawn each one
for _,u in ipairs(units) do
-- Find the next vacant hex in the zone
while zone[cur_hex] do
hex = world:GetHex(zone[cur_hex])
if hex:GetUnit(0) == nil then break end -- found
cur_hex = cur_hex + 1
end

-- If we have run out of hexes in the zone, stop
if not zone[cur_hex] then return end

-- Create the unit in the free hex we've found
-- 1. Create and execute purchase action, use unit type, transport type and overstrength as parameters
local create_action = world:MakePurchaseAction(owner, u[1], u[2], u[3])
create_action.auxiliary = false -- spawn core units
create_action.cost = 0 -- don't take money for units we generate
create_action.faction = owner.factions[1] --set to first faction of owning player for created units
world:Exec(create_action)

-- 2. Create and execute deploy action, place the unit in the hex we've picked.
local unit = world:GetUnit(create_action.id)
deploy_action = world:MakeDeployAction(unit, zone[cur_hex])
world:Exec(deploy_action)

-- 3. Now modify the unit to set its experience to the value we need.
unit.experience = u[4]

-- 4. Now modify the unit to set its aggressiveness to the value we need.
player_aggressiveness = { 0, 85, 70, 70 }
unit.aggressiveness = player_aggressiveness[player+1]

end

end

function OnNewRound(action)
-- On the first call, initialize the random generator
if world.round == 1 then
math.randomseed(world.seed)
end

-- Do we need to spawn a normal wave?
local is_normal_wave = IsItemInTable(normal_wave_turns, world.round)

-- Do we need to spawn a boss wave?
--local boss_wave = FindItemInTable(boss_wave_turns, world.round) -- boss wave number
--local is_boss_wave = (boss_wave ~= -1)

-- If we don't need to spawn any normal or boss waves this turn then just finish
if not is_normal_wave then return end

-- Determine the player to get the next wave, always USSR 2 Siberians
player = 2

-- Determine the right zone and units to spawn
local zone
local units

-- Player 1 is USSR
zone = ru_zones[ math.random( #ru_zones ) ] -- random normal ru zone
units = ru_waves[ math.random( #ru_waves ) ] -- random normal ru wave
-- Now spawn this wave!
SpawnWave(player, zone, units)

end
-- *** Utility functions ***
function FindItemInTable(table, item)
for index,i in ipairs(table) do
if i == item then
return index
end
end

return -1
end

function IsItemInTable(table, item)
return FindItemInTable(table, item) ~= -1
end

function EmptyCondition()
return true
end
Green Knight
https://www.youtube.com/c/GreenKnight2001

NYPATRIOT
Private First Class - Wehrmacht Inf
Private First Class - Wehrmacht Inf
Posts: 7
Joined: Sat Mar 20, 2021 2:53 pm

Re: Panzer Corps 2 - v1.02.02 Update

Post by NYPATRIOT » Fri Nov 26, 2021 4:15 pm

Bug: After a scenario is completed on Grand Campaign, all units are fully replenished automatically.

tpoo
Senior Corporal - Ju 87G
Senior Corporal - Ju 87G
Posts: 78
Joined: Fri Dec 30, 2011 6:27 pm

Re: Panzer Corps 2 - v1.02.02 Update

Post by tpoo » Fri Nov 26, 2021 9:45 pm

dalfrede wrote:
Thu Nov 25, 2021 5:01 pm
scorehouse wrote:
Thu Nov 25, 2021 2:16 pm
computer language I don't understand. r they generated by messing with code, cheats, etc. or a naturally occuring part of the game?
Think of LUA scripts as a list of subroutine calls used during the running of a scenario.
They are written [copied and pasted most times] by the scenario designer as a way to control things.
An LUA file is included in the scenario directory along with the map.
PzC1 had triggers imbedded in the map, PzC2 has triggers placed in an external LUA file.
This keeps the map file 'simpler' by place such commands in an external text file.
scorehouse wrote: what's a spawned unit?

When a new unit appears 'out of thin air' it is called a spawned unit.

In PzC1 the AI would spawned new units around the last VH, which irritated some players.
So in PzC2 the AI does not buy new units, the AI only gets new units when the scenario designer adds them.
The AI in PzC2 will buy units if the AI behavior is set to Free for All in the editor and you have a supply hex. Usually will buy 1 unit per turn if there is enough prestige available.

terminator
Field Marshal - Me 410A
Field Marshal - Me 410A
Posts: 5000
Joined: Mon Aug 15, 2011 12:48 pm
Location: the land of freedom

Re: Panzer Corps 2 - v1.02.02 Update

Post by terminator » Sat Nov 27, 2021 6:57 am

tpoo wrote:
Fri Nov 26, 2021 9:45 pm
The AI in PzC2 will buy units if the AI behavior is set to Free for All in the editor and you have a supply hex. Usually will buy 1 unit per turn if there is enough prestige available.
Did you do a test ?

tpoo
Senior Corporal - Ju 87G
Senior Corporal - Ju 87G
Posts: 78
Joined: Fri Dec 30, 2011 6:27 pm

Re: Panzer Corps 2 - v1.02.02 Update

Post by tpoo » Sat Nov 27, 2021 2:36 pm

terminator wrote:
Sat Nov 27, 2021 6:57 am
tpoo wrote:
Fri Nov 26, 2021 9:45 pm
The AI in PzC2 will buy units if the AI behavior is set to Free for All in the editor and you have a supply hex. Usually will buy 1 unit per turn if there is enough prestige available.
Did you do a test ?
More than a test. It is how our mod PanzerCorps 1 is set up in GC1942 and GC1943. The AI usually buys mostly tanks, mobile artillery and sometimes infantry.

terminator
Field Marshal - Me 410A
Field Marshal - Me 410A
Posts: 5000
Joined: Mon Aug 15, 2011 12:48 pm
Location: the land of freedom

Re: Panzer Corps 2 - v1.02.02 Update

Post by terminator » Sat Nov 27, 2021 3:15 pm

tpoo wrote:
Sat Nov 27, 2021 2:36 pm
terminator wrote:
Sat Nov 27, 2021 6:57 am
tpoo wrote:
Fri Nov 26, 2021 9:45 pm
The AI in PzC2 will buy units if the AI behavior is set to Free for All in the editor and you have a supply hex. Usually will buy 1 unit per turn if there is enough prestige available.
Did you do a test ?
More than a test. It is how our mod PanzerCorps 1 is set up in GC1942 and GC1943. The AI usually buys mostly tanks, mobile artillery and sometimes infantry.
Okay but not in official scenarios I guess.

tpoo
Senior Corporal - Ju 87G
Senior Corporal - Ju 87G
Posts: 78
Joined: Fri Dec 30, 2011 6:27 pm

Re: Panzer Corps 2 - v1.02.02 Update

Post by tpoo » Sat Nov 27, 2021 3:45 pm

terminator wrote:
Sat Nov 27, 2021 3:15 pm
tpoo wrote:
Sat Nov 27, 2021 2:36 pm
terminator wrote:
Sat Nov 27, 2021 6:57 am

Did you do a test ?
More than a test. It is how our mod PanzerCorps 1 is set up in GC1942 and GC1943. The AI usually buys mostly tanks, mobile artillery and sometimes infantry.
Okay but not in official scenarios I guess.
The only official scenario that I know of that used "Free For All" as a editor setting was the stand alone scenario Fjord War for 1 of the AI factions.

terminator
Field Marshal - Me 410A
Field Marshal - Me 410A
Posts: 5000
Joined: Mon Aug 15, 2011 12:48 pm
Location: the land of freedom

Re: Panzer Corps 2 - v1.02.02 Update

Post by terminator » Sat Nov 27, 2021 4:46 pm

tpoo wrote:
Sat Nov 27, 2021 3:45 pm
terminator wrote:
Sat Nov 27, 2021 3:15 pm
tpoo wrote:
Sat Nov 27, 2021 2:36 pm
More than a test. It is how our mod PanzerCorps 1 is set up in GC1942 and GC1943. The AI usually buys mostly tanks, mobile artillery and sometimes infantry.
Okay but not in official scenarios I guess.
The only official scenario that I know of that used "Free For All" as a editor setting was the stand alone scenario Fjord War for 1 of the AI factions.
Thanks for the info, I’ll take a look at it occasionally.

Post Reply

Return to “Panzer Corps 2”