Unique Upgrade Question

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

Moderators: Slitherine Core, Panzer Corps Moderators, Panzer Corps Design

phcas
Lieutenant-General - Do 217E
Lieutenant-General - Do 217E
Posts: 3223
Joined: Tue Jun 14, 2011 2:23 am

Unique Upgrade Question

Post by phcas »

Hello everyone,

I have a Question.

I want to bring in Unique units (Graphics) in the game. For example 1.ZG "Wespe" Luftwaffe Bf-110. The graphic has a Wespe on the nose.

I make this unique units "nopurchase" so I can "give" 1 to the player but the computer AI can not buy 20 of them.

The Question/problem is that the player must have the possibility to upgrade this units (Example from Bf-110C to Bf-110D). The upgrade (Again with unique graphic) must only be for that unique unit or everything will be messed up again by the AI.

Example, The 501 heavy panzer bn, Tiger I, can enter the game with a unic graphic in a campaign scenario as given core unit to the player. But at a moment the player must have the chance to upgrade it to the 501 heavy panzer bn Tiger II.

Who Knows how to fix this?

Greetings PHCAS
Attachments
VB.jpg
VB.jpg (45.28 KiB) Viewed 2973 times
McGuba
Colonel - Ju 88A
Colonel - Ju 88A
Posts: 1572
Joined: Thu Mar 15, 2012 7:34 pm

Re: Unique Upgrade Question

Post by McGuba »

Currently it is not possible to do it as far as I know. You can only make these units elite or SE by adding them the bonus trait just like SE units have in the base game. Then they cannot be purchased but can be upgraded to another bonus unit. However, they can be upgraded to any other available bonus unit in the same class not just that other unique unit. But you can place these two unique units in the same upgrade family (series) so that they can be upgraded cheaper to the newer model. This would encourage players to upgrade to that other unique unit.

Another option might be scripting: during a scenario you can tell the game to upgrade any unit with a certain name to any another unit anytime. Here the disadvantage is that some tricky players might try to rename some other units to the same name to get more upgraded units for free. But I think most players do not bother renaming the existing units. And if you really want to you might be able to avoid it by some more scripting: for example you designate a zone which is only one hex and tell the player to move that certain unique unit there at a certain turn and than the upgrade would happen only once in that given turn in that given hex and then you can even charge the player for some prestige, too.
ImageImage
slitherine.com/forum/viewtopic.php?f=147&t=47985
slitherine.com/forum/viewtopic.php?f=147&t=36969
flakfernrohr
Colonel - Ju 88A
Colonel - Ju 88A
Posts: 1572
Joined: Wed Aug 03, 2011 11:56 pm
Location: Texas

Re: Unique Upgrade Question

Post by flakfernrohr »

I don't know if this mod would work, but Puma on the DMP forum did a purchase mod some time ago. That might add some ability to "purchase" a unit at will.
Old Timer Panzer General fan. Maybe a Volksturm soldier now. Did they let Volksturm drive Panzers?
phcas
Lieutenant-General - Do 217E
Lieutenant-General - Do 217E
Posts: 3223
Joined: Tue Jun 14, 2011 2:23 am

Re: Unique Upgrade Question

Post by phcas »

McGuba wrote: Another option might be scripting: during a scenario you can tell the game to upgrade any unit with a certain name to any another unit anytime. Here the disadvantage is that some tricky players might try to rename some other units to the same name to get more upgraded units for free. But I think most players do not bother renaming the existing units. And if you really want to you might be able to avoid it by some more scripting: for example you designate a zone which is only one hex and tell the player to move that certain unique unit there at a certain turn and than the upgrade would happen only once in that given turn in that given hex and then you can even charge the player for some prestige, too.
This sounds very good. Thanks McGuba, I only have to find out exactly how to do that.

Thanks PHCAS
captainjack
Brigadier-General - 15 cm Nblwf 41
Brigadier-General - 15 cm Nblwf 41
Posts: 1912
Joined: Thu Sep 13, 2012 7:42 am

Re: Unique Upgrade Question

Post by captainjack »

If you name a unit in the editor "General Knowledge" changing the unit name in the game to "Corporal Clot" doesn't affect what the editor sees.

So make your unique/nopurchase/noupgrade unit. Give it a name in the editor.

Either in a given scenario or in a special Unit upgrade scenario, you set a script that on turn X (or every turn) looks for "General Knowledge" (or whatever name you choose). If that unit is present - you can decide whether in a particular hex, a zone or anywhere on the map. If it is there the script performs a unit action to convert it to another unit type. General Knowledge is then converted from a BF110G to a Lockheed Starfighter (or something more appropriate but less cool).

I've done this in experimental upgrade scenarios with named units but not with unique units, so it should work.
phcas
Lieutenant-General - Do 217E
Lieutenant-General - Do 217E
Posts: 3223
Joined: Tue Jun 14, 2011 2:23 am

Re: Unique Upgrade Question

Post by phcas »

Thanks Captainjack, I am going to try this out.

Greetings PHCAS
phcas
Lieutenant-General - Do 217E
Lieutenant-General - Do 217E
Posts: 3223
Joined: Tue Jun 14, 2011 2:23 am

Re: Unique Upgrade Question

Post by phcas »

I try

"edit trigger" Add map conditions
"actions" Add unit action

Is that correct? It does nothing
phcas
Lieutenant-General - Do 217E
Lieutenant-General - Do 217E
Posts: 3223
Joined: Tue Jun 14, 2011 2:23 am

Re: Unique Upgrade Question

Post by phcas »

Oké. I let a recon unit named "test" drive in to a zone. Now the unit changes automaticly to a infantry unit with the name "test". How to let it change in a nonpurchace unit of my choice?

This is very important to me becausse it will make a big difference in my mods. Please help
McGuba
Colonel - Ju 88A
Colonel - Ju 88A
Posts: 1572
Joined: Thu Mar 15, 2012 7:34 pm

Re: Unique Upgrade Question

Post by McGuba »

Na oké, :wink:

So as I wrote with a script you can change any unit in the game to any other be it unique or not. You just have to add the unit action triggered under the necessary circumstances:
sample0.png
sample0.png (81.03 KiB) Viewed 2772 times
and then specify which unit(s) you want to change and to what:
sample1.png
sample1.png (83.53 KiB) Viewed 2772 times
where obviously XY is the custom name of the unit(s) (not to be confused with the unit type name) which will be changed if in zone 4 at the end of turn 43 and if it is a British infanty and then its type will be changed to British Inf 43 as specified by unit ID number 530 as seen in the equipment.pzdat file:

529 Bridge Engineer 0 110 6 0 2 2 0 1 2 1 -1 1 8 18 2 0 1 British_Bridge_Eng.png 1.1.1939 1.1.1946 11 Bridge Engineers beng close
530 British Inf 43 0 171 7 0 3 2 0 3 5 3 0 1 8 16 3 0 1 British_Inf_43.png 1.1.1943 1.1.1946 3 43 British Infantry close
531 British HW 43 0 197 6 0 2 2 0 4 6 5 -1 1 8 18 3 0 1 British_HW_43.png 1.1.1943 1.1.1946 3 43 British HW Infantry close

Note: in this example I used the script to make sure the AI will upgrade some of its still existing infantry in zone 4 to the '43 model, when it becomes available (which happens to be in turn 43 in the Battlefield: Europe mod - I only added the name XY for this example, if left empty the script applies to all British Inf units in zone 4).

Again, with this method theoretically you can change any unit in the game to any other, but I would suggest to avoid cross-class upgrades, unless that is what you really want. For example if you change an infantry unit to an air unit when there is another air unit above it could end up in a game crash, and so on. However, there should not be a problem for example with upgrading an obsolete Pz.II tank to a Marder II anti-tank or a Pz.38 tank to a Marder III or Hetzer anti-tank or to a Grille SP artillery at some point as long as they have a custom name given in the editor. In this way historically accurate cross-class upgrades can be made, which is not possible in the game otherwise.
ImageImage
slitherine.com/forum/viewtopic.php?f=147&t=47985
slitherine.com/forum/viewtopic.php?f=147&t=36969
phcas
Lieutenant-General - Do 217E
Lieutenant-General - Do 217E
Posts: 3223
Joined: Tue Jun 14, 2011 2:23 am

Re: Unique Upgrade Question

Post by phcas »

GREAT! I didn't understand you can make a choice of the "Value" as a number in the equipment file. This fix all the upgrade problems in the PHCAS1 mod. Now I can make unique unit graphics, Let SSLAH start as a Infantry unit, make it a Panzer Grenadier unit if the time is there and finaly make it a Panzer Division. The AI will not mess up the whole thing becausse it are nopurchase units. Al I have to do in the campaign scenario's is to give the first core unit to the player and upgrade the units in the scenario's coming in the historical timeline. Thank you so much McGuba!!

Greetings PHCAS
McGuba
Colonel - Ju 88A
Colonel - Ju 88A
Posts: 1572
Joined: Thu Mar 15, 2012 7:34 pm

Re: Unique Upgrade Question

Post by McGuba »

Ah, ok, cool! :)

Just be aware that if the infantry has an organic transport and then gets upgraded to a tank it will carry over its truck which might be strange. Unless you do not allow it to have truck transport or somehow figure out how to remove it. There is a parameter called Transport Type, but you can only have it "set" or "add" - there is no such thing as "remove". :cry: You can experiment by adding a non-existent or negative value and see what happens, but it may or may not work.
ImageImage
slitherine.com/forum/viewtopic.php?f=147&t=47985
slitherine.com/forum/viewtopic.php?f=147&t=36969
phcas
Lieutenant-General - Do 217E
Lieutenant-General - Do 217E
Posts: 3223
Joined: Tue Jun 14, 2011 2:23 am

Re: Unique Upgrade Question

Post by phcas »

McGuba wrote:Ah, ok, cool! :)

Just be aware that if the infantry has an organic transport and then gets upgraded to a tank it will carry over its truck which might be strange. Unless you do not allow it to have truck transport or somehow figure out how to remove it. There is a parameter called Transport Type, but you can only have it "set" or "add" - there is no such thing as "remove". :cry: You can experiment by adding a non-existent or negative value and see what happens, but it may or may not work.
Yes it is a problem. In the mods I added a lot of transports. Most units start with horse traction and can upgrade the transport than. It is not possible now. Example: leFH18 with SdKfz-11. Has to be upgraded to sFH18 with SdKfz-7.

By for example SSLAH the Schützen drive in Opel Blitz. When replaced by Panzergrenadier they need SdKfz-251.

didn´t we almost have it all..................... :cry:
McGuba
Colonel - Ju 88A
Colonel - Ju 88A
Posts: 1572
Joined: Thu Mar 15, 2012 7:34 pm

Re: Unique Upgrade Question

Post by McGuba »

Well in that case you can try changing its transport by adding the unit ID number of the SdKfz.251 to the Transport Type parameter as set: value
sample2.png
sample2.png (87.12 KiB) Viewed 2715 times
altough I have never tried it, it should do the trick. And when it comes to the tank version you might want to change it to one of your recovery vehicles as transport. However, I am not sure which transport it will change as there are other transports as well in the game - rail, sea, air, etc. Anyway, it has to be tested and then you will see what happens.
ImageImage
slitherine.com/forum/viewtopic.php?f=147&t=47985
slitherine.com/forum/viewtopic.php?f=147&t=36969
phcas
Lieutenant-General - Do 217E
Lieutenant-General - Do 217E
Posts: 3223
Joined: Tue Jun 14, 2011 2:23 am

Re: Unique Upgrade Question

Post by phcas »

McGuba I made it!

*A second unit action can change the transport type like you said. So that problem is fixed.
*I find out that if you use number 99999 for the transport it will be removed.

So if you do remove the transport in the first unitaction (99999)
Than you can change the unit into a tank (without transport) in the second unitaction

Hurray, hurray, hurray thanks again McGuba!

Greetings PHCAS
captainjack
Brigadier-General - 15 cm Nblwf 41
Brigadier-General - 15 cm Nblwf 41
Posts: 1912
Joined: Thu Sep 13, 2012 7:42 am

Re: Unique Upgrade Question

Post by captainjack »

Thanks for the transport upgrade advice. I had been able to upgrade my 42 French Infantry but not their transports, and had been wondering how to upgrade a towed 25mm into a portee-mounted one. This should now solve the problem.

And for those wondering, if the initial Blitzkrieg had stalled 1942 is roughly when the Mas assault rifles, upgraded mortars and infantry HEAT weapons (I'm following the Blunted Sickle idea of a PIAT style launcher, rather than modified VB grenade) would have been available in quantity. I then assume that the 25mm AT (on their Laffly 20 portees) then get dispersed among the mechanised infantry to provide some longer-ranged [HA] while travelling and the wider availability of AA guns means that 25mm portee-mounted AA guns are available for some [AA}.
phcas
Lieutenant-General - Do 217E
Lieutenant-General - Do 217E
Posts: 3223
Joined: Tue Jun 14, 2011 2:23 am

Re: Unique Upgrade Question

Post by phcas »

Still a hint

If you make the starting core units purchase zone in a campaign scenario zone 32, all updates you want can be done automatic by starting the scenario if you make zone 32 the trigger.
McGuba
Colonel - Ju 88A
Colonel - Ju 88A
Posts: 1572
Joined: Thu Mar 15, 2012 7:34 pm

Re: Unique Upgrade Question

Post by McGuba »

Awesome! :D
ImageImage
slitherine.com/forum/viewtopic.php?f=147&t=47985
slitherine.com/forum/viewtopic.php?f=147&t=36969
phcas
Lieutenant-General - Do 217E
Lieutenant-General - Do 217E
Posts: 3223
Joined: Tue Jun 14, 2011 2:23 am

Re: Unique Upgrade Question

Post by phcas »

Two other questions

1. If you want to make a unit "must survive" or the game will be lost, does someone know how to do that?

2. does anyone knows were to find a good manuel about the editor were you can find out this kind of scripts?

Greetings PHCAS
McGuba
Colonel - Ju 88A
Colonel - Ju 88A
Posts: 1572
Joined: Thu Mar 15, 2012 7:34 pm

Re: Unique Upgrade Question

Post by McGuba »

phcas wrote:Two other questions

1. If you want to make a unit "must survive" or the game will be lost, does someone know how to do that?
Edit -> Scenario Params -> Victory Conditions -> Edit -> Add map condition

and then specify your special unit, which in this case is a German tank commanded by phcas:
sample02.png
sample02.png (107.38 KiB) Viewed 2565 times
should work but I have never tested...

2. does anyone knows were to find a good manuel about the editor were you can find out this kind of scripts?
I think there is no comprenehnsive manual for the editor. Basically most of its features are self-explanatory, anyway. After that scripting is like cooking or chemistry: you can combine the existing scripts to get the desired events, but there is no recipe given for each and every meal. :wink:

Many things can be made with a little creativity and sometimes I tend to think about how to script things in PzC when I am traveling or working. :oops: For example last time I managed to figure out how I could simulate a long siege in which the besieged units of the defending side are losing 1 strength points after every 5-6 turns, but only if the attacker side could maintain the siege (encirclement) continuously throughout that previous 5-6 turns. Truly, the possibilities are nearly endless. The only real limitation is the 32 AI zones.
ImageImage
slitherine.com/forum/viewtopic.php?f=147&t=47985
slitherine.com/forum/viewtopic.php?f=147&t=36969
captainjack
Brigadier-General - 15 cm Nblwf 41
Brigadier-General - 15 cm Nblwf 41
Posts: 1912
Joined: Thu Sep 13, 2012 7:42 am

Re: Unique Upgrade Question

Post by captainjack »

McGuba wrote:should work but I have never tested...
I've done this and it works fine.
Post Reply

Return to “Panzer Corps : Scenario Design”