Kak0 wrote:Fadden wrote:Hi,
What are the conditions needed for bots follow path ? In a test mode, I spawn bot but they never move. The map is Horde_single and the spawn function the same as the horde script one, so the driver behaviour is patrol. I don't understand why they don't move.
Mmm I don't really see where it can come from, all the bot needs is a path and the Patrol behaviour. You didn't change the map I guess ? Can I see your script ?
For example with this very simple script that does nothing except spawing bots and players, bots don't move. They shoot when you approach, stop shoot when you are too far, and never shoot again if you are anew next to them.
The map used is Horde_single. I suppose I do something wrong...
Code: Select all
#Extends "Modes/ShootMania/ModeBase.Script.txt"
#Include "MathLib" as MathLib
#Include "TextLib" as TextLib
#Include "Libs/Nadeo/ShootMania/SM.Script.txt" as SM
/********************************************/
***StartServer***
***
UseClans = True;
UseForcedClans = True;
MB_UseSectionRound = True;
***
***StartMap***
***
SM::SetupDefaultVisibility();
***
***StartRound***
***
UIManager.UIAll.ScoreTableVisibility = CUIConfig::EVisibility::Normal;
SM::UnspawnAllPlayers();
DestroyAllBotPlayers();
UIManager.UIAll.UISequence = CUIConfig::EUISequence::Playing;
StartTime = Now + 3500;
foreach(Spawn in BotPaths)
{
VSpawnBot(Spawn);
}
foreach(Player in Players)
{
VSpawnPlayer(Player);
}
EndTime = StartTime + 90 * 1000;
***
***PlayLoop***
***
foreach (Event in PendingEvents)
{
}
if (Now >= EndTime && !MB_StopRound)
{
MB_StopRound = True;
}
***
***EndRound***
***
EndTime = Now;
SM::UnspawnAllPlayers();
DestroyAllBotPlayers();
UIManager.UIAll.CountdownEndTime = -1;
UIManager.UIAll.UISequence = CUIConfig::EUISequence::EndRound;
UIManager.UIAll.ScoreTableVisibility = CUIConfig::EVisibility::ForcedVisible;
MB_Sleep(7000);
foreach (Score in Scores)
{
if (Score.Points >= 10)
{
MB_StopMap = True;
break;
}
}
***
***EndMap***
***
UIManager.UIAll.ScoreTableVisibility = CUIConfig::EVisibility::ForcedVisible;
UIManager.UIAll.UISequence = CUIConfig::EUISequence::Podium;
MB_Sleep(8000);
***
/////////FUNCTIONS///////////////////////////////////////////////////////////////////////////
// Spawn player
Void VSpawnPlayer(CSmPlayer Player)
{
Player.ArmorMax = 100;
SetPlayerWeapon(Player, CSmMode::EWeapon::Laser, True);
SM::SpawnPlayer(Player, 1, BlockSpawns[0]);
}
Void VSpawnBot(CSmScriptBotPath Spawn)
{
declare BotPlayer = CreateBotPlayer(NullId, 2, 100, Spawn, -1);
assert (BotPlayer != Null && BotPlayer.Driver != Null);
BotPlayer.Driver.Behaviour = CSmPlayerDriver::ESmDriverBehaviour::Patrol;
BotPlayer.Driver.Patrol_Mode = CSmPlayerDriver::ESmDriverPatrolMode::Loop;
BotPlayer.Driver.ShootPeriodMin = 50;
BotPlayer.Driver.ShootPeriodMax = 500;
BotPlayer.Driver.Accuracy = 0.5;
BotPlayer.Driver.ReactionTime = 100;
BotPlayer.Driver.RocketAnticipation = True;
BotPlayer.Driver.DisengageDistance = 20.;
BotPlayer.Driver.AggroRadius = 15.;
BotPlayer.EnergyLevel = 0.;
BotPlayer.SpeedPower = 1.;
}