Author Topic: Bot Light Event  (Read 825 times)

Would it be possible to create an event that mimics a player light but for bots?

Something like: onBotSpawn -> Bot -> SetBotLight -> On/Off

There should also be a Green Option.

Was made by Chrono. Modified it so it'll work with the default bot system.
Code: [Select]
function AIPlayer::SetBotLight(%bot, %data)
{
if(isObject(%bot.light) && %bot.light.dataBlock.getID() == %data)
{
return;
}

if(isObject(%bot.light))
{
%bot.light.delete();
}

if(%data == -1)
{
return;
}

%bot.light = new fxlight()
{
dataBlock = %data;
enable = true;
iconSize = 1;
player = %bot;
};

%bot.light.attachToObject(%bot);
}

registerOutputEvent("Bot", "SetBotLight", "dataBlock FxLightData");

Was made by Chrono. Modified it so it'll work with the default bot system.
-code snip
Do we put this into an addon, or where can we find this?