BNWCS Info API

This API is still in the 'beta' stages. It is quite possible that everything may not work right. Please report any bugs to Matthias Rozensztok!

Intro

To listen for and react to things that happen in the BNWCS, you will need the "BNWCS Developer's Kit."

The BNWCS Info API allows you to listen for and react to various BNWCS events, such as avatar death, meter state change, avatars joining a team, or flags being captured.

To use the Info API, all you need to do is drop the "BNWCS.api.info.lsl" script into an object. Then, depending on what you tell the API to listen for, it will send you scripts linked messages whenever something happens.

Listen Types

To tell the Info API to listen for a particular type of BNWCS event, send it a linked message in the following format:

//----------
llMessageLinked(LINK_SET , listen_state , "listen_type" , "");
//----------

listen_state is a TRUE or FALSE integer - depending on whether you want the API to listen for the specified type of event or not. By default, the API is not listening for anything.

A summary of the currently-accepted "listen_types" follows:

listen_typewhat it does
listen_meter_stateListens for BNWCS meters changing between combative/non-combative/dead/loading states.
listen_deathsListens for one avatar killing another.
listen_teamsListens for avatars joining or changing BNWCS teams.
listen_flag_capsListens for BNWCS flags being captured.
listen_chatterListens to the BNWCS radios.
listen_splashListens for incoming BNWCS splash damage.
listen_splash_hitsListens for avatars being hit by BNWCS splash damage.
The prim with the Info API in it must be within 10 meters of an avatar to know if the avatar was hit by splash damage.
listen_headshotsListens for one avatar hitting another in the head.
listen_multikillsListens for one avatar killing more than one avatar within 5 seconds of each other.
listen_spreesListens for one avatar killing 5 or more others without dying.
listen_allListens for all of the above.
listen_noneStops listening.

Return Types

When the Info API hears one of the events you asked it to listen for, it will send a linked message in the following format:

//----------
llMessageLinked(LINK_SET , 0 , "heard_type" , "data");
//----------

A summary of the types of linked messages you will receive for a given listen_type are as follows. Unless otherwise noted, "data" is all one line, with no newlines or carriage returns. Hold your mouse over an underlined word in the 'data format' box for an explanation of that piece of data.

listen_typeheard_typedata format
listen_meter_state meter_state Avatar_UUID|meter_state
listen_deaths obituary Victim_UUID|Victim_Name|Killer_UUID|Killer_Name
listen_teams meter_state Avatar_UUID|Team
listen_flag_caps flag_capture Team|TeamScore|Flagbearer_UUID
round_win
listen_chatter comm_chatter Chatter_UUID|Chatter_Name|What_They_Said|Chatter_Team
listen_splash bnwcs_splash Damage|Maximum_Range|Distance_From_Me|Attacker_UUID|Target_UUID
listen_splash_hits bnwcs_splash_dealt Victim_UUID|Victim_Name|Attacker_Name|Attacker_Distance_From_Victim|Source_Name|Source_Distance_From_Victim|Damage
listen_headshots achievement Achievement_Type|Achiever_Name|Achiever_UUID|Victim_Name|Victim_UUID|counter
listen_multikills
listen_sprees


Last updated Mar 27, 2010
meter_state
integer

Values:
0: Loading
1: Non-combative
2: Combative
3: Dead
Team
string

Values:
None, Red, Orange, Yellow, Green, Blue, Purple, Pink
Achievement_Type
string

Values:
headshot, multi_kill, killing_spree
This is a list of all the avatar's statistics and ranking information for the current sim, in stat=value format.

You would probably want to split this string at an ampersand (&) character, then split each of THOSE pieces at an equals sign (=).

The statistics are identified by shortened names in lower-case, as follows:

rtg: Rating
k: Kills
d: Deaths
a: Assists
kpd: Kills per Death
m: Longest Life
p: Total Playtime
r: Revived
hl: Healed
s: Sniped
hd: Headshots
mk: Multikills
ks: Killing Sprees
rnk: Rank
This is a list of all of the sim's settings, as provided by the "BNWCS Combat Zone Custom Settings Server" object.

You would probably want to split this string at an ampersand (&) character, then split each of THOSE pieces at an equals sign (=).

More information about all the different settings you will encounter in this string can be found at http://BNWCS.org/?zone_notes
Statistic_Name
string

Values:
Rating
Kills
Deaths
Assists
KPD (Kills per Death)
Maxlife (Longest Life)
Playtime (Total Playtime)
Revived
Healed
Sniped
Headshots
Multikills
Sprees (Killing Sprees)
Rank