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_type | what it does |
---|---|
listen_meter_state | Listens for BNWCS meters changing between combative/non-combative/dead/loading states. |
listen_deaths | Listens for one avatar killing another. |
listen_teams | Listens for avatars joining or changing BNWCS teams. |
listen_flag_caps | Listens for BNWCS flags being captured. |
listen_chatter | Listens to the BNWCS radios. |
listen_splash | Listens for incoming BNWCS splash damage. |
listen_splash_hits | Listens 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_headshots | Listens for one avatar hitting another in the head. |
listen_multikills | Listens for one avatar killing more than one avatar within 5 seconds of each other. |
listen_sprees | Listens for one avatar killing 5 or more others without dying. |
listen_all | Listens for all of the above. |
listen_none | Stops 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_type | heard_type | data 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 |