OFPEC Forum
Addons & Mods Depot => OFP - Addons & Mods General => Topic started by: gimsom on 19 Nov 2004, 19:27:31
-
Im trying to make melee weapon but i dont know how to make that scripting. Many people have made axes, batons and katanas. Can someone help me with this.
Ive already got one script (below). Im not sure does it work. I need help how to make it working with my model?
#define TEast 0
#define TWest 1
#define TGuerrila 2
#define TCivilian 3
#define TSideUnknown 4
#define TEnemy 5
#define TFriendly 6
#define TLogic 7
#define true 1
#define false 0
// type scope
#define private 0
#define protected 1
#define public 2
#define WeaponNoSlot 0// dummy weapons
#define WeaponSlotPrimary 1// primary weapons
#define WeaponSlotSecondary 16// secondary weapons
#define WeaponSlotItem 256// items
#define WeaponSlotBinocular 4096// binocular
#define WeaponHardMounted 65536
class CfgPatches
{
class sword
{
units[] = { messersteche };
weapons[] = { sword};
requiredVersion = 1.40;
};
};
class CfgWeapons
{
class Default { };
class MGun: Default { };
class Riffle: MGun { };
class M60: Riffle { };
class lightsaber: M60
{
model="\sword\sword.p3d";
displayName="sword";
picture="HK";
magazines[]={"strokegun"};
};
};
class CfgVehicles
{
class All { };
class AllVehicles: All { };
class Land: AllVehicles { };
class Man: Land { };
class Soldier: Man { };
class SoldierWB: Soldier { };
class messersteche: SoldierWB
{
displayName="Soldier (sword)";
weapons[]={"sword","Throw","Put"};
magazines[]={"strokegun"};
};
-
OK. First, for the config to even work, you'll need another "};" (without quotations).
Also, the defines aren't necessary for this addon. (But by all means keep them, it doesn't really make a difference).
Also, using "strokegun" is really tacky. Why not make a new anim for it?
You also might want to include:
class CfgModels
{
class Default{};
class Weapon: Default{};
class sword// or whatever the name is: Weapon{};
};
Apart from that, see how it works and reply if there are any problems and I'll help fix it.
ps. Be rest assured that I will be able to help you since "melee weapons" is my speciality.
-
Ok, but could you be nice and write me that finsihed confiq. so i could just add that weapom for some unit? Im not making whole unit with sword. I would just like do that "addweapon" thing, not whole unit, just simple sword.
Thanks
-
I'll give it a shot ;)
-
this close combat script uses the strokegun attack. It might help you.
-
OK, this is basically all you need - very similar to you original one.
You will need OFP: Resistance to use this btw
If you'd like, you can send me the model, and I'll make an anim or two for you ;)
Contact me via a PM
class CfgPatches
{
class Sword
{
units[] = {};
weapons[] = {Sword};
requiredVersion = 1.75;
};
};
class CfgWeapons
{
class Default { };
class MGun: Default { };
class Riffle: MGun { };
class M60: Riffle { };
class Sword: M60
{
model="\sword\sword.p3d";
displayName="Sword";
picture="YourPicHere";
magazines[]={"SwordHit"};
};
};
class CfgModels
{
   class Default{};
   class Weapon: Default{};
   class Sword: Weapon{};
};
class CfgAmmo
{
   class Default {};
   class StrokeFistHit: Default {};
   class StrokeGunHit: StrokeFistHit {};
  ÂÂ
   class SwordHit: StrokeGunHit
   {
         hit=20;indirectHit=2;indirectHitRange=0.5;
   };
};
class CfgNonAIVehicles
{
   class ProxyWeapon {};
   class ProxySword: ProxyWeapon {};
};