OFPEC Forum
Editors Depot - Mission Editing and Scripting => OFP - Editing/Scripting General => Topic started by: Frosty on 23 Jan 2003, 23:29:17
-
Hey, I'm having trouble getting any information on the EventHandlers in Addon CPP configs. I want to add some little scripts to my addon that execute when it spawns on the map. what is the handler I put in. I've got:
class EventHandler(s - cant rememeber)
{
?HANDLER? = _this select 0 setface "faceX"
};
What handler to I put in, and what are all the different ones. Ive searched this forum, the official OpFlash1985 forums, and checked the official command reference (which says check scripting topic EventHandlers but I have no idea where it is!)
Please help! :'(
-
Pretty pretty please, with a _this select 5 on top! I'll even throw in a [please] exec "help me.now" if you reply within the next 5 hours.
-
You talking about this?:
Event handlers
Event handlers can be defined in unit config or by function addEventHandler. Multiple handlers can be attached at one time. Event handler types are defined below. Each handler receives arguments in _this, argument types and meaning are defined below.
"Killed" object:killer
"Hit" object:causedBy,scalar:howMuch
"Engine" bool:engineState
"GetIn" string:position (1),object:unit
"GetOut" string:position (1),object:unit
"Fired" string:weapon,string:muzzle,string:mode,string:ammo
"IncomingMissile" string:ammo,object:whoFired
"Dammaged" string:selectionName,scalar:howMuch
"Gear" bool:gearState
"Fuel" bool:fuelState
"Init" No arguments
(1) position can be "driver", "gunner", "commander", "cargo"
MP notes: "Killed" and "Hit" event handlers are executed where given unit is local. All other event handlers are executed on all computers. Events added by addEventHandler may be different on each computer.
~S~ CD
-
Thanks for that, although I found out init myself (pretty self-explanatory - how did I not see it! :P)