Page 1 of 1

FUNCTION ALL_CHECK

Posted: Fri Mar 11, 2016 3:41 pm
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?

Re: FUNCTION ALL_CHECK

Posted: Fri Mar 11, 2016 4:48 pm
by pipfromslitherine
It may be that the internal logic compares the cost to unit APs and over-rides.

Cheers

Pip

Re: FUNCTION ALL_CHECK

Posted: Fri Mar 11, 2016 5:01 pm
by enric
But then it overrides the scripting system and its normal behavior, seems arbitrary, no?

Re: FUNCTION ALL_CHECK

Posted: Fri Mar 11, 2016 8:13 pm
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

Re: FUNCTION ALL_CHECK

Posted: Sat Mar 12, 2016 7:01 am
by enric
ok, but if BA makes an internal check on value 8, then we can't modify the load cost by scripting.

Re: FUNCTION ALL_CHECK

Posted: Sat Mar 12, 2016 5:22 pm
by pipfromslitherine
It only checks against how many APs the unit has. Which is pretty logical.

Cheers

Pip