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!
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.
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.|
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.