Home   Help Search Login Register  

Author Topic: Animated Weapon Parts  (Read 7332 times)

0 Members and 1 Guest are viewing this topic.

Homefry31464

  • Guest
Animated Weapon Parts
« on: 12 Sep 2004, 23:45:44 »
We have some nice looking weapons out... some of which can't really be improved... What I do think would be nice, however, is animated weapon parts.  I've seen it done a few times, such as the HEP M1911 has an animated slide.  I was curious if anyone knows how to go about doing this?

-Homefry

bootneckofficer

  • Guest
Re:Animated Weapon Parts
« Reply #1 on: 28 Sep 2004, 23:09:27 »
yer working parts on weapons would make things even more realistic!!!  :)
i haven't got a clue how to do it but someone who does should seriously think about it

bootneckofficer

Offline remcen

  • Contributing Member
  • **
  • a.k.a. hottentotten_mike
    • IM:UC
Re:Animated Weapon Parts
« Reply #2 on: 29 Sep 2004, 22:35:18 »
add a second slide in the backward position to your model and make it part of  the zasleh-selection. that will  make it appear in this position whenever the weapon is fired. however the slide in its forward position will be still visible.

you can also use the weaponspecial option for parts of a weapon that you want to fly away: make two separate models of your weapon, the first in loaded condition, the second one in fired condition. this was used for the rifle mortars of BIS (hint: look what happens when you load a riflemortar to a m4! ok i make it short: an m16 appears with a mortar on its muzzle) and also kegetys used this for his rpgs.  in the config you add model="loadedmodelname.p3d" and modelspecial="firedmodelname.p3d"

BUT: AFAIK real animations which you can see moving and which are scripted in the config are not possible for non-static weapon as rifles, pistols, rocketlaunchers, etc.
 
we're looking for members: IM:UC MOD

rOk

  • Guest
Re:Animated Weapon Parts
« Reply #3 on: 30 Sep 2004, 11:46:01 »
Those new Chinese units from PAS have a working gun slide...but I don't know which method they took to accomplish this.

HerrFlick

  • Guest
Re:Animated Weapon Parts
« Reply #4 on: 07 Oct 2004, 17:09:53 »
Isn't it possible to add a eventhandler in the config file that starts a animation when the gun is fired?

DBR_ONIX

  • Guest
Re:Animated Weapon Parts
« Reply #5 on: 07 Oct 2004, 18:39:18 »
I once try out an idea I am sure will work..
On the M249 (Or M60 etc), the belt is still visable even when the mag is empty..
So, make a selection out of each shell, numbder 1 to 15ish (Only visable ones)

Then a script thats activated on fired that checks if the weapon has been fired, and how many times, if magsize = 15, setobjexttexture the shell transparent..

There's a few things that could go wrong, like if reload (Easly fixed with a reloaded EH), and change weapon (Just check the type of shell fired)
But I lost the files after a HD format  :-\

Oh, the C-47's pilots (WW2EC), the pistol, has a topslide that stayed back when you were outta ammo or fired.. Only prob if you changed to 'nades, the slide went back too..
But it's impressive non the less ;)
- Ben
BTW, oh, there is a mod, some urban combat one, is working on very realistic weapons etc, all animated.. Not heard much apart from a single post on this forum

Offline remcen

  • Contributing Member
  • **
  • a.k.a. hottentotten_mike
    • IM:UC
Re:Animated Weapon Parts
« Reply #6 on: 08 Oct 2004, 01:35:54 »
@ DBR_ONIX: are you sure that eventhandlers work for weapons??? i am not.  ???     i tried hiddenselection to which you were refering in your post and it didn't work either. but perhaps i was simply not experienced enough when i tried  ;)

concerning the slide: certainly done via the modelspecial "trick": you shoot with the weapon's first model and when the magazine is empty the model is changed to that which is defined in the modelspecial=""; -passage of the config.cpp

in my first post  i forgot one real animation: the heavy grenade launchers (forgot the names) which came with resistance have an animated drum. could be useful for people making revolvers.
we're looking for members: IM:UC MOD

DBR_ONIX

  • Guest
Re:Animated Weapon Parts
« Reply #7 on: 08 Oct 2004, 13:31:51 »
Yeah, in the config.cpp
revolving="selectionname"
axis="selection name of points in memory lod"

As for EH with weapons, yeah, it works
Add to the operator (The unit holding it :P), a fired eventhandler..
I'm not sure the name of the weapon tho :'(

It IS possible tho :P
- Ben

DBR_ONIX

  • Guest
Re:Animated Weapon Parts
« Reply #8 on: 12 Oct 2004, 14:57:14 »
Hmm, after thinking about this, setobjecttexture on a weapon would be hard/impossible  :-\
Because you don't know the name of the weapon
Oh well :(
- Ben

HerrFlick

  • Guest
Re:Animated Weapon Parts
« Reply #9 on: 13 Oct 2004, 00:05:23 »
This really stinks, I hope OFP 2 will be lightyears ahead of this config crap...

I tried the eventhandler, doesn't work.

class Animations, foggedaboudit >:(

I am now stuck with a minigun that doesn't rotate, I guess my only option is the modelspecial trick... ::)

Offline oyman

  • Members
  • *
  • king of pings
Re:Animated Weapon Parts
« Reply #10 on: 13 Oct 2004, 01:13:32 »
I am now stuck with a minigun that doesn't rotate, I guess my only option is the modelspecial trick... ::)

theres a way to get the barrels spining on a minigun

Offline remcen

  • Contributing Member
  • **
  • a.k.a. hottentotten_mike
    • IM:UC
Re:Animated Weapon Parts
« Reply #11 on: 13 Oct 2004, 23:51:48 »
if its a static weapon or part of a vehicle, name the rotating part  gatling,
the drum of the heavy grenade launchers is called buben, so that might work for animated barrels of portable weapons.  but as minigun barrels are rotating real fast, this grenadelauncher kind of rotation could be a bit slow. haven't tried it yet tho.
we're looking for members: IM:UC MOD

Offline oyman

  • Members
  • *
  • king of pings
Re:Animated Weapon Parts
« Reply #12 on: 14 Oct 2004, 05:13:38 »
if its a static weapon or part of a vehicle, name the rotating part  gatling,
the drum of the heavy grenade launchers is called buben, so that might work for animated barrels of portable weapons.  but as minigun barrels are rotating real fast, this grenadelauncher kind of rotation could be a bit slow. haven't tried it yet tho.


i think the speed at which the barrels move is determined by the reload time

DBR_ONIX

  • Guest
Re:Animated Weapon Parts
« Reply #13 on: 15 Oct 2004, 15:20:30 »
BAS, Bunker Pak 5 both have something with a rotating minigun in it (BAS on a chopper tho)
Download bunker pack 5 and de-pbo minigun.pbo and open the model
;)
- Ben

Lean Bear

  • Guest
Re:Animated Weapon Parts
« Reply #14 on: 20 Oct 2004, 19:54:58 »
But these are for fixed weapons, right?

You could go through the timely process of making a new gun, with say the slide and mag as different hidden selections. Then, write a simple scirpt to have the hidden selections shown etc. this way, you could make the slide move back when fired etc. and another script to check when you are out of ammo to make the slid stay in the same place (the rear, locked).

About animating the different weapons parts, the only thing I can think of off the top of my head is to make the weapon as another class eg. a man. So you could have the different parts named so they can be animated. Then, in (I use) OFPAnim, don't load pivots and linking, animate the gun how you want, the mag coming out etc. then save the anims. Write it all up in a config like normal. The only problem is: (it would count as a unit, and there's a max no. of units you can place in an OFP mission. Also, the fact that the anims wouldn't link to what the player is doing. Unless you kept trying and eventually matched them perfectly.

Offline remcen

  • Contributing Member
  • **
  • a.k.a. hottentotten_mike
    • IM:UC
Re:Animated Weapon Parts
« Reply #15 on: 22 Oct 2004, 00:26:41 »
@lean bear ??? ??? ???
hidden selection don't work on handguns. that's a fact. you can only make the slide part of the zasleh selection which makes it appear whenever the gun is fired.  
if you wanted to use a script that checks if the gun is fired, the weapon class in the config would have to support eventhandlers which is not the case OR you have to know the name of a weapon and as DBR_ONIX said that's not the case either.
why coding a static weapon as another class?? it wouldn't work either because a 'naked man'  cannot shoot.
..but perhaps i got it all wrong.... animations for static or vehicle-based weapons are doable though. that's not the problem here.

btw the bunker pack minigun is a handgun, not a static one. but as fas as i remember it wasnt' animated.

@oyman: what you said about rotation speed seems to be true for static miniguns as on the vulcan. there it has a 'class ReloadAnimation' section in the config in which the barrel selection ("gatling"), the animation type ('rotation'), different angels and some other things are defined. BUT there's no such section in the config of the 6G30 heavy grenadelauncher, so i assume the animation speed of the 'buben' selection is not editable.  :-\
we're looking for members: IM:UC MOD

blizzard

  • Guest
Re:Animated Weapon Parts
« Reply #16 on: 15 Jan 2005, 19:11:27 »
Well it depends on what you want animated.Because to my knowledge you can animate just about anything on the weapon (for a second.If you want a long term animation then I can't help you).
-If you want something to show up at the same time that you "shoot". Create the model of what you want to happen or show in 3D (of course).And name that model "zasleh" (in objektiv program) (which means flash).It's ok if you group a bunch of things and name the selection "zasleh".
-Everything that is grouped together will show when ever a shot is fired.
-I don't know if that's what you wanted.

Lean Bear

  • Guest
Re:Animated Weapon Parts
« Reply #17 on: 21 Jan 2005, 18:34:09 »
I've got it!!! ;D ;D ;) 8)

I can animate anything you want (within lmit, of course).

Unfortunately, my technique is still undercover, so I can't reveal anything just yet.

But, I'll post some pics and stuff if you want.

I can also help you with whatever the problem was in the first place. ;D

blizzard

  • Guest
Re:Animated Weapon Parts
« Reply #18 on: 22 Jan 2005, 16:16:29 »
-Well I can't wait to see your undercover method. :)

Homefry31464

  • Guest
Re:Animated Weapon Parts
« Reply #19 on: 23 Jan 2005, 04:57:54 »
I'm curious to mate..... we need pictures...  :) :)

Offline XCess

  • Former Staff
  • ****
Re:Animated Weapon Parts
« Reply #20 on: 23 Jan 2005, 09:54:07 »
An animated folding stock would also be quite nice.

Lean Bear

  • Guest
Re:Animated Weapon Parts
« Reply #21 on: 28 Mar 2005, 22:16:13 »
This topic has been dead for a little while now, but Homefry contacted me the other day and wanted to know if it actually worked.

It really does!! :D

Of course, my method has greatly improved since I last posted here. I'm using a modified version of the BIS Beretta (as its pretty damn realistic to start with). I then streched and edited the model slightly, so when parts are animated, you can see whats underneath.

I then did the actual animation which was pretty easy to do. The end result is a beretta which, when fired, will have the working parts slid back to reveal the barrel itself. The trigger is also animated (and I'm also working on a special unit to go with this which will have lots of nice features ;)) and most of all: you see this all move!!! ;D

The only problem is getting it into OFP :P If remcen is right and EHs don't work for weapons, then I dunno what to do. The only scripting that needs to be done is to have a switchMove played when this gun is equipped and fired. (Obviously, the parts return to their original position afterwords).

I think Homefry was working on ways to make it work ingame. So, I'm sure he'll have some info soon :)

Homefry31464

  • Guest
Re:Animated Weapon Parts
« Reply #22 on: 29 Mar 2005, 07:41:46 »
I still have to write a weapon config for it... and an animation config... but if anyone knows if this has been tried before it would be great to hear about it.

Offline remcen

  • Contributing Member
  • **
  • a.k.a. hottentotten_mike
    • IM:UC
Re:Animated Weapon Parts
« Reply #23 on: 29 Mar 2005, 23:05:12 »
i tried something like that ages ago with an animated folding stock of an iraqi AKMS. it didn't work at all - neither hiddenselections nor animations, let alone EHs. ofp simply ignores them.
but cos i really want to see this ingame i hope i'm wrong

btw. did someone try to make rotating revolver drums by using a config & mem lod of a heavy grenade launcher? that should work in any case somehow
we're looking for members: IM:UC MOD

WAKA-WAKA

  • Guest
Re:Animated Weapon Parts
« Reply #24 on: 05 May 2005, 05:03:51 »
HEY,
I Dono if anyone reads this anymore but just in case i need some help. i dont quite understand modelspecial trick but have gotten it to work just by copying how it is in other configs. but i am making an m79 grenadelauncher and i want it to hsve the chamber fall open after the grenade is shot. but for some reason the "chamber open" model is what the soldier is always holding! i dont know how to fix . any help?thanks

Offline oyman

  • Members
  • *
  • king of pings
Re:Animated Weapon Parts
« Reply #25 on: 05 May 2005, 19:44:49 »
try switching them around
the modelspecial code and regular model code

WAKA-WAKA

  • Guest
Re:Animated Weapon Parts
« Reply #26 on: 06 May 2005, 05:46:00 »
it doesnt matter if i witch because i know it doesnt work. even if thery are switched, shouldn't the m79 barrel go from open to close after the grenade is shot"? it doesnt. its always open whether the gun is loaded or not so i know the modelspecial trick isnt implemented.

does anyone know why? i've gotten it tow ork with hanguns. does it jsutu not work with grenaade launchers?

Offline remcen

  • Contributing Member
  • **
  • a.k.a. hottentotten_mike
    • IM:UC
Re:Animated Weapon Parts
« Reply #27 on: 06 May 2005, 12:13:15 »
the modelspecial model is the loaded model afaik and it switches back to the normal model, when the magazine is empty, NOT when a round is fired. this works only if the magazine consists of one round only like the rifle mortar.
we're looking for members: IM:UC MOD

WAKA-WAKA

  • Guest
Re:Animated Weapon Parts
« Reply #28 on: 06 May 2005, 23:42:44 »
yea i know it switches back when the mag is empty, not when a round is fired. but with an m79, when a round is fired the "mag" (chamber), IS empty. so shouldnt it switch ? i know its not just for mortars because ive seen it done on rifles, just not Grenade launchers.

by the way what is afaik?>

Offline remcen

  • Contributing Member
  • **
  • a.k.a. hottentotten_mike
    • IM:UC
Re:Animated Weapon Parts
« Reply #29 on: 07 May 2005, 12:12:59 »
AFAIK = As Far As I Know ;)

ok, so maybe your problem is config related, post it here and we'll see what we can do :)
we're looking for members: IM:UC MOD

WAKA-WAKA

  • Guest
Re:Animated Weapon Parts
« Reply #30 on: 07 May 2005, 16:42:58 »
oh lol, i thought afaik was some kind of ofp term. ..
well my config is huge because its a large weapon pack but heres the m79 part.
class sebm79he: grenadelauncher
   {
      cursor="t_select.paa";
      scopeMagazine=2;
      weaponType=0;
      magazineType="256";
      ammo="sebgren";
      picture="\vweap\m79\m_grenadew.paa";
      displayName="40MM HE Grenade";
      displayNameMagazine="40MM HE";
      shortNameMagazine="40HE";
      count=1;
      reloadTime=0;
      sound[]={"Weapons\grenade_launch",0.000316,1};
      initSpeed=85;
      canLock=0;
      autoReload=0;
      ffMagnitude=0.100000;
      ffFrequency=1;
      ffCount=1;
      recoil="Empty";
      dispersion=0.015;
      aiDispersionCoefY=2.000000;
      maxLeadSpeed=15;
      optics=0;
      muzzlePos="usti granatometu";
      muzzleEnd="konec granatometu";
      canDrop = true;
   };

   class M16GrenadeLauncher : Riffle {};
   class sebm79:M16GrenadeLauncher
   {
      scopeWeapon=2;
      scopemagazine=o
      weaponType=1;
      valueWeapon=2;
      valueMagazine=2;
      displayName="M79 GrenadeLauncher";
      picture="\vweap\m79\w_m79.paa";
      modelspecial = "\vweap\m79\m79";
      model="\vweap\M79\M79empty";      
      uiPicture="\vweap\m79\igrenadier";
      
      muzzles[]={"sebM79Muzzle"};
      class sebM79Muzzle: GrenadeLauncher
      {
         displayName="M-79 Grenade Launcher";
         modelOptics="\vweap\m79\seboptika_m79";
         optics = 1;
         opticsZoomMin=0.35;
         opticsZoomMax=0.35;
         magazines[]={"sebm79he","sebm79buck","sebm79HEammobag","Flare", "FlareGreen", "FlareRed", "FlareYellow"};
         reloadMagazineSound[]={"\vweap\m79\sebGrenadereloade.wav",0.05,1};
         
      };
      canDrop=1;
   };


I also have both the m79 and m79empty listed in the config models section. but in game the gun always looks like its empty?

and yes i know this is the seb config and i do intend to ask permission before i think of any release :)

Kyle Sarnik

  • Guest
Re:Animated Weapon Parts
« Reply #31 on: 07 May 2005, 18:09:28 »
You should at least change the classnames  ;).

As for zlash, you actualy CAN make realistic anims with it, cause not only can you make objects flash on, but I also found that you can make them disappear when fired (like a closed slide position)...

Offline Planck

  • Honoured
  • Former Staff
  • ****
  • I'm never wrong ....I'm just not always right !
Re:Animated Weapon Parts
« Reply #32 on: 07 May 2005, 18:11:45 »
Looking at the entries for the grenadelauncher in the game config:

Code: [Select]
class GrenadeLauncher:Default
   {
      cursor="t_select.paa";
      scopeMagazine=2;
      valueWeapon=3;
      valueMagazine=2;
      weaponType=0;
      magazineType="2 *       256";
      ammo="Grenade";
      displayName="$STR_DN_GRENADE";
      displayNameMagazine="$STR_MN_GRENADE";
      shortNameMagazine="$STR_SN_GRENADE";
      count=1;
      reloadTime=0;
      sound[]={"Weapons\grenade_launch",0.0003162,1};
      reloadSound[]={"Weapons\M16load",0.0003162,1};
      initSpeed=60;
      canLock=0;
      autoReload=0;
      ffMagnitude=0.1;
      ffFrequency=1;
      ffCount=1;
      recoil="Empty";
      dispersion=0.015;
      aiDispersionCoefY=2.0;
      maxLeadSpeed=15;
      optics=0;
      muzzlePos="usti granatometu";
      muzzleEnd="konec granatometu";
      uiPicture="igrenadier";
   };


Here is the config portion for the M16grenadelauncher:

Code: [Select]
class M16GrenadeLauncher
   {
      scopeWeapon=2;
      scopeMagazine=0;
      weaponType=1;
      valueWeapon=2;
      valueMagazine=2;
      displayName="$STR_DN_M16_GRENADE";
      model="m16_granatomet_proxy";
      picture="";
      uiPicture="igrenadier";
      muzzles[]={"M16Muzzle","M203Muzzle"};
      canDrop=1;

      class M16Muzzle:M16
      {
         magazines[]={"M16"};
      };

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

As you can see it doesn't inherit from Riffle.

Btw.....your line:

scopemagazine=o

Should maybe read:

scopemagazine=0

Also those BIS configs for the grenadelaunchers don't have a modelSpecial entry.

The only modelSpecial entry (apart from class Default in cfgWeapons) in the whole of the game config is here:

Code: [Select]
class Mortar:GrenadeLauncher
      {
      scopeWeapon=0;
      scopeMagazine=2;
      modelSpecial="m16_mortar_proxy";
      valueMagazine=5;
      magazineType="2 *       256";
      ammo="MortarShell";
      displayName="$STR_DN_MORTAR_W";
      displayNameMagazine="$STR_MN_MORTAR_W";
      shortNameMagazine="$STR_SN_MORTAR_W";
      count=1;
      initSpeed=70;
      reloadAction=manactreloadmortar;
      modes[]={"this","this"};
      };


Hope this helps a tiny bit.


Planck
I know a little about a lot, and a lot about a little.

WAKA-WAKA

  • Guest
Re:Animated Weapon Parts
« Reply #33 on: 07 May 2005, 22:37:56 »
thanks plank i will try it.
yea kyle sarnik i see you have some vietnam weapons coming out with animated weapon parts. that is pretty sweet how do you do it? or is it top secret right now ;).   BTw i didnt change classnames because i might reease it a replacement for the sebnam_wp if they let me because their guns look a little outdated.

WAKA-WAKA

  • Guest
Re:Animated Weapon Parts
« Reply #34 on: 07 May 2005, 22:45:12 »
sarnik, can you adjust the times of how long a chamber is open for the animated wepaon parts? otherwise it would be uselss for an m79 because the barrel would open and close real quick.

also does anyone know what it means when it wont open an object in the editor because it says unsupported version? i cant figure it out

Kyle Sarnik

  • Guest
Re:Animated Weapon Parts
« Reply #35 on: 07 May 2005, 23:54:30 »
sarnik, can you adjust the times of how long a chamber is open for the animated wepaon parts? otherwise it would be uselss for an m79 because the barrel would open and close real quick.

also does anyone know what it means when it wont open an object in the editor because it says unsupported version? i cant figure it out

One solution, two ways of doing it:
Modelspecial, use the model special to make it closed when its loaded, and empty when its not loaded. If its a single round magazine, your golden.

If it is an ammo bag type mag, you need to create a script run off a fired EH that will detect if you fired the M79, and then if so use selectweapon <otherweapon>, then a delay, then selectweapon "M79", <otherweapon> being a weapon you add before the selectweapon command, and remove after the selectweapon "M79", <otherweapon> needs to be like a fake weapon that you should config that is based of... say.. the "put" weapon, and accepts no mags and is not hidden when empty (hideemtpy=0; or something I forgot the config line for that, look in the commented config for it). That should do it....

WAKA-WAKA

  • Guest
Re:Animated Weapon Parts
« Reply #36 on: 08 May 2005, 00:04:07 »
oooh sounds good....lol but im not good enough for that really. luckily i am "golden" at the moment because im using just a grenade (single shot). but the modelspecial still doesnt work and i dont see why. look at the config i posted a little earlier, do u have any suggestions?

thanks

DanAK47

  • Guest
Re:Animated Weapon Parts
« Reply #37 on: 13 May 2005, 22:41:16 »
You can reveal what is underneath an object on your model by creating a shell around that particular object, applying a near-transparent texture to it, placing it in the zasleh selection, and using face order to ensure that the object that is to be hidden is rendered after the "shell".

This creates something like the "window bug" in vehicles and hides the object you want to disappear (e.g. a rifle's bolt, or a pistol's slide). This is how I animated my M14s.