BSL:AI tasks

From OniGalore
Revision as of 17:12, 26 March 2021 by Iritscen (talk | contribs) (link fix)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

Commands for controlling the activity of AIs.

Contents
Kind Type Name Platform
Italic f.png void ai2_attack Platform-Win.png Platform-Mac.png
Italic f.png void ai2_barabbas_retrievegun Platform-Win.png Platform-Mac.png
Italic f.png void ai2_comehere Platform-Win.png Platform-Mac.png
Italic f.png void ai2_doalarm Platform-Win.png Platform-Mac.png
Italic f.png void ai2_dopath Platform-Win.png Platform-Mac.png
Italic f.png void ai2_followme Platform-Win.png Platform-Mac.png
Italic f.png void ai2_idle Platform-Win.png Platform-Mac.png
Italic f.png void ai2_lookatchar Platform-Win.png Platform-Mac.png
Italic f.png void ai2_lookatme Platform-Win.png Platform-Mac.png
Italic f.png void ai2_movetoflag Platform-Win.png Platform-Mac.png
Italic f.png void ai2_setjobstate Platform-Win.png Platform-Mac.png

void
string or int
string or int
Edit this info
ai2_attack(
ai_name or script_id,
target_name or target_script_id
);
default: --
--
--

Forces one AI to attack another, e.g. "ai2_attack IntroNinja 0".


void
string or int
Edit this info
ai2_barabbas_retrievegun(
ai_name or script_id
);
default: --
--

This was a "specialty" function written for the Barabas boss fight on the upper terrace of the TCTF HQ. It was apparently designed simply to make sure that his gun could not be lost over an edge before the fight began. Although it takes a character as an argument, you won't find any use for this function because it is hardcoded for such specific circumstances: it will teleport the WMC into a character's hands if it is below 700 world units in altitude and no one is holding it.


void
string or int
Edit this info
ai2_comehere(
ai_name or script_id
);
default: --
--

The AI passed into this function will perform the necessary pathfinding to come stand next to you, provided such a route is possible. Apparently intended for development purposes, as it is not used in the level scripts. To make an AI come to you and keep following you, use "ai2_followme" below.


void
string or int
int
Edit this info
ai2_doalarm(
ai_name or script_id,
console_id
);
default: --
--
--

Tells an AI to run for the specified alarm. The AI must be active to perform this task.


void
string or int
string
Edit this info
ai2_dopath(
ai_name or script_id,
path_name
);
default: --
--
--

Tells an AI to move along a particular patrol path. The AI must be active to perform this task.


void
string or int
Edit this info
ai2_followme(
ai_name or script_id
);
default: --
--

Tells an AI to follow the player. In theory, this is how Oni could tell an AI to fight alongside you. In practice, this function is only used in the first TCTF level, and the level script function that calls it seems to be unused. If you do see an AI following you, it will not be due to this BSL function, but due to the <Follow> data in their NEUT setup. To make an AI follow you as a test of pathfinding, you can also use the ai2_chump command. To make an AI come to your position and then stop, use "ai2_comehere" above.


void
string or int
Edit this info
ai2_idle(
ai_name or script_id
);
default: --
--

Clears an AI's goals, whether they are in pursuit mode, seeking an alarm, panicking, etc. Apparently used for development, as it is not in any level scripts.


void
string or int
string or int
Edit this info
ai2_lookatchar(
ai_name or script_id,
ai_name or script_id
);
default: --
--
--

Tells the first specified AI to look at the second specified AI. If you want the player character to look at an AI, you must first use "ai2_takecontrol 1".


void
string or int
Edit this info
ai2_lookatme(
ai_name or script_id
);
default: --
--

Tells the specified AI to look at the player character.


void
string or int
int
string
Edit this info
ai2_movetoflag(
ai_name or script_id,
flag_id,
setfacing
);
default: --
--
--
""

Tells an AI to move to a flag, assuming such a route is possible (flag locations by ID are available here). If you pass the string "setfacing" for the argument "setfacing", then the AI will also assume the facing angle that is part of the flag data when they reach the flag. If you want the player character to move to a flag, you must first use "ai2_takecontrol 1".


void
string or int
Edit this info
ai2_setjobstate(
ai_name or script_id
);
default: --
--

Tells an AI to take its current state as its job. The AI must be active to perform this task.