rg-ctf-utils
v1.0.5
Published
Utilities for the Regression Games Capture the Flag game mode
Downloads
4
Readme
rg-ctf-utils
A collection of utilities for use in the Regression Games Capture the Flag game mode.
Classes
Members
CTFEvent
RGCTFUtils
- RGCTFUtils
- new RGCTFUtils(bot)
- .setDebug(debug)
- .getFlagLocation() ⇒ Vec3 | null
- .approachFlag() ⇒ Promise.<boolean>
- .scoreFlag() ⇒ Promise.<boolean>
- .hasFlag() ⇒ boolean
new RGCTFUtils(bot)
| Param | Type | Description | | --- | --- | --- | | bot | RGBot | The bot to use when calling these utilities |
Example
const rgctfUtils = new RGCTFUtils(bot);
rgctfUtils.setDebug(debug)
| Param | Type | Description | | --- | --- | --- | | debug | boolean | Whether or not to print debug statements |
rgctfUtils.getFlagLocation() ⇒ Vec3 | null
Returns: Vec3 | null - The location of either the neutral flag OR a team's flag on the ground.
Example
const flagLocation = ctfutils.getFlagLocation();
if (flagLocation) await bot.approachPosition(flagLocation);
rgctfUtils.approachFlag() ⇒ Promise.<boolean>
Returns: Promise.<boolean> - true if the bot reached the location, false otherwise
See{getflaglocation}:
Example
await bot.approachFlag();
rgctfUtils.scoreFlag() ⇒ Promise.<boolean>
Returns: Promise.<boolean> - true if the bot reached the scoring zone, and false otherwise
Example
if (rgctfUtils.hasFlag()) {
await rgctfUtils.scoreFlag();
}
rgctfUtils.hasFlag() ⇒ boolean
Returns: boolean - true if the bot has the flag, false otherwise
Example
if (rgctfUtils.hasFlag()) {
await rgctfUtils.scoreFlag();
}
CTFEvent
© 2023 Regression Games, Inc.