1.0.5 • Published 1 year ago

rg-ctf-utils v1.0.5

Weekly downloads
-
License
ISC
Repository
github
Last release
1 year ago

rg-ctf-utils

NPM

A collection of utilities for use in the Regression Games Capture the Flag game mode.

Classes

Members

CTFEvent

RGCTFUtils

new RGCTFUtils(bot)

ParamTypeDescription
botRGBotThe bot to use when calling these utilities

Example

const rgctfUtils = new RGCTFUtils(bot);

rgctfUtils.setDebug(debug)

ParamTypeDescription
debugbooleanWhether 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.