Home   Help Search Login Register  

Author Topic: How to start with a different weapon  (Read 493 times)

0 Members and 1 Guest are viewing this topic.

GaryP

  • Guest
How to start with a different weapon
« on: 13 Aug 2003, 15:06:56 »
Hello all.

I did several searches and found a lot more then I'm ready for at the moment.  I just got the game and I'm hooked.  I'm a long time player & coder of games, and I thought I'd try OFP.

It's really cool.  I got into the editor last night to set up play around in a no enemy environment.  But I wanted to start with a different weapon like grenades, but I did't know where to add them.  And how about a different gun.

I added me as a special ops, and got a different gun, but can I place some guns in a crate or something.  I'm sure this was asked before, so if someone could please point me, I would be greatful.

Thanks

-Gary

Offline Burn

  • Members
  • *
Re:How to start with a different weapon
« Reply #1 on: 13 Aug 2003, 15:36:13 »
RemoveAllWeapons unitname;unitname addmagazine "magazinename";unitname addweapon "weaponname"

^^that will add one magazine and one weapon^^

RemoveAllWeapons unit;unit AddMagazine "M16";unit AddMagazine "M16";unit AddMagazine "M16";unit AddMagazine "M16";unit AddMagazine "M16";unit AddWeapon "M16";unit SelectWeapon "M16";unit AddMagazine "HandGrenade";unit AddMagazine "HandGrenade";unit AddMagazine "HandGrenade";unit AddMagazine "HandGrenade";unit AddMagazine "HandGrenade"

^^that will add a m16 with five mags and five grenades^^
You can replace "unit" with this if u type it in a units init-field... that way you won't have to name the unit ;)

or if you want a script to execute in the units init-field:
Code: [Select]
;**** RUN CODE: [this] Exec "SPECIAL_UNIT.sqs"***************************
; ***********************************************************************

; Get the unit parameter given
_unit = _this Select 0

; Strip the units current gear
RemoveAllWeapons _unit

; Add new gear to unit
_unit AddMagazine "M16"
_unit AddMagazine "M16"
_unit AddMagazine "M16"
_unit AddMagazine "M16"
_unit AddMagazine "M16"
_unit AddWeapon "M16"
_unit SelectWeapon "M16"
_unit AddMagazine "HandGrenade"
_unit AddMagazine "HandGrenade"
_unit AddMagazine "HandGrenade"
_unit AddMagazine "HandGrenade"
_unit AddMagazine "HandGrenade"

Exit

For weapon and mag. names check out the unofficial command reference.
« Last Edit: 13 Aug 2003, 15:45:19 by Bizon »

Offline macguba

  • Former Staff
  • ****
    • macguba's operation flashpoint page
Re:How to start with a different weapon
« Reply #2 on: 13 Aug 2003, 15:43:02 »
Welcome to the forum!    :D

You are on a well worn path ... try a bit of OFP editing, find OFPEC, get completely overwhelmed by the amount of information here.   ;D

Head over to the Editors Depot (link at the top of the page) and look down the menu on the left hand side till you find "Browse Tutorials".      Click on it and use the drop down boxes until you find the category Getting Started and the sub-category First Steps.    There you will find tutorials by snYpir and my humble self that will set you off in the right direction.    You don't need to read all the tutes in Getting Started, but I strongly recommed you have a look at several of them.

Now, to answer your question specifically.    First, make sure that at the top right of the Mission Editor screen (the one with with the map) it says "Advanced".   If it says "Easy" click on it to toggle to Advanced.     Everybody uses Advanced - Easy just switches off some things which is no fun at all.

Now create your unit .... when you do so a screen appears.     About 1/3 of the way down there is a line called Initialization.   In this box write

removeAllWeapons this; this addMagazine "XXX"; this addWeapon "YYY"

You need to have as many addmagazine commands as you want magazines.   Make sure you add at least one magazine before you add the weapon, otherwise the weapon will not be loaded at the start of the mission.

XXX and YYY are obviously the names of the magazine and weapon you want.     There is a list in the Editors Depot - Tutorials - References - Weapon and Ammo lists.   The best one is here.

Ammo crates in general don't have guns, only ammo.   However, you can add weapons to a crate in exactly the same way as you did for your loon.    Crates have lots of space so you don't need to remove whats already there.

Two more tips.    If you haven't already, update your version of the game to 1.91 from the official site at www.flashpoint1985.com.    And if you are an experienced coder you will find the online command reference particularly useful.
Plenty of reviewed ArmA missions for you to play

GaryP

  • Guest
Re:How to start with a different weapon
« Reply #3 on: 13 Aug 2003, 17:45:17 »
Thanks a bunch to you both.  And macguba.  I read your tutorial.  It's printed and in my manual binder I started.  All my game info will go into my binder starting with easy tutorials, all the way up to master editor/coder level.

I hope I am 1/10 way there in a few months. ;D

I'm reading the rest of the tutorials as I progress to understand them.  The're great bed time reading.