Ask for help:About increasing the maneuverbility,setting ”AP”didn’t work

Moderator: rbodleyscott

Post Reply
locustmustdie
Senior Corporal - Destroyer
Senior Corporal - Destroyer
Posts: 117
Joined: Fri Mar 05, 2021 11:33 am

Ask for help:About increasing the maneuverbility,setting ”AP”didn’t work

Post 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?
rbodleyscott
Field of Glory 2
Field of Glory 2
Posts: 28429
Joined: Sun Dec 04, 2005 6:25 pm

Re: Ask for help:About increasing the maneuverbility,setting ”AP”didn’t work

Post by rbodleyscott »

You will also need to

SetBaseAttrib(ID, "AP", 16)

because the AP are reset to that at the start of each turn.
Richard Bodley Scott

Image
Cronos09
Staff Sergeant - Kavallerie
Staff Sergeant - Kavallerie
Posts: 337
Joined: Thu Feb 22, 2018 4:28 pm

Re: Ask for help:About increasing the maneuverbility,setting ”AP”didn’t work

Post 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)
locustmustdie
Senior Corporal - Destroyer
Senior Corporal - Destroyer
Posts: 117
Joined: Fri Mar 05, 2021 11:33 am

Re: Ask for help:About increasing the maneuverbility,setting ”AP”didn’t work

Post by locustmustdie »

Thanks,Richard!
Thanks,Cronos!
locustmustdie
Senior Corporal - Destroyer
Senior Corporal - Destroyer
Posts: 117
Joined: Fri Mar 05, 2021 11:33 am

Re: Ask for help:About increasing the maneuverbility,setting ”AP”didn’t work

Post 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.
rbodleyscott
Field of Glory 2
Field of Glory 2
Posts: 28429
Joined: Sun Dec 04, 2005 6:25 pm

Re: Ask for help:About increasing the maneuverbility,setting ”AP”didn’t work

Post 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.
Richard Bodley Scott

Image
locustmustdie
Senior Corporal - Destroyer
Senior Corporal - Destroyer
Posts: 117
Joined: Fri Mar 05, 2021 11:33 am

Re: Ask for help:About increasing the maneuverbility,setting ”AP”didn’t work

Post by locustmustdie »

It works! Thanks Richard! Thanks Cronos09!
1E2A6B49-4CF4-42FC-BA6F-61B08C4DD947.jpeg
1E2A6B49-4CF4-42FC-BA6F-61B08C4DD947.jpeg (727.48 KiB) Viewed 705 times
Post Reply

Return to “Field of Glory II: Medieval - Scenario Design”