OFPEC Forum

Editors Depot - Mission Editing and Scripting => OFP - Editing/Scripting General => Topic started by: DEAD RABBIT on 11 Aug 2004, 13:42:38

Title: How to recognize classes?
Post by: DEAD RABBIT on 11 Aug 2004, 13:42:38
I got this script which simulates punching any soldier with your rifle. Something like A Talking Penguin made, but a lot better, because the ATP version allows you to kill soldier but also tanks, cars, etc with that action in a 2 meter radius.

I didn't like that, so I rewrote the script plus added random punching sounds and it looks a LOT better now.

However I didn't got rid of the killing cars and tanks problem.
I don't know how to get a class of any unit like man, car, tank etc like in the CfgVehicles list.

Could somebody plz tell me how to ID a unit if its a car or a tank or just a person?? without having to name any vehicles??
Title: Re:How to recognize classes?
Post by: macguba on 11 Aug 2004, 13:49:22
Dunno .... would something like

counttype "man" >= 1

help?    It's little more than a guess.

Title: Re:How to recognize classes?
Post by: DEAD RABBIT on 11 Aug 2004, 14:03:42
Not exactly what I had in mind, but the trigger area is so small that it works equally good.

Thanks anyway  ;D
Title: Re:How to recognize classes?
Post by: Blanco on 11 Aug 2004, 19:38:57
Let's say you got a variable _unit in your script,...

To check _unit is in the manclass do this :

Code: [Select]
?"man" counttype [_unit] > 0 : hint "unit is a man"

The same thing with "tank", "plane", "car","ship",etc...