locustmustdie wrote: Wed Aug 03, 2022 2:53 am
In Function.bsf
TeamArrived(side,team) means the team selected DistanceBetween the “Point”<=1 what’s that Point for?Is it the same as the (tilex,tiley)in MoveTeamCoord(side,team,tilex,tiley,aggr) ?
I wanna use it this way
Code: Select all
MoveTeamCoord(side,team,tilex,tiley,aggr);
If (TeamArrived(side,team) == 1)
{
If (GetUnitTeam(me) == team)
{
SetAttrib(me,facing);
}
}
But it doesn’t work. The “TeamArrived()” function only compatible with “MoveTeam()”(non-coord)?
I think this function only works with the AI Points which set in the Editor (open custom AI data dialog button). You can copy this function in your module with the next changes:
Code: Select all
FUNCTION TeamArrived(side, team, tilex, tiley)
{
int x1 ;
int y1 ;
int ret ;
if (IsValidTile(tilex, tiley) == 1)
{
x1 = GetTeamActiveX(side, team) ;
y1 = GetTeamActiveY(side, team) ;
// If distance to point <= 1 team has arrived, if not: it has not arrived
if( GetDistanceBetweenTiles(x1, y1, tilex, tiley) <= 1 )
{
ret = 1 ;
}
else
{
ret = 0 ;
}
}
else
{
ret = 1 ;
}
return ret ;
}
It must work in this case. The function itself is no longer found in the game scripts, so its name can be left unchanged.
Update. The final version in 4:45.