FUNCTION ALL_CHECK

Modders can post their questions on scripting and more.

Moderators: Slitherine Core, BA Moderators

Post Reply
enric
Brigadier-General - 8.8 cm Pak 43/41
Brigadier-General - 8.8 cm Pak 43/41
Posts: 1855
Joined: Sun May 15, 2011 8:47 am

FUNCTION ALL_CHECK

Post by enric »

The documentation stats:
FUNCTION ALL_CHECK_<name>( me, unit, tilex, tiley )
This function is used to determine whether a unit can perform a task. The return value can be either the cost of the action in AP, or -2 if you with the task icon not to be shown, or -1 if you wish to show the icon in a disabled state.

In the load.bsf
FUNCTION CHECK_UNIT_LOAD
if you add at the end

Log("ret",ret);
return ret ;
}

you get 8 even if the truck icon appears as disabled, (can't load) for example because infantry has less than 8 MP.
I can't understand how it works. Should return -1 no?
pipfromslitherine
Site Admin
Site Admin
Posts: 9706
Joined: Wed Mar 23, 2005 10:35 pm

Re: FUNCTION ALL_CHECK

Post by pipfromslitherine »

It may be that the internal logic compares the cost to unit APs and over-rides.

Cheers

Pip
follow me on Twitter here
enric
Brigadier-General - 8.8 cm Pak 43/41
Brigadier-General - 8.8 cm Pak 43/41
Posts: 1855
Joined: Sun May 15, 2011 8:47 am

Re: FUNCTION ALL_CHECK

Post by enric »

But then it overrides the scripting system and its normal behavior, seems arbitrary, no?
pipfromslitherine
Site Admin
Site Admin
Posts: 9706
Joined: Wed Mar 23, 2005 10:35 pm

Re: FUNCTION ALL_CHECK

Post by pipfromslitherine »

It's true for every order - it's just that most do internal checks, but you don't have to do so.

Cheers

Pip
follow me on Twitter here
enric
Brigadier-General - 8.8 cm Pak 43/41
Brigadier-General - 8.8 cm Pak 43/41
Posts: 1855
Joined: Sun May 15, 2011 8:47 am

Re: FUNCTION ALL_CHECK

Post by enric »

ok, but if BA makes an internal check on value 8, then we can't modify the load cost by scripting.
pipfromslitherine
Site Admin
Site Admin
Posts: 9706
Joined: Wed Mar 23, 2005 10:35 pm

Re: FUNCTION ALL_CHECK

Post by pipfromslitherine »

It only checks against how many APs the unit has. Which is pretty logical.

Cheers

Pip
follow me on Twitter here
Post Reply

Return to “Battle Academy 2: Modders Corner”