header image
Home arrow VICE Bombs
VICE Bombs PDF Print E-mail
Written by VICE Admin   
Apr 02, 2009 at 02:37 AM

The VICE bomb rezzer system consists of 3 pieces:

  • "VICE Bomb" script: placed inside the desired bomb object
  • "VICE Bomb Rezzer" script: placed in any prim of your weapon or vehicle
  • "VICE Bomb Config" notecard, placed in the same prim as "VICE Bomb Rezzer"


These 3 pieces cover all 4 VICE bomb types, as well as non-VICE bombs. The bomb object must be built by you, and thus special effects and other designs are completely customizable. To configure a bomb as SMB, MDB, LGB, or TRP, prefix the bomb's object name accordingly:


Type 

Bomb Name Prefix 

 SMB

"VICE SMB"

 MDB

"VICE MDB"

 LGB

"VICE LGB"

 TRP

"VICE TRP"

For instance, a hand grenade that is an SMB should be called "VICE SMB Hand Grenade" or something similar.  If the bomb isn't appropriately named for VICE, it will function as a non-VICE bomb and not inflict any VICE damage.

Payload Configuration 
Each VICE unit is capable of carrying multiple payloads of bombs.  Each payload has 4 slots for bombs, although the number of VICE bombs available depends on the unit's carrying capacity (see "Unit Stats & Loadouts" for details). Bomb loadouts are configured in the "VICE Bomb Config" notecard, specifying bomb names, rez position offsets, rez rotation offsets, and rez velocity offsets.  Since each payload has a fixed number of 4 slots, you must fill empty slots with "NULL" bombs, which are parsed but ignored by the rezzer.  Using the "bt" link message (see below), the weapon can toggle between payload configurations.

  • Example 1: A single-bomb configuration

The following "VICE Bomb Config" notecard configures a single payload for a single bomb, called "VICE SMB RPG":
VICE SMB RPG,NULL,NULL,NULL
<2.1,-0.1,0.6>,NULL,NULL,NULL
<0.0, 0.0, 0.0, 1.0>,NULL,NULL,NULL
<12.0,0.0,0.0>,NULL,NULL,NULL

  1.  The first line supplies the inventory names of the bombs (which must be placed in the same prim as the VICE bomb rezzer script).
  2. The second line shows the rez offset of the bomb, relative to the root prim (or avatar, in the case of attached infantry weapons).  The best values depend on the units geometry, but any offset of distance >10m will silently fail.  In this example, the RPG is rezzed slightly in front of and above the avatar's position.
  3. The third line corresponds to the local rotation to rez the bomb at, relative to the unit. Angles are expressed in quaternions, so <0.0, 0.0, 0.0, 1.0> corresponds to "zero rotation".  If you are unsure about which rotation to use, try this value.
  4. The fourth line corresponds to the velocity at which the bomb is rezzed, relative to the unit's velocity and rotation.  The maximum offset speed is 12m/s (faster values will be capped).  In this example, the RPG will travel +12m/s forward when it is rezzed.
  • Example 2: A multi-payload configuration

The following "VICE Bomb Config" notecard configures 2 different payloads, one payload with 2 SMBs and another payload with an MDB and a non-VICE bomb:

VICE SMB 100kg,VICE SMB 100kg,NULL,NULL,VICE MDB 200kg,Smoke Bomb,NULL,NULL,
<2.0,-5.0,-0.5>,<2.0,5.0,-0.5>,NULL,NULL,<2.0,0.0,-1.5>,<-2.0,0.0,-1.5>,NULL,NULL
<0.0,0.0,0.0,1.0>,<0.0,0.0,0.0,1.0>,NULL,NULL,<0.0,0.0,0.0,1.0>,<0.0,0.0,0.0, 1.0>,NULL,NULL
<0.0.0,0.0,0.0>,<0.0.0,0.0,0.0>,NULL,NULL,<0.0.0,0.0,0.0>,<0.0.0,0.0,0.0>,NULL,NULL

 This configuration is more typical for an AMA's bomb payload: One payload is a pair of SMBs (one on each wing), while another payload includes a single MDB underneath the airplane's bellyand a non-VICE "smoke bomb" also rezzed underneath, slightly more aft.  Notice how the offset velocity of a bomb is a zero vector.


Scripting The Bomb Object 
When a VICE bomb is rezzed by the VICE Bomb rezzer, it must be detonated.  The "VICE Bomb" script 'detonates' when it receives the "explode" link message from a controller script in the bomb (which might also handle special effects). Detonation can be triggered by a number of conditions: a collision (like the freebie CMB Test gun), a timed event (like the hand grenades that come with the freebie SCG and SSG Test guns), or even proximity to a sensed avatar.  Remember that CMB, SMB, MDB, and LGB bomb types can only detonate above the water line, and that the TRP bomb type can only detonate underwater.  Also, the bomb must be nonphantom when detonating, or else the VICE Bomb script will refuse to act (this is an anti-cheating mechanism).
 
IMPORTANT:  Be sure to add the VICE Bomb script last, and keep a backup copy of the bomb in your inventory. The VICE Bomb script will call llDie() on detonation, or if it's rezzed by something other than VICE.  The best way to edit a bomb after it becomes VICE-enabled is to attach it to your avatar, possibly while your avatar hovers in the air to avoid collision events.
For some guidance on scripting a VICE bomb, take a look at the RPG and potato masher grenades found inside the infantry test guns. 

 Link Messages
The following is the full set of link messages uesd for controlling VICE bombs and the bomb rezzer:


integer 

string 

 key

Description 

 bomb_control

"bomb" 

 ""

 Sent by the vehicle/weapon control script to the bomb rezzing script with bomb_control>=0 when dropping a bomb, and it is sent from the bomb rezzing script with bomb_control<0 to indicate that the bomb rezzer has reloaded and is able to drop another bomb.  bomb_control=0 indicates that the rezzer should drop all available bomb types in the current bomb payload, while bomb_control=1, 2, 3, or 4 instructs the bomb rezzer to drop that certain bomb type in the current payload.  The negative value (bomb_control= -1, -2, -3, 4) is sent from the bomb rezzer to indicate that a bomb type has reloaded and is able to be used again.  The reloading time for all bombs, regardless of unit type, is 10s.

 bomb_type

"bomb type"

 ""

 Sent by the vehicle/weapon control script to the bomb rezzer script to select another bomb payload set.  if bomb_type=0, the bomb rezzer script will select the next loadout of available bombs.  For nonzero values bomb_type=N, bomb payload set N will be activated.  Note that changing the bomb payload causes a 10s delay before the new payload set can be used.

  0

 "explode"

 ""

 Sent by a control script inside a bomb to the "VICE Bomb" script, triggering the bomb to detonate with VICE.  This message is usually triggered by either a collision or timer event, although many other trigger conditions are possible.  Note that the VICE bomb won't react if the bomb is an above-water type (SMB/MDB/LGB) and the bomb has detonated underwater, or if the bomb is a TRP and has detonated above water.

 Other Notes

For almost any type of bomb (VICE or otherwise), you will want to set the bomb object as both physical and temporary before taking it into your vehicle's inventory.  If the bomb is nonphysical when rezzed, it won't be able to move.  If the bomb is not temporary, I believe it causes extra asset server lag, and might have issues with parcel prim limits.


Last Updated ( Apr 02, 2009 at 10:52 AM )
Login Form
Username

Password

Remember me
Password Reminder
No account yet? Create one