Tips on scripted Unit Actions

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

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

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

Tips on scripted Unit Actions

Post by captainjack »

It sounds very simple.
Capture the port or destroy the supply dump. Add fuel and maybe ammo to the army that captures it, and reduce the same for the original owner.

Thing is, it doesn't seem to work and I can't work out why. Is there a trick to this or have I just missed a dumb mistake?
dalfrede
Colonel - Ju 88A
Colonel - Ju 88A
Posts: 1503
Joined: Wed Mar 15, 2017 7:48 pm

Re: Tips on scripted Unit Actions

Post by dalfrede »

One cannot subtract fuel or ammo from units, you can add or set.
The units must be in a zone or area you define.

I modified Border Raids so destroying the supply dump adds 100 fuel to Allies and sets Axis fuel to 0.
Note you have to click Core and/or Aux boxes for it to take effect.
Attachments
Border Raids.pzloc.zip
(1.02 KiB) Downloaded 98 times
Border Raids.pzscn.zip
(5.1 KiB) Downloaded 83 times
There comes a time on every project when it is time to shoot the engineer and ship the damn thing.
Akkula
Brigadier-General - 15 cm Nblwf 41
Brigadier-General - 15 cm Nblwf 41
Posts: 1900
Joined: Sat Apr 05, 2014 12:14 am

Re: Tips on scripted Unit Actions

Post by Akkula »

Actually you can substract. You just need to add negative values, -1, -2 and so on. At least it works with the strength parameter.
Eastern Front: Soviet Storm (v1.96): http://www.slitherine.com/forum/viewtopic.php?f=147&t=50342
Modern Conflicts (v2.10): http://www.slitherine.com/forum/viewtopic.php?f=147&t=72062
huckc
Master Sergeant - U-boat
Master Sergeant - U-boat
Posts: 533
Joined: Mon Apr 24, 2017 1:38 pm
Location: USA

Re: Tips on scripted Unit Actions

Post by huckc »

Akkula wrote:Actually you can substract. You just need to add negative values, -1, -2 and so on. At least it works with the strength parameter.
I just tested that and you're correct it does work that way with fuel and ammo too. Just need to make sure it's "add" not "set".

You can also have it affect all units on the map easily by giving the action a hex of 1,1 and a radius of 99 or some arbitrarily high enough number.

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

Re: Tips on scripted Unit Actions

Post by captainjack »

Thanks for the help. I think I'd been leaving some of the boxes unticked.

And yes, the screen says you add a negative number to remove fuel, ammo etc. Looks like I'd better get back to scenario editing now I can fix this.
dalfrede
Colonel - Ju 88A
Colonel - Ju 88A
Posts: 1503
Joined: Wed Mar 15, 2017 7:48 pm

Re: Tips on scripted Unit Actions

Post by dalfrede »

Akkula wrote:Actually you can substract. You just need to add negative values, -1, -2 and so on. At least it works with the strength parameter.
Oddly enough I can't enter negative numbers to fuel or ammo.

It's either my Mac keyboard or Wineskin.
There comes a time on every project when it is time to shoot the engineer and ship the damn thing.
captainjack
Brigadier-General - 15 cm Nblwf 41
Brigadier-General - 15 cm Nblwf 41
Posts: 1912
Joined: Thu Sep 13, 2012 7:42 am

Re: Tips on scripted Unit Actions

Post by captainjack »

I noticed that you have to have the box completely empty before you can enter the - sign (same goes for heroes).
So if it shows 0, you have to press delete first, then type -XX
Akkula
Brigadier-General - 15 cm Nblwf 41
Brigadier-General - 15 cm Nblwf 41
Posts: 1900
Joined: Sat Apr 05, 2014 12:14 am

Re: Tips on scripted Unit Actions

Post by Akkula »

dalfrede wrote:
Akkula wrote:Actually you can substract. You just need to add negative values, -1, -2 and so on. At least it works with the strength parameter.
Oddly enough I can't enter negative numbers to fuel or ammo.

It's either my Mac keyboard or Wineskin.
captainjack wrote:I noticed that you have to have the box completely empty before you can enter the - sign (same goes for heroes).
So if it shows 0, you have to press delete first, then type -XX
THIS.
Eastern Front: Soviet Storm (v1.96): http://www.slitherine.com/forum/viewtopic.php?f=147&t=50342
Modern Conflicts (v2.10): http://www.slitherine.com/forum/viewtopic.php?f=147&t=72062
Post Reply

Return to “Panzer Corps : Scenario Design”