A VICE target is an object which can be damaged with VICE, but is not associated with any particular avatar. Examples of potential VICE targets include walls, bridges, barrels, crates, etc. A player is not given credit for destroying a target within VICE itself, but it is possible to make a game using the VICE framework which utilizes these targets (like a team-based game of "destroy the enemy's base").
The format for link messages in VICE TGT is the same as any regular VICE vehicle sensor, with the exception that a "seated" message is not required. Setup of initial HP, armor type, and regeneration time being performed via notecard.
Installation:
To install VICE TGT into an object you would like to make destructable, you will need the following components:
- A VICE TGT sensor script. This must be placed in the root prim of the object
- VICE Target Config notecard. This must be placed in the root prim of the object
- A control script, created by you, which listens to the end user and controls the VICE scripts through link messages.
**Examine the VICE Test Target to see a full working example.
Configuring the "VICE Target Config" notecard:
- The VICE Target sensor script reads the first 3 lines of the notecard only.
Notecard Format:
INIT_HP=25 ; Initial HP (minimum is 1)
REGEN_TIME=30 ; Regeneration time in seconds after being destroyed (minimum time is 30s)
DAMAGE_TYPE=1 ; Type of Damage to receive. (1, 2, or 3)
Damage Type 1 is similar to an infantry unit, Damage Type 2 is similar to a light vehicle, and Damage Type 3 is similar to a heavily armored vehicle.
Link Messages
The following is a complete listing of all of the link messages that can be SENT TO a VICE TGT sensor:
integer is the numerical value you send in the link message's integer field. Integers are all whole numbers. TRUE=1, FALSE=0.
string is the text you send in the link message's string field. Strings are always in a "text" format.
key is the uuid you send in the link message's key field. Keys are typically in uuid format, although you can get extra functionality by using the field to communicate text and numerical values. This can be accomplished by preceding non uuid values in the key field with (key)
Description self explanatory
integer |
string |
key |
Description |
vice_on |
"vice ctrl" |
"" |
turns VICE on and off.
vice_on value of 0, or FALSE, turns VICE off. All other values turn it on. |
team |
"vice team" |
"" |
joins a team.
team=0 indicates no team, team 1~4 selects one of 4 possible teams. See "VICE Teams & Channels" for more information. |
channel_type |
"channel" |
channel_password |
joins a combat channel.
channel_type=0 joins the default public combat channel. channel_type=1 joins a private combat channel, specified by channel_password.
using "ff" as a prefix and appending to channel_password allows friendly fire to be turned on. See "VICE Teams & Channels" for more information. |
0 |
"death message" |
death_message |
sets a custom death message that another avatar will see when they kill you.
message is contained in death_message and is limited to 30 characters. |
The following is a complete listing of all of the link messages that are RECEIVED FROM the VICE TGT sensor:
integer is the numerical value received from the incoming link message's integer field. Integers are all whole numbers. TRUE=1, FALSE=0.
string is the text received from the incoming link message's string field. Strings are always in a "text" format.
key is the uuid you received from the incoming link message's key field. Keys are typically in uuid format; VICE uses the key field to send information that can be stored and kept as other variable types.
Description self explanatory
integer |
string |
key |
Description |
vice_stats |
"vice stats" |
link_hit |
Combination of all of a unit's VICE combat stats, in one line. received when combat is initialized, or whenever stats change.
vice_stats=(kills&63)<<26 | (deaths&63)<<20 | (hits&4095)<<8 | hp&255
This means that the maximum number of kills/deaths is 63 each, hits (damage dealt to other combatants) goes up to a maximum possible of 4095, and maximum HP is 255. By combining the stats, I believe that overall lag can be reduced, since any script interested in the combat statistics (like a HUD) only has to check for a single link message string. See the table below to for easy access to VICE stats parsing.
link_hit indicates the link that an incoming bullet collided with whenever HP has decreased. For splash damage (bombs etc) link_hit="-1" (LINK_SET). Otherwise, link_hit should always equal "1" for attached infantry guns, which means that the "avatar link" was hit. |
crash_code |
"crash" |
killer_id |
received when the target is destroyed.
See Crash Code table below for listing of all Crash Codes that are sent by VICE sensors |
Crash Code table:
crash_code |
Explanation |
0 |
uncrashed (unit regenerated) |
1 |
TCS initiated crash |
3+ |
VICE initiated crash |
3 |
death by SCG |
4 |
death by LMG |
5 |
death by HMG |
6 |
death by CAN |
7 |
death by SMG |
8 |
death by SSG |
9 |
death by MLE |
10 |
death by CMG |
13 |
death by SMB |
14 |
death by MDB |
15 |
death by LGB |
16 |
death by TRP |
17 |
death by KMK |
18 |
death by CMB |
Parsing VICE Stats
Variable |
How to extract from vice_stats |
vice_kills |
(vice_stats>>26)&63 |
vice_deaths |
(vice_stats>>20)&63 |
vice_hits |
(vice_stats>>8)&4095 |
vice_hp |
vice_stats&255 |
|