OFPEC Forum

Editors Depot - Mission Editing and Scripting => OFP - Editing/Scripting General => Topic started by: RedKnyte on 10 Oct 2002, 12:36:39

Title: Guns! Lots of guns...
Post by: RedKnyte on 10 Oct 2002, 12:36:39
Does anyone know how to have an individual weapon lay on the ground by itself, I mean without using the 'Drop Weapon' action, I want it to be on the ground during the start of the mission......to be specific, I wanted an M16 to be layin on the ground for anybody (well......not really on the ground but on top of a table, but I knew how to do that, the only thing I want is, for it to be an individual weapon..) to pick up, I have the player as a captive and when the mission starts, he runs for the M16 an shoot any opposition and escape through the woods...

Can anyone tell mr how to do that? ???
Title: Re:Guns! Lots of guns...
Post by: Tomb on 10 Oct 2002, 14:52:55
 :) Place a Trigger on the weapon spot ya wanna create.

 Then NAME the trigger in the "name" field - let's name it G1
 and just let it fire right away (by anyone).

 :D Put this in the "OnActivation" field :

 W1="WeaponHolder" createVehicle Getpos G1; W1 addMagazineCargo ["M16",4]; W1 addWeaponCargo ["M16",1]

 This would place a fully loaded M16 on the weapon spot (the "G1"-trigger, right?!)

 NOTE :  
 Sometimes (when placing handguns at least), it can take a while before yer able to actually pick up the gun.  :P

Another thing (again, with handguns at least), you sometimes have to click on the "toggle Weapons" button
to be able to shoot (it makes the mags visible, top left of screen). ::)
Title: Re:Guns! Lots of guns...
Post by: RedKnyte on 10 Oct 2002, 17:09:46
Wait, it seems that I've seen your theory before on some other thread, but nvrmind, at least I've got something, thx for the info m8 :cheers: I'll try it. 8)
Title: Re:Guns! Lots of guns...
Post by: RedKnyte on 11 Oct 2002, 09:42:49
(well......not really on the ground but on top of a table, but I knew how to do that,

Well...I know I said that I knew how to put the weapon on top of a table but ::).....I actually don't! I'm SORRY! :-[ I thought I could use the setpos command (this setpos [getpos this select 0, getpos this select 1, 0.5]) well, I could do that and it works like a charm, only thing is, when I tried putting on top of the table, I couldn't, it only floats in the air, I tried changing the getpos createvehicle command to the table but it still won't lay on the table, can anyone help me (once more pleez! :help:)
Title: Re:Guns! Lots of guns...
Post by: MeltedAd on 12 Oct 2002, 12:46:21
Look in the editors depot in pending there's a script, Weapon VehicleCreate by mcnils. Sounds like what you are looking for.
 :thumbsup: