Page 1 of 1

BaseAttribute

Posted: Sun Jan 06, 2013 3:53 pm
by enric
Can the base attribute for a specific unit be changed dynamically?

For example, I've several 37mm on the map but I want some of them be immobile (can not be carried).
I see that setting:

SetAttrib(id, "CanBeCarried", 0)

doesn't work because the LOAD file use the BaseAttribute, and there is not a SetBaseAttribute function.

I know I can modify the LOAD file, or duplicate the unit in the Squads file changing the base value, but a dynamically way will be preferred.

Re: BaseAttribute

Posted: Mon Jan 07, 2013 4:23 pm
by pipfromslitherine
Hmmm - no, there isn't really any way to do this. It's designed that way - to allow you to alter the base attrib would defeat its purpose.

Cheers

Pip

Re: BaseAttribute

Posted: Mon Jan 07, 2013 5:38 pm
by enric
The thing it's not clear for me is, why LOAD uses:

canBeCarried = GetBaseAttrib(me, "CanBeCarried") ;

and not

canBeCarried = GetAttrib(me, "CanBeCarried") ;

In fact, I checked all actions scripts and usually the attribute current value is used, the base attribute is usually used to compare:
if ( GetAttrib(me, "AP") >= GetBaseAttrib (me, "AP")

As it's as simple as that, I simple modify this line and everything goes ok, but I'll like to know if I'm missing something to avoid issues later.

Re: BaseAttribute

Posted: Mon Jan 07, 2013 6:54 pm
by pipfromslitherine
Hmmm - that's a fair point. We can pretty easily fix that for the next update. I can't think of any reason why that would use the base attrib, unless it is somehow set elsewhere in a temporary way, which it doesn't seem to be from a quick search. I will check with Iain and then replace all the Base occurances with normal calls.

Cheers

Pip