OFPEC Forum

Editors Depot - Mission Editing and Scripting => OFP - Editing/Scripting General => Topic started by: Akbar on 01 Jun 2006, 03:18:36

Title: Add MG to any vehicle
Post by: Akbar on 01 Jun 2006, 03:18:36
I used to have this script... but lost it. It added a MG on top of any vehicle, and you could adjust the height at which the mg rests... if anyone has this please post. 8) thanks
Title: Re: Add MG to any vehicle
Post by: James Spence on 01 Jun 2006, 09:53:05
http://ofp.gamepark.cz/editor/hummermg.zip

This is a script to add an MG to a HMMVW from ofp.info, not sure if it tells you how to add it to anything else but it may just be changing the name of the vehicle the scripted is designated to.
Title: Re: Add MG to any vehicle
Post by: Wolfrug on 01 Jun 2006, 12:36:19
Checked the hummer script, it seemed rather simplistic to me, and mostly designed to transport stuff, no? Well, I can't vouch for if this script is exactly what you're looking for either, but give it a go : as the script says in the comments :

;the script mounts anything on top of another thing, it was "made" to be worked with or by
;mounting m2s on top of cars
;usage:[car,m2,distance behind or front of car,height] exec "mount.sqs"

Code: [Select]
;the script mounts anything on top of another thing, it was "made" to be worked with or by ;mounting m2s on top of cars
;usage:[car,m2,distance behind or front of car,height] exec "mount.sqs"

_Object1 = _this Select 0
_Object2 = _this Select 1
_Distance = _this Select 2
_amount =_this select 3

#Loop
_Pos = GetPos _Object1

_ac =_pos select 2
_Dir = GetDir _Object1

;thanks to sefe for the following lines

_Object2 SetPos [ (_Pos Select 0) + _Distance * (Sin _Dir), (_Pos Select 1) + _Distance * (Cos _Dir),_ac+_amount]
_object2 setdir (_dir)
gunner _object2 setdir (_dir)
~0.01
? not Alive _Object1 or not Alive _Object2 : Exit
Goto "Loop"

try it out for size  8)

/Wolfrug out.