Page 1 of 1
Tips on scripted Unit Actions
Posted: Sat Feb 03, 2018 10:27 pm
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?
Re: Tips on scripted Unit Actions
Posted: Sun Feb 04, 2018 5:46 pm
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.
Re: Tips on scripted Unit Actions
Posted: Sun Feb 04, 2018 7:22 pm
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.
Re: Tips on scripted Unit Actions
Posted: Mon Feb 05, 2018 4:35 am
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.

Re: Tips on scripted Unit Actions
Posted: Mon Feb 05, 2018 5:58 am
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.
Re: Tips on scripted Unit Actions
Posted: Mon Feb 05, 2018 4:43 pm
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.
Re: Tips on scripted Unit Actions
Posted: Mon Feb 05, 2018 8:33 pm
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
Re: Tips on scripted Unit Actions
Posted: Tue Feb 06, 2018 2:25 am
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.