Home   Help Search Login Register  

Author Topic: Weapons with animations  (Read 6961 times)

0 Members and 1 Guest are viewing this topic.

Offline Aldo15

  • OFP-addict
  • Former Staff
  • ****
    • My OFP missions
Weapons with animations
« on: 19 Feb 2011, 02:54:29 »
Hi folks!

I would like to know if Are there weapons or addons in OFP with this animation?

My OFP stuff
FMF Project by Aldo15. Coming soon.
If in the high school or university, Teachers add a new subject about how to make scripts, missions, for ofp. I'd be number one of my classroom

Offline OFP_f3d3

  • Former Staff
  • ****
  • Fraud is the ready minister of injustice.
Re: Weapons with animations
« Reply #1 on: 19 Feb 2011, 04:57:47 »
Nothing in the world is as certain as death.

Walter_E_Kurtz

  • Guest
Re: Weapons with animations
« Reply #2 on: 19 Feb 2011, 15:19:38 »
With animation of handling the magazine? No.

There is a possibility of using modelSpecial in a config. By this method the weapon can be displayed in two states:
   modelSpecial = the loaded version (but OFP doesn't cast shadows of these rifles or RPGs)
   model = without magazine

While the weapon is empty the 'model' version is displayed. Once reloaded it switches to 'modelSpecial'.

You can see this system in action with JAM RPG-2s: unloaded (model) and loaded, ready to fire (modelSpecial) or even, more impressively, with handguns such as in Laser's US Weapons pack. Here, the zasleh selection of the 'modelSpecial' is used to make the gun appear to open its chamber and the 'model' version looks empty with its slide back.

Offline Aldo15

  • OFP-addict
  • Former Staff
  • ****
    • My OFP missions
Re: Weapons with animations
« Reply #3 on: 19 Feb 2011, 18:07:36 »
Ummm, I understand, but I am not good making addons. I think it would be nice if you send me a good tutorial about how to make this anim...

Do You know if anyone has done a weapon with this anim?
« Last Edit: 19 Feb 2011, 18:38:30 by Aldo15 »
My OFP stuff
FMF Project by Aldo15. Coming soon.
If in the high school or university, Teachers add a new subject about how to make scripts, missions, for ofp. I'd be number one of my classroom

Walter_E_Kurtz

  • Guest
Re: Weapons with animations
« Reply #4 on: 21 Feb 2011, 00:41:59 »
I know of no anim that holds a weapon in one hand and a magazine in the other.

Download the "Do it yourself M4 pack" from the Addons page of Inquisitor's site and you can assemble an M4 in many configurations.

Offline Aldo15

  • OFP-addict
  • Former Staff
  • ****
    • My OFP missions
Re: Weapons with animations
« Reply #5 on: 21 Feb 2011, 01:14:29 »
Thank you Walter!!

I'll try to download...
My OFP stuff
FMF Project by Aldo15. Coming soon.
If in the high school or university, Teachers add a new subject about how to make scripts, missions, for ofp. I'd be number one of my classroom

Offline Lenyoga

  • Professor of Misanthropology
  • Members
  • *
Re: Weapons with animations
« Reply #6 on: 22 Feb 2011, 22:31:24 »
If there was a command which returnes if a unit is reloading (is there something like unit isReloading?) it would work:

BUT, you'd have to make that modelSpecial thing - so that the magazine in the gun is not shown when reloading - build a custom soldier model - with a magazine on his hand (which is hidden with hiddenselections[] in the config.cpp) - and make some kind of init script for the unit, which switches the soldier-models objecttexture from invisible to visible (this setObjectTexture ...) and back again after the reload-animation.

I hope this wasn't too confusing.
As a grandmother I've got lots of gold.

Offline Aldo15

  • OFP-addict
  • Former Staff
  • ****
    • My OFP missions
Re: Weapons with animations
« Reply #7 on: 22 Feb 2011, 22:40:41 »
not necessary that He have the magazine in the hand, only that the magazine is remove of the rifle, but Would be very hard do it... well, in my case, because I don't know make addons... lol,

Do you know to make addons?
I hope you understand me, because I don't speak English fuently.

Regards,
Aldo
« Last Edit: 22 Feb 2011, 22:42:23 by Aldo15 »
My OFP stuff
FMF Project by Aldo15. Coming soon.
If in the high school or university, Teachers add a new subject about how to make scripts, missions, for ofp. I'd be number one of my classroom

Walter_E_Kurtz

  • Guest
Re: Weapons with animations
« Reply #8 on: 22 Feb 2011, 22:51:54 »
@Lenyoga

The ammo command could be used to check when the clip is empty (to show the texture) and again once it's reloaded (to hide the texture).

Offline Aldo15

  • OFP-addict
  • Former Staff
  • ****
    • My OFP missions
Re: Weapons with animations
« Reply #9 on: 22 Feb 2011, 23:02:19 »
A question:

Do I need two files P3d so I can to make that? For example:

A model with the magazine, and the other model without magazine, as Laser made with his RPG addon.
My OFP stuff
FMF Project by Aldo15. Coming soon.
If in the high school or university, Teachers add a new subject about how to make scripts, missions, for ofp. I'd be number one of my classroom

Walter_E_Kurtz

  • Guest
Re: Weapons with animations
« Reply #10 on: 23 Feb 2011, 01:42:18 »
That is correct. Then the config might (in part) look like:

Quote
class CfgPatches
{
   class Aldo_New_Weapon   {
      weapons[] = {"Aldo_New_M4Base","Aldo_New_M4","AldoNewM4Mag"};
      requiredVersion = 1.75;
   };
};

class CfgModels
{
   class default {};
   class Weapon: default {};
   class Aldo_M4_Loaded: Weapon {};
   class Aldo_M4_Empty: Weapon {};   
};


class CfgWeapons
{
   class Default   {};
   class MGun: Default {};
   class Riffle: MGun {};
   class Aldo_New_M4Base: Riffle   {
      scopeWeapon=0;
      scopeMagazine=0;

      model="\Aldo_Weapon\Aldo_M4_Empty.p3d";
      modelSpecial="\Aldo_Weapon\Aldo_M4_Loaded.p3d";

      displayName="Aldo M4";
      displayNameMagazine="Aldo M4 Mag.";
      shortNameMagazine="M4 Mag";

      magazines[]={"Aldo_New_M4Mag"};
      
   };
   
   class Aldo_New_M4: Aldo_New_M4Base   {      
      scopeWeapon=2;
      scopeMagazine=0;
      picture="\Aldo_Weapon\M4_pic.paa";      
   };

   class Aldo_New_M4Mag: Aldo_New_M4Base   {
      scopeWeapon=0;
      scopeMagazine=2;   
      picture="\Aldo_Weapon\M4Mag_pic.paa";   
   };      
   
};

Offline Aldo15

  • OFP-addict
  • Former Staff
  • ****
    • My OFP missions
Re: Weapons with animations
« Reply #11 on: 23 Feb 2011, 02:12:43 »
Well, Now my question is:

How do I do the P3d Model?, If I don't know to make addons, also the damn textures don't load.

Regards,
Aldo


My OFP stuff
FMF Project by Aldo15. Coming soon.
If in the high school or university, Teachers add a new subject about how to make scripts, missions, for ofp. I'd be number one of my classroom

Offline Lenyoga

  • Professor of Misanthropology
  • Members
  • *
Re: Weapons with animations
« Reply #12 on: 23 Feb 2011, 19:10:12 »
Have you downloaded the M4 pack from http://ofp.gamepark.cz/_hosted/inquisitor/?

If you have O2light, you can just put together a M4 model and save one p3d without the magazine in you addon folder and one with magazine.
You need a texture path swap utility to change the paths of the textures from 'INQ_CONST' (i think..) to you addon folder-path. The dowload for the texture path swap utility is here: http://www.ofpec.com/ed_depot/index.php?action=details&id=166&game=ArmA
As a grandmother I've got lots of gold.

Offline Aldo15

  • OFP-addict
  • Former Staff
  • ****
    • My OFP missions
Re: Weapons with animations
« Reply #13 on: 23 Feb 2011, 20:59:27 »
Yes, Ive downloaded this pack from Inquisitor page!
...about the dowload.php. I'd like to know, How to use it?

This is very tricky! I'm not very good at creating addons, better I keep doing missions...

Regards,
Aldo

EDIT:

after several hours trying to make this addon, this is all I did (see image)

these are some things that I need to learn:

-add textures
-add sounds ( loading and firing)
-add image to gear
-add telescopic sight  to weapon
-How to change the model .p3d when the weapon is reload?
-A good tutrial to make weapons as RPG's
« Last Edit: 23 Feb 2011, 22:35:14 by Aldo15 »
My OFP stuff
FMF Project by Aldo15. Coming soon.
If in the high school or university, Teachers add a new subject about how to make scripts, missions, for ofp. I'd be number one of my classroom

Offline Lenyoga

  • Professor of Misanthropology
  • Members
  • *
Re: Weapons with animations
« Reply #14 on: 23 Feb 2011, 23:25:54 »
EDIT: I've downloaded the txtpathswap utility and had the same problem with this download.php.. working on it.
EDIT2: I've found a working link: http://ofp.gamepark.cz/index.php?sekce=utilities


The model looks good, already - here are some useful things for the config file: (Sorry, the code looks weird - I just copied it together from my addons...)



Code: [Select]
class CfgModels
{
class default{sections[] = {};sectionsInherit="";};
class Weapon: default{sections[] = {"zasleh"};};

class NameOfWeaponP3dWithMagazine: Weapon{}; //This is needed for the muzzle flash when firing

};


class CfgWeapons
{
class Default {};
class MGun: Default {};
class Riffle: MGun {};
class M16: Riffle {};


class NameOfWeapon_base: M16
{
   picture="\NameOfYourAddon\NameOfGunPic.paa";                 //This is needed for custom pictures
   model="\NameOfYourAddon\NameOfWeaponP3dWithMagazine.p3d";
   modelSpecial="\NameOfYourAddon\NameOfWeaponP3dWithoutMagazine.p3d";
   displayName="M4 or something";                               //Names displayed in the game UI
   displayNameMagazine="M4 Magazine";
   shortNameMagazine="M4 mag.";
   sound[]={"\NameOfYourAddon\GunfireSound.wav",1.000000,1};                 //Here are the custom sounds
   reloadmagazinesound[]={"\NameOfYourAddon\reloadSound.wav",1.000000,1};
   drySound[]={"weapons\M16dry",0.010000,1};
optics = true; //these are used for the custom optics
opticsZoomMin=0.40;
opticsZoomMax=0.40;
modelOptics="\NameOfYourAddon\NameOfopticstex.paa";
magazines[]={"NameOfWeapon_mag"};
  modes[]={"Auto","Burst"};
  class Auto
 {
ammo="BulletSingle";
      multiplier=1;
      burst=1;
      displayName="M4 auto";
dispersion=0.0002;
   sound[]={"\NameOfYourAddon\GunfireSound.wav",1.000000,1};
      soundContinuous=0;
      reloadTime=0.10000;
   };
   class Burst
   {
ammo="BulletBurst";
      multiplier=1;
      burst=3;
      displayName="M4 burst";
   sound[]={"\NameOfYourAddon\GunfireSound.wav",1.000000,1};
      reloadTime=0.10000;



   };
};

class NameOfWeapon_Mag: NameOfWeapon_Base
{
scopeMagazine=2
   picture="\NameOfYourAddon\NameOfMagPic.paa";
displayNameMagazine="m4 Magazine";
                                shortNameMagazine="m4 mag.";
};
class NameOfWeapon: NameOfWeapon_base
{
scopeWeapon=2
valueWeapon = 2;
valueMagazine = 2;
muzzles[] = {"M4Muzzle", "M203Muzzle"};  //M203Muzzle is the grenadelauncher

class M4Muzzle: NameOfWeapon_Base
{
magazines[] = {"NameOfWeapon_Mag"};
};

class M203Muzzle : GrenadeLauncher
{
displayName=$STR_DN_M203;
sound[]={weapons\M16GrenadeLaunch, db-70,1};
magazines[] = {GrenadeLauncher, Flare, FlareGreen, FlareRed,
FlareYellow};
};
};


And the textures - the default paths in Inquisitors model is /INQ_CONST/name.jpg

You need to change it to /NameOfyourAddon/name.jpg (\, not / - sorry) if this doesn't work, you might have to convert the jpg into paa - with texview - also downloadable in the tool section.
« Last Edit: 23 Feb 2011, 23:32:00 by Lenyoga »
As a grandmother I've got lots of gold.