Page 1 of 1
Ask for help:About increasing the maneuverbility,setting ”AP”didn’t work
Posted: Mon Jul 18, 2022 2:29 am
by locustmustdie
To allow the vanguard of side0 launching a long and continuous pursuit. Increased AP points will be necessary. When I type Setattrib(ID,"AP",16); to a MAA(AP originally 14), It’s AP was still 14 in gameplay. I guess the value I set exceeded the maximum limitation?
So I have to try the other way? Using function setting unit moving cost?
Re: Ask for help:About increasing the maneuverbility,setting ”AP”didn’t work
Posted: Mon Jul 18, 2022 6:02 am
by rbodleyscott
You will also need to
SetBaseAttrib(ID, "AP", 16)
because the AP are reset to that at the start of each turn.
Re: Ask for help:About increasing the maneuverbility,setting ”AP”didn’t work
Posted: Mon Jul 18, 2022 7:37 am
by Cronos09
locustmustdie wrote: Mon Jul 18, 2022 2:29 am
To allow the vanguard of side0 launching a long and continuous pursuit. Increased AP points will be necessary. When I type Setattrib(ID,"AP",16); to a MAA(AP originally 14), It’s AP was still 14 in gameplay. I guess the value I set exceeded the maximum limitation?
So I have to try the other way? Using function setting unit moving cost?
I think if you use this script (or something like that) in your
Scenario.BSF it will work (at least such script composition works in P&S):
Code: Select all
FUNCTION StartTurnPost(side)
{
int i;
int id;
int turn;
int team;
turn = GetTurn();
if (side == 0)
{
// if (turn <= 12) // till turn 7 including
// {
for (i = 0; i < GetUnitCount(0); i++)
{
id = GetUnitID(0,i);
if (id != -1)
{
if ((IsUnitValid(id) == 1) && (IsUnitSquadType(id, "Knights") == 1))
{
team = GetUnitTeam(id);
if (team == 0)
{
// if (GetAttrib(id, "MoraleState") < 2) // only for Steady or Disrupted units
// {
SetAttrib(id, "AP", 16);
// }
}
}
}
}
// }
}
It works for team '0'. Change '0' for the team you need:
if (team == 0).
I commented out the conditions of turns and morale state. You can use it with your own parameters (do not forgot to delete // in this case)
Re: Ask for help:About increasing the maneuverbility,setting ”AP”didn’t work
Posted: Mon Jul 18, 2022 12:29 pm
by locustmustdie
Thanks,Richard!
Thanks,Cronos!
Re: Ask for help:About increasing the maneuverbility,setting ”AP”didn’t work
Posted: Tue Jul 19, 2022 12:21 am
by locustmustdie
rbodleyscott wrote: Mon Jul 18, 2022 6:02 am
You will also need to
SetBaseAttrib(ID, "AP", 16)
because the AP are reset to that at the start of each turn.
I tried,”error:setbaseattrib undefined variety”
I checked the tools.bsf,there’s GetBaseAttrib(), no SetBaseAttrib() found. Might have to looking for other methods.
Re: Ask for help:About increasing the maneuverbility,setting ”AP”didn’t work
Posted: Tue Jul 19, 2022 6:31 am
by rbodleyscott
locustmustdie wrote: Tue Jul 19, 2022 12:21 am
rbodleyscott wrote: Mon Jul 18, 2022 6:02 am
You will also need to
SetBaseAttrib(ID, "AP", 16)
because the AP are reset to that at the start of each turn.
I tried,”error:setbaseattrib undefined variety”
I checked the tools.bsf,there’s GetBaseAttrib(), no SetBaseAttrib() found. Might have to looking for other methods.
Ah yes, you are right. Sorry.
You will need to set their "AP" to 16 in StartTurnPost() in your scenario script.
This is activated after the vanilla StartTurn() function, so that way they will be switched back to 16 AP after the vanilla script has updated them to 14.
Re: Ask for help:About increasing the maneuverbility,setting ”AP”didn’t work
Posted: Wed Jul 20, 2022 3:12 pm
by locustmustdie
It works! Thanks Richard! Thanks Cronos09!

- 1E2A6B49-4CF4-42FC-BA6F-61B08C4DD947.jpeg (727.48 KiB) Viewed 706 times