# TACTEvents Guide for Mission Editors

## Tactician

## 12-13-03

### Introduction

TACTEvents is an addon package originally developed to add event-based effects to the Marine Assault Pack addon for OFP.

This document is intended to help mission editors use TACTEvents with units and weapons outside of the Marine Pack. It will cover initializing TACTEvents in single/multiplayer environments, turning hit effects on and off, and modifying weaponFX arrays.

### Revision History

- Version 0.9 : Pre-release

### How it works

TACTEvents is enabled on the Marine Assault Pack soldiers by three eventHandlers in the config. The init EH calls a script to initialize all variables and set the defaults. The hit EH calls a universal function to cause local blackout, stun, and bleeding effects. The fired EH calls a universal function to add particles to gun/rocket fire. Any unit without these eventHandlers requires special attention from the mission editor to enable the effects.

### Global Variables

A series of global variables controls the hit effects.

- TACThitEffects : The master on/off switch for all events caused by the player being hit. Default: true.
- TACTbleeding : The on/off switch for bleeding. If it becomes false while the player is bleeding, bleeding stops immediately. Default: true.
- TACTrespawn : The on/off switch for blackout-on-death and no-sound-on-death. Blackout-on-death should not be used when the player doesn't respawn, or when he might respawn as seagull. Default: false.
- TACTrifleRespawn : When true, the player's default respawn weapon (M16/AK74 w/ one mag) is replaced by the weapon specified by init parameters. Handy for DM missions. Default: false.
- TACTweaponFX : When true, small arms and AT missiles produce extra particle effects (only on soldiers with the eventHandlers enabled). Default: true.

You can turn any of these variables on or off during a mission to end the effects. If a player is bleeding and TACTbleeding is turned off, the player instantly stops bleeding.

### Reserved Variables

I suggest not using any variable name with a prefix of TACT, unless you intend to modify effects in your mission.

### Initializing TACTEvents

TACTEvents must be initialized for the player to feel hit effects and to see weapon effects.

In a single player mission, you can init TACTEvents for the player like this:

`[this,"M16","M16"] exec "\TACTEvents\onPlayerInit.sqs"`

..in the player's init field. The second parameter is the weapon for rifle respawn, and the third parameter is the magazine. TACTEvents is already initialized if the player is a soldier from the Marine Pack.

In a multi player mission, you can init TACTEvents the same way for each playable soldier.

### Adding eventHandlers for Hit Effects

Non-Marine Pack player troops need to have eventHandlers added manually to experience hit effects. Use this code in the unit's init field to enable hit effects:

`this addEventHandler ["hit",{_this call TACTfuncHit}]`

TACTEvents must be initialized for hit effects to function. Note that AI don't feel hit effects, so you only need to add the events to non-Marine Pack player/playable soldiers.

### Adding eventHandlers for Weapon Effects

To add weapon effects to non-Marine Pack units, use this code in the unit's init field:

`this addEventHandler ["fired",{_this call TACTfuncFiredEH}]`

Once again, TACTEvents must be initialized for each player for any effects to be seen. Weapon effects are visible on all troops, including AI, so don't exclude them.

### Adding Weapons to weaponFX Arrays

TACTEvents has a series of arrays storing all cfgAmmo class names of weapons with effects. For example, here's TACTrifleTypes:

`

    [
    	"c8x_m16_Single_Bullet",
    	"c8x_m16_Burst_Bullet",
    	"c8x_m4_Single_Bullet",
    	"c8x_m4_Full_Bullet",
    	"c8x_ak74m_Single_Bullet",
    	"c8x_ak74m_Auto_Bullet",
    	"c8x_aks74u_Single_Bullet",
    	"c8x_aks74u_Auto_Bullet",
    	"BulletSingleW",
    	"BulletBurstW",
    	"BulletFullAutoW",
    	"BulletSniperW",
    	"BulletSingleE",
    	"BulletBurstE",
    	"BulletFullAutoE",
    	"BulletSniperE",
    	"BulletSingleG",
    	"BulletBurstG",
    	"BulletFullAutoG",
    	"BulletSniperG",
    	"Steyr",
    	"G36a",
    	"HKG3",
    	"FAL",
    	"HuntingRifle"
    ]

`

By default, all Marine Pack and BIS rifles will produce extra lingering smoke with each shot.

To modify these arrays, place a trigger on your map, with a countdown of 1 second, condition true, and this activation:

`TACTweaponTypes = TACTweaponTypes + ["AmmoName"]`

Where TACTweaponTypes is the type array you want to add the ammo to, and AmmoName is the string class name of the ammo. Here are the weaponTypes arrays:

- TACTrifleTypes : For assault rifles. Produces a medium amount of lingering smoke.
- TACTsmgTypes : For suppressed or low-caliber automatic weapons. Produces a smaller cloud of lingering smoke.
- TACTmgTypes : For automatic machine guns and high-caliber weapons. Produces a larger cloud of lingering smoke.
- TACTm82Types : I designed this effect for an M82 .50 sniper rifle. Try adding it to a hunting rifle for kicks. Produces large cloud of smoke and kicks up dust from muzzle.
- TACTshotgunTypes : For buckshot shells. Produces sparks and "wad."
- TACTrocketTypes : For infantry AT weapons. Produces lingering smoke behind the firer and following the rocket for a few meters.
- TACTgrenadeTypes : For M79/M203-style grenade launchers. Produces a puff of lingering smoke.

### Bandage Support

Each player with TACTEvents initialized has a weapon, "TACTObjCarry", added at init. If you use removeAllWeapons on a player, be sure to add it again (if you use bandages in your mission). The carry weapon is automatically added every time the player respawns or exits a vehicle.

### Credits

Thanks to:

- Suchey, for letting me work on his beautiful soldiers and for all TACTEvents graphics.
- Earl, Jocko Flocko, and the Marine Pack beta testers, for going over my work with a fine-toothed comb and making feature requests.
- Dinger, for pointing out a sound init bug in my config.
- Bohemia Interactive Studios, for everything that makes this addon possible. Even when frustrated about something you can't do, step back and look again at how much you can do in OFP editing.

### Usage and Support

You may use TACTEvents.pbo for any mission, whether it uses the Marine Pack or not, under a few conditions.

- DO develop your mission in the newest version of OFP:R.
- DO provide a download link to an up-to-date TACTEvents (if your mission is not designed for Marine Pack).
- DO NOT modify TACTEvents.pbo.
- DO NOT distribute TACTEvents.pbo with your mission.

For support, email me at tactician@virtual-wars.com or visit digitalgrenade.com's forums. I help when I can.