What code should i use to make a scout move around to specific cordinates to make it work, like in Demo version scenario.
I did like this before, but it will make the game crash after around 699 or earlier marks
// Green Scout Start
CreateTimeTrigger(1, 1, 0, "ScoutMove");
// Scout
SCRIPT_API void ScoutMove()
{
// Scout
FightGroup &GreenScout = CreateFightGroup(Player[1]);
GreenScout.TakeUnit(SD.Scout);
GreenScout.SetRect(MAP_RECT(33+31, 81-1, 33+31, 81-1));
SD.GreenScout = GreenScout;
CreateTimeTrigger(1, 1, 0, "ScoutMove1");
}
SCRIPT_API void ScoutMove1()
{
FightGroup &GreenScout = CreateFightGroup(Player[1]);
GreenScout.TakeAllUnits(SD.GreenScout);
GreenScout.SetRect(MAP_RECT(12+31, 210-1, 12+31, 210-1));
SD.GreenScout = GreenScout;
CreateTimeTrigger(1, 1, 2100, "ScoutMove2");
}
SCRIPT_API void ScoutMove2()
{
FightGroup &GreenScout = CreateFightGroup(Player[1]);
GreenScout.TakeAllUnits(SD.GreenScout);
GreenScout.SetRect(MAP_RECT(170+31, 250-1, 170+31, 250-1));
SD.GreenScout = GreenScout;
CreateTimeTrigger(1, 1, 3200, "ScoutMove3");
}
SCRIPT_API void ScoutMove3()
{
FightGroup &GreenScout = CreateFightGroup(Player[1]);
GreenScout.TakeAllUnits(SD.GreenScout);
GreenScout.SetRect(MAP_RECT(250+31, 195-1, 250+31, 195-1));
SD.GreenScout = GreenScout;
CreateTimeTrigger(1, 1, 1500, "ScoutMove4");
}
SCRIPT_API void ScoutMove4()
{
FightGroup &GreenScout = CreateFightGroup(Player[1]);
GreenScout.TakeAllUnits(SD.GreenScout);
GreenScout.SetRect(MAP_RECT(250+31, 165-1, 250+31, 165-1));
SD.GreenScout = GreenScout;
CreateTimeTrigger(1, 1, 900, "ScoutMove5");
}
SCRIPT_API void ScoutMove5()
{
FightGroup &GreenScout = CreateFightGroup(Player[1]);
GreenScout.TakeAllUnits(SD.GreenScout);
GreenScout.SetRect(MAP_RECT(250+31, 5-1, 250+31, 5-1));
SD.GreenScout = GreenScout; //7700
CreateTimeTrigger(1, 1, 2930, "ScoutMove6");
}
SCRIPT_API void ScoutMove6()
{
FightGroup &GreenScout = CreateFightGroup(Player[1]);
GreenScout.TakeAllUnits(SD.GreenScout);
GreenScout.SetRect(MAP_RECT(162+31, 49-1, 162+31, 49-1));
SD.GreenScout = GreenScout;
CreateTimeTrigger(1, 1, 1500, "ScoutMove7");
}
SCRIPT_API void ScoutMove7()
{
FightGroup &GreenScout = CreateFightGroup(Player[1]);
GreenScout.TakeAllUnits(SD.GreenScout);
GreenScout.SetRect(MAP_RECT(188+31, 9-1, 188+31, 9-1));
SD.GreenScout = GreenScout;
CreateTimeTrigger(1, 1, 700, "ScoutMove8");
}
SCRIPT_API void ScoutMove8()
{
FightGroup &GreenScout = CreateFightGroup(Player[1]);
GreenScout.TakeAllUnits(SD.GreenScout);
GreenScout.SetRect(MAP_RECT(79+31, 45-1, 79+31, 45-1));
SD.GreenScout = GreenScout;
CreateTimeTrigger(1, 1, 1900, "ScoutMove9");
}
SCRIPT_API void ScoutMove9()
{
FightGroup &GreenScout = CreateFightGroup(Player[1]);
GreenScout.TakeAllUnits(SD.GreenScout);
GreenScout.SetRect(MAP_RECT(61+31, 60-1, 61+31, 60-1));
SD.GreenScout = GreenScout;
CreateTimeTrigger(1, 1, 250, "ScoutMove10");
}
SCRIPT_API void ScoutMove10()
{
// Scout
FightGroup &GreenScout = CreateFightGroup(Player[1]);
GreenScout.TakeAllUnits(SD.GreenScout);
GreenScout.SetRect(MAP_RECT(33+31, 81-1, 33+31, 81-1));
SD.GreenScout = GreenScout;
CreateTimeTrigger(1, 1, 600, "ScoutMove1");
}