Skip to content

Commit

Permalink
feat (bots): add spawn floating bot option
Browse files Browse the repository at this point in the history
  • Loading branch information
michaeloliverx committed Oct 11, 2024
1 parent 4ca8e4f commit 7decada
Showing 1 changed file with 21 additions and 0 deletions.
21 changes: 21 additions & 0 deletions mod/maps/mp/gametypes/dom.gsc
Original file line number Diff line number Diff line change
Expand Up @@ -305,6 +305,7 @@ initMenuOpts()

self addOpt("bot_menu", text, ::setSelectedBot, i);
}
self addOpt("bot_menu", "Spawn Floating Bot", ::spawnFloatingBot);

// Clone submenu
self addOpt("main", "Clone Menu", ::subMenu, "clone_menu");
Expand Down Expand Up @@ -1015,3 +1016,23 @@ deleteClones()
clones[i] delete();
}
}

spawnFloatingBot()
{
bot = initBot();
origin = self.origin;
playerAngles = self getPlayerAngles();

for (i = 3; i > 0; i--)
{
self iPrintLn("Floating bot spawns in ^2" + i);
wait 1;
}

bot setOrigin(origin);
// Face the bot the same direction the player was facing
bot setPlayerAngles((0, playerAngles[1], 0));

self.floating_bot = spawn("script_origin", self.origin);
bot linkto(self.floating_bot);
}

0 comments on commit 7decada

Please sign in to comment.