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

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.

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:

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:

Usage and Support

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

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