An infantry weapons are always used as an attachment. An infantryman may only have 1 gun active at any given time. Certain infantry weapons such as SCG and SSG allow the inclusion of a CMB bomb rezzer as a secondary weapon.
Installation
To install VICE into an infantry weapon, you will need the following components:
- AVICE infantry sensor script, which must be placed in the root prim of the weapon
- A trigger/control script, created and scripted by you, which listens to the end user and controls the VICE scripts by sending the appropriate link message, as well as listening for link messages from the VICE sensor to initiate certain behavior (ie: start an animation after you die).
NOTE: Examine the VICE test guns to see full working examples
Optional components:
- VICE bullet rezzer scripts, with accompanying bullet object and melee attack object
For infantry guns, you can place the bullet rezzer scripts in any prim of the gun. Unless otherwise configured, bullets will always rez at an offset of <1.6,0.0,0.0> relative to the direction the avatar is facing, in the "forward" direction.
The SCG, SMG, and CMG bullet rezzer scripts come in 2 pieces: a master script and a slave script. You will need to place both scripts into the same prim, in order to have a working gun
Bullets for each weapon type are unique, so you will need to match them by name (for example the "VICE SSG Bullet Rez v1.1.0" script uses the "VICE SSG Bullet Rez v1.1.0" bullet object.
The bullet rezzer scripts also control the melee attack. Insert the "VICE MLE Bullet v1.1" into the same prim as the bullet rezzer script to have a working melee attack. The melee "bullet" is an invisible object which rezzes in front of the avatar at 0 velocity, but otherwise works similarly to the other bullet types.
When you first insert any bullet rezzer kit which include s a slave script, the slave script will rez bullets constantly in the direction of fire. Do not be alarmed, however- those bullets are not combat-enabled and cannot hurt other VICE combatants. To stop this constant rezzing, place the "Disable VICE Bullet Slave script" script into the same prim as your bullet rezzer; it will disable any slave scripts it finds.
- A VICE bomb rezzer script, configuration notecard, and VICE bombs (placed in any prim of the weapon). See the VICE Bombs section of the guide for more details.
- The TCS/CCC addon script (only available for INF, ALA, AMA, BLA, and TLA units), which must be placed in the root prim with the corresponding VICE sensor script. See the "3rd Party Combat Support" section for further details.
For working examples, please try the VICE infantry test guns, which feature full-permission trigger scripts.
Link Messages
To enable VICE and start shooting stuff, your control or trigger script must send the "seated" message to the linkset, then the "vice ctrl" message to enable VICE. Then simply send the "gun ctrl" message to the linkset when the gunner starts or stops firing.
The following is a complete listing of all of the link messages that can be SENT TO the VICE INF 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 |
is_seated |
"seated" |
gunner_key |
associates an avatar's uuid with the combat sensor.
is_seated value of 0, or FALSE, disassociates the av; values >1 or TRUE associate it with gunner_key, which is uuid of avatar. INF gunner_key should be llGetOwner(). |
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. |
gun_fire |
"gun ctrl" |
rez_offsets |
Controls firing of the gun
for full auto mode/weapons, gun_fire value of 0, or FALSE, ceases fire. All other values fires gun.
for semi auto mode/weapons, gun_fire value of 1, or TRUE causes single bullet to be rezzed.
rez_offsets offers a non-default bullet rez position and rotation offset, and is only available in semi-auto mode.
rez_offsets is parsed as a string with 2 comma-separated values: rez_pos_offset and rez_rot_offset. A typical value for rez_offsets might be "<2.3,-0.38,-0.2>,<0.0,0.0,0.0,1.0>", with rez_pos_offset=<2.3,-0.38,-0.2> and rez_rot_offset=<0.0,0.0,0.0,1.0> (zero rotation). In this case, the bullet would fire in the default direction but have a different rez offset position than default. <2.3,-0.38,-0.2> (which is used by the SSG test gun) might be a good rez offset value for a kneeling infantryman. |
reload_state |
"reload" |
"" |
instruct SCG and SMG guns to reload if ammo is depleted.
SCG and SMG will only reload if reload_state is sent with a value of 2 |
bullet_type |
"bullet type" |
"" |
toggles firing modes in INF weapons.
for SCG and SMG, bullet_type value of 0 is semi auto, value of 1 is full auto.
for SSG, bullet_type value of 0 is short rage bullet, value of 1 is long range bullet |
0 |
"stab" |
"" |
initiates melee attack in SCG, SMG, and SSG weapons.
If MLE attack is initiated during reloading, reloading time is reset. |
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. |
bomb_control |
"bomb" |
"" |
sent by control script to instruct bombs to drop.
bomb_control>=0 drops bomb(s). bomb_control=0 will drop all bombs available in the payload, while bomb_control=1,2,3 or 4 instructs rezzer to drop certain bomb in the payload.
reloading time for bombs is 10 seconds once payload is expended. |
The following is a complete listing of all of the link messages that are RECEIVED FROM the VICE INF 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. |
reload_state |
"reload" |
"" |
received to indicate ammunition status of SCG, SMG, SSG, and CAN.
reload_state=0 indicates ammo is depleted (SCG and SMG only), reload_state=1 indicates reload is complete and gun is ready to fire (SCG,SMG,SSG,CAN). |
overheat_state |
"overheat" |
"" |
received to indicate overheat state of machine gun/cannon (CMG,LMG,HMG)
overheat_state=1, or TRUE indicates the gun is overheated and unable to fire. overheat_state=0, or FALSE indicates the gun is able to fire. Sent by only one gun to reduce link message chatter. |
crash_code |
"crash" |
killer_id |
received when the player dies.
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 |
|