I have created over 20 'new' units (new icons using the same stats as existing units) and all of them work properly except 2 - the new StuG IV and StuH 42 units. I created a test scenario and placed all the new units, including these two. When I play the scenario all units can be selected and moved and the sound effects etc are as intended. As soon as I click on one of the two above the game freezes.
I have checked the efx and equipment files and will continue to do so, but I thought I'd ask if anyone has any hints.
To create the units I used the Equipment Editor, Add unit (StuG/StuH), changed the image icon (used custom named icon from rezaf's new camouflage set) and stats to allow switching with the correct counterpart type (ART/AT), Commit unit, Save. Stats appear in the file and they can be placed in the Scenario Editor and they appear in the game.
Thanks for any help.
Specific units crashing the game
Moderators: Slitherine Core, Panzer Corps Moderators, Panzer Corps Design
-
- Panzer Corps Moderator
- Posts: 2119
- Joined: Tue Jun 03, 2008 9:32 am
-
- Panzer Corps Moderator
- Posts: 2119
- Joined: Tue Jun 03, 2008 9:32 am
I suspect this may help.
#3. Critical bug with the German su-122.
Step 1: Place german su-122 on map with editor included in BETA 1.05
Step 2: Start game and launch map
Step 3: Click on German Su-122 unit
Step 4: Notice game is frozen
I couldn't figure out what was causing this, the efx and equipment file both look configured correctly.
Bug #3 was actually pretty interesting. Here is what happened there.
- If a unit is switchable, one type in the switch chain (which can have more than 2 units btw) is considered "primary". This is the type which determined unit's "real" class, and is used to provide the right upgrade options.
- In the past, all types except the primary one had "nopurchase" trait, because a switchable unit can only be bought using its primary type. So this is how the game determined which type should be considered primary.
- Here comes the problem: in case of captured SU-122 all modes of the unit have "nopurchase", so the game could not determine its primary type.
- This unexpected situation caused the engine to fail.
To solve this, I decided to separate "nopurchase" and "primary" attributes of a unit, because, as we've learned from this example, they are not always directly related. Captured SU-122 must have "nopurchase" trait, but still it must have a valid primary type, because it is essentially an artillery, and must be upgraded as artillery, not as SPAT.
So now we have a new trait supported by the game:
"primary"
For now, the only unit which must have this trait is german SU-122 (artillery mode). For other units, the game will default to the old behavior in case "primary" trait is not found. However, it would be much better if we assign "primary" trait to all units that should have it, and then I can disable the old problematic mechanism altogether, and always use new one ("primary" trait) to determine primary unit type.
Alex
-
- Panzer Corps Moderator
- Posts: 2119
- Joined: Tue Jun 03, 2008 9:32 am
So that's what happened with a user in Matrix forum:
http://www.matrixgames.com/forums/tm.as ... 44&mpage=3
Niki, will like to know about that.
Thnaks, Kerensky.
http://www.matrixgames.com/forums/tm.as ... 44&mpage=3
Niki, will like to know about that.
Thnaks, Kerensky.

-
- Panzer Corps Moderator
- Posts: 2119
- Joined: Tue Jun 03, 2008 9:32 am