OFPEC Forum

Editors Depot - Mission Editing and Scripting => OFP - Editing/Scripting General => Topic started by: dave52390 on 03 Aug 2004, 02:18:07

Title: USMC How do i add scopes and m4's to them
Post by: dave52390 on 03 Aug 2004, 02:18:07
I'm kinda new to this so explain this to me plz. I'v been trying to add USMC weapons to them that you cant get from the ammo crates (m249 scope, m4 silecned.ect) it's a addon >> http://digitalgrenade.com/index.php?usmc <<
.can one of you plz explain this to me i dont know what a sqs. sqm is. thanks
Title: Re:USMC How do i add scopes and m4's to them
Post by: shadow99 on 03 Aug 2004, 02:55:17
Well, first of all you need to know that no matter what add-on, if a unit, adding weapons is always the same. Also, you need to know what the game 'calls' these weapons.

See, I don't know how to add those particular weapons, but say you wanted do add an XMS to a unit, you would put in the unit's init field:

Code: [Select]
removeAllWeapons this;this addWeapon "XMS"
You need to find out (though I don't know how) what to put for these weapons instead of "XMS".
Title: Re:USMC How do i add scopes and m4's to them
Post by: dave52390 on 03 Aug 2004, 03:08:12
its not like htat you have to add some type of tactenevent and ect and i need hlwep with that ... thanks tho
Title: Re:USMC How do i add scopes and m4's to them
Post by: j-man on 03 Aug 2004, 03:33:26
Shadows explanation is correct.

use the removeallweapons commmand to make space for the new weapons. Then the addmagazine/addweapon command will add the weapons and stuff.

So if you want to add a silenced M4, use:

Code: [Select]
removeAllWeapons this; this addmagazine "c8xm4sdmag"; this addmagazine "c8xm4sdmag"; this addmagazine "c8xm4sdmag"; this addmagazine "c8xm4sdmag"; this addmagazine "c8xm4sdmag"; this addweapon "C8XM4_sd"

You add the magazines before you add the weapon so that the unit dosn't have to reload.
Title: Re:USMC How do i add scopes and m4's to them
Post by: dave52390 on 03 Aug 2004, 03:51:04
WORKS! thanks man  u made my day.
Title: Re:USMC How do i add scopes and m4's to them
Post by: DBR_ONIX on 03 Aug 2004, 11:38:45
If you are gonna add the weapons to a lot of units, use this code..
Code: [Select]
_unit = this select 0
_weap = this select 1
_mag = this select 2

removeAllWeapons _unit
_unit addmagazine _mag
_unit addmagazine _mag
_unit addmagazine _mag
_unit addmagazine _mag
_unit addmagazine _mag
_unit addweapon _weap
Then save it (Using notepad, Make sure the file type box it "All Files (*.*)", not "Text file (*.txt)")
Into Op Flashpoint Folder/Users/username/Mission Name/
Call it addweap.sqs

Then, to use it, in a units INIT field ::
Code: [Select]
[this,C8XM4_sd,c8xm4sdmag] exec "addweap.sqs"

You can change the bits in the [ ]'s to anything..
Say you want to give M16s to the units, you can use
[this,m16,m16mag] exec "addweap.sqs"

I might make a better version of this, that checks if there is any magazines to be added, if not, it skips the bit where it adds magazines, say if you want to add grenades to the units..
And maybe you can select how many magazines to add (A loop, that loops how ever many times, adding 1 mag each time)

If anyones interested.. ::)

- Ben