Rotational bundles in Handweapon files
Re: Rotational bundles in Handweapon files
Isnt there a minigun in bfv? cant remember exactly
edit:
edit:
Re: Rotational bundles in Handweapon files
I'm trying to make a handheld minigun 

Walk quietly and carry a sniper rifle
- Apache Thunder
- Posts: 1213
- Joined: Mon Oct 19, 2009 2:48 am
- Location: Levelland Texas, USA
- Contact:
Re: Rotational bundles in Handweapon files
How is the minigun object set up in relation to your handweapon? Is it addtemplated directly to the handweapon or is it addTemplated to a lodObject (like all handweapon parts should be)
I noticed that I can't rotate/move my Animated Bundle host object for the weapon parts directly from the AddTemplate entry for the lod object. But instead had to alter position/rotation from the child objects that are on the lodObject.
If your minigun rotational bundle isn't tied to the main lod object, then that might be why it's not rotated. Don't know for sure since you haven't posted the full code for the con file this is used in.
Try something structured like this: (this code used as an example from my BFH'42 mod)
If that doesn't work, then that isn't the cause. I've noticed effects like muzzle flash and stuff are not part of the lod object.
They tend to have this command following their addemplate entries:
So wherever you end up addTemplating it, try it like this:
(replace 0/0/0 values for position/rotation for whatever you are actually using. If you don't have them set, then leave the commands out entirely)
You can also try nesting the object deeper into a second child object. Perhaps it can't be directly tied to the animated bundle either:
(that being a rough example)
If all that fails then it's a game limitation and you will have to instead use an animation. This involves adding a weapon bone to the gun skeleton and adding the spin via animation and saving the resulting BAF files for the firing animations. I have not worked on weapon animations myself, thus you will need to look around for weapon animation tutorials to get started on how to modify the weapon firing animation for the gun your using this on.
I noticed that I can't rotate/move my Animated Bundle host object for the weapon parts directly from the AddTemplate entry for the lod object. But instead had to alter position/rotation from the child objects that are on the lodObject.
If your minigun rotational bundle isn't tied to the main lod object, then that might be why it's not rotated. Don't know for sure since you haven't posted the full code for the con file this is used in.

Try something structured like this: (this code used as an example from my BFH'42 mod)
Code: Select all
rem ---------------------------------------
ObjectTemplate.addTemplate BRI_MG_LewisLod
ObjectTemplate.addTemplate e_MuzzThomp
ObjectTemplate.setInputId -1
ObjectTemplate.startoneffects 0
ObjectTemplate.setPosition 0/0.07/0.727
ObjectTemplate.addTemplate e_ShellMG
ObjectTemplate.setInputId -1
ObjectTemplate.startoneffects 0
ObjectTemplate.setPosition 0.046/0.128/0.05
ObjectTemplate.create LodObject BRI_MG_LewisLod
ObjectTemplate.hasDynamicShadow 1
rem --------------------------------------------
ObjectTemplate.addTemplate BRI_MG_LewisComplex
ObjectTemplate.addTemplate BRI_MG_LewisSimple
rem --------------------------------------------
ObjectTemplate.lodselector HandWeaponLodSelector
ObjectTemplate.create Bundle BRI_MG_LewisSimple
ObjectTemplate.geometry Shade_BRI_MG_Lewis_m1
ObjectTemplate.hasDynamicShadow 1
rem --------------------------------------------------------
ObjectTemplate.create AnimatedBundle BRI_MG_LewisComplex
ObjectTemplate.geometry BRI_MG_Lewis_m1
ObjectTemplate.hasDynamicShadow 1
ObjectTemplate.createSkeleton animations/MG.ske
ObjectTemplate.addTemplate MinigunBarrel
ObjectTemplate.create RotationalBundle MinigunBarrel
ObjectTemplate.networkableInfo HandFireArmsInfo
ObjectTemplate.setAttachToListener 1
ObjectTemplate.setGeometry Minigun_Brle_m1
rem -----------------------------------
rem -----------------------------------
ObjectTemplate.setMaxSpeed 0/0/5000
ObjectTemplate.setAcceleration 0/0/5000
ObjectTemplate.setInputToRoll c_PIFire
If that doesn't work, then that isn't the cause. I've noticed effects like muzzle flash and stuff are not part of the lod object.
They tend to have this command following their addemplate entries:
Code: Select all
ObjectTemplate.setInputId -1
Code: Select all
ObjectTemplate.addTemplate MinigunBarrel
ObjectTemplate.setPosition 0/0/0
ObjectTemplate.setRotation 0/0/0
ObjectTemplate.setInputId -1
You can also try nesting the object deeper into a second child object. Perhaps it can't be directly tied to the animated bundle either:
Code: Select all
ObjectTemplate.create AnimatedBundle BRI_MG_LewisComplex
ObjectTemplate.geometry BRI_MG_Lewis_m1
ObjectTemplate.hasDynamicShadow 1
ObjectTemplate.createSkeleton animations/MG.ske
ObjectTemplate.addTemplate MinigunBundle
ObjectTemplate.create Bundle MinigunBundle
ObjectTemplate.addTemplate MinigunBarrel
If all that fails then it's a game limitation and you will have to instead use an animation. This involves adding a weapon bone to the gun skeleton and adding the spin via animation and saving the resulting BAF files for the firing animations. I have not worked on weapon animations myself, thus you will need to look around for weapon animation tutorials to get started on how to modify the weapon firing animation for the gun your using this on.



I have cameras in your head!
Re: Rotational bundles in Handweapon files
Here is the full code:
Code: Select all
ObjectTemplate.create HandFireArms Bar1918
ObjectTemplate.itemIndex 3
ObjectTemplate.networkableInfo HandFireArmsInfo
ObjectTemplate.projectileTemplate MachinegunProjectile
ObjectTemplate.setTracerTemplate MachinegunProjectile CRD_NONE 1/0/0
ObjectTemplate.projectilePosition 0/0/0
ObjectTemplate.hasDynamicShadow 1
ObjectTemplate.magSize 200
ObjectTemplate.numOfMag 6
ObjectTemplate.magType 0
ObjectTemplate.reloadtime 4
ObjectTemplate.roundOfFire 600
objectTemplate.aiTemplate BarAI
ObjectTemplate.altFireOnce 1
ObjectTemplate.zoomFov 0.5
ObjectTemplate.setScopeIcon "IronSights/Bar.tga"
ObjectTemplate.setSightIcon "IronSights/Sight_Blank.dds"
ObjectTemplate.setSniperSight 0
ObjectTemplate.addRootSpeed 0
ObjectTemplate.AmmoType 1
ObjectTemplate.altFireOnce 1
rem objectTemplate.UseScope 1
Rem *** Deviation Begin *****
ObjectTemplate.velocity 400
ObjectTemplate.setRecoilForceUp CRD_UNIFORM/0.28/0.32/0
ObjectTemplate.setRecoilForceLeftRight CRD_UNIFORM/-0.2/0.2/0
ObjectTemplate.setHasRecoilForce 1
ObjectTemplate.setGoBackOnRecoil 0
ObjectTemplate.setFireDev 3.5 0.25 0.03
ObjectTemplate.setDevMod 1.0 0.85 0.5
ObjectTemplate.setMinDev 0.75
ObjectTemplate.setTurnDev 0 0 0 0
ObjectTemplate.setSpeedDev 2.25 0.2 0.2 0.1
ObjectTemplate.setMiscDev 2.5 2.5 0.1
`
Rem *** Deviation End *****
ObjectTemplate.fireInCameraDof 1
ObjectTemplate.loadSoundScript Sounds/bar1918.ssc
ObjectTemplate.GUIIndex 18
ObjectTemplate.setHudAmmoType ATAmmoBar
ObjectTemplate.setAmmoBar "Ingame/Magbar_Bar_empty_32x64.tga"
ObjectTemplate.setAmmoBarFill "Ingame/Magbar_Bar_full_32x64.tga"
ObjectTemplate.setAmmoBarSize 48
ObjectTemplate.setAmomBarPosX 5
ObjectTemplate.setAmomBarPosY -11
ObjectTemplate.setCrossHairType CHTIcon
ObjectTemplate.crosshairicon "Assult.tga"
ObjectTemplate.createSkeleton animations/Bar1918.ske
ObjectTemplate.useSkeletonPartAsMain Bar1918
ObjectTemplate.addTemplate Bar1918Lod
ObjectTemplate.addTemplate e_MuzzSG44
ObjectTemplate.setInputId -1
ObjectTemplate.startoneffects 0
ObjectTemplate.setPosition 0/-.19/1.1
ObjectTemplate.setRotation 0/0/0
ObjectTemplate.addTemplate e_shell792mm
ObjectTemplate.setInputId -1
ObjectTemplate.startoneffects 1
ObjectTemplate.setPosition 0/0.04/0.28
ObjectTemplate.setRotation 0/0/0
ObjectTemplate.addTemplate MinigunBarrel
ObjectTemplate.setPosition 0/-.19/0
rem ** SimpleObjects
ObjectTemplate.create SimpleObject Bar1918Trigger
ObjectTemplate.geometry Bar1918Trigger
ObjectTemplate.create SimpleObject Bar1918Mag
ObjectTemplate.create SimpleObject Bar1918Plupp
ObjectTemplate.geometry Bar1918Plupp
ObjectTemplate.create SimpleObject Bar1918Simple
ObjectTemplate.geometry Shad_Bar1918
rem *** from the DC mod -Mi24DGGunBarrel- ***
ObjectTemplate.create RotationalBundle MinigunBarrel
ObjectTemplate.networkableInfo HandFireArmsInfo
ObjectTemplate.setAttachToListener 1
ObjectTemplate.setGeometry Minigun_Brle_m1
rem -----------------------------------
rem -----------------------------------
ObjectTemplate.setMaxSpeed 0/0/5000
ObjectTemplate.setAcceleration 0/0/5000
ObjectTemplate.setInputToRoll c_PIFire
ObjectTemplate.create AnimatedBundle Bar1918Complex
ObjectTemplate.geometry Minigun_Base
ObjectTemplate.hasDynamicShadow 1
ObjectTemplate.createSkeleton animations/Bar1918.ske
ObjectTemplate.addTemplate Bar1918Trigger
ObjectTemplate.bindToSkeletonPart trigger
ObjectTemplate.addTemplate Bar1918Mag
ObjectTemplate.bindToSkeletonPart Mag
ObjectTemplate.addTemplate Bar1918Plupp
ObjectTemplate.bindToSkeletonPart plupp
ObjectTemplate.create LodObject Bar1918Lod
ObjectTemplate.lodselector HandWeaponLodSelector
ObjectTemplate.addTemplate Bar1918Complex
ObjectTemplate.addTemplate Bar1918Simple
Walk quietly and carry a sniper rifle
- Apache Thunder
- Posts: 1213
- Joined: Mon Oct 19, 2009 2:48 am
- Location: Levelland Texas, USA
- Contact:
Re: Rotational bundles in Handweapon files
Did you try addTemplating the minigun bareel to the Bar1918Complex object instead of directly onto the handweapon?
And you can also try adding this after the addTemplate entry if you still have it on the main handweapon:
That's used to activate effects, but it might also work to get rotational bundles to work.
And you can also try adding this after the addTemplate entry if you still have it on the main handweapon:
Code: Select all
ObjectTemplate.setInputId -1



I have cameras in your head!
Re: Rotational bundles in Handweapon files
Yeah.. I try all the stuff you suggested with no effect
I even tried making an engine but even that didn't spin
Is there any way you could edit a Meme file?
(Just looking at this post: viewtopic.php?f=9&t=1661
)
Thanks!


(Just looking at this post: viewtopic.php?f=9&t=1661

Thanks!
Walk quietly and carry a sniper rifle
- Apache Thunder
- Posts: 1213
- Joined: Mon Oct 19, 2009 2:48 am
- Location: Levelland Texas, USA
- Contact:
Re: Rotational bundles in Handweapon files
Well at this point it's likely that the game doesn't connect player input to child objects (other then effects) on handweapons. They are either forced to remain static or they never receive player input. Unfortunately this is not something a meme file edit would fix. It's in internal issue with the EXE and therefore a hard-coded limitation.
It is possible to addTemplate a FireArm object to handweapons. I have in the past been able to fire things from them despite them being a child object of a handweapon. What you could do is addTemplate a firearm object to your handweapon and use that for your rotating minigun mesh.
Just be sure to have it fire a harmless projectile of some type and that it have the same ammo count/reload time as your main handweapon or else it will interfere with your ability to use the handweapon. You could also just have the firearm object it self be the weapon that fires the main projectile anyway, but you'll still need to keep them synced if you want the HUD to reflect the correct ammo count and such.
It is possible to addTemplate a FireArm object to handweapons. I have in the past been able to fire things from them despite them being a child object of a handweapon. What you could do is addTemplate a firearm object to your handweapon and use that for your rotating minigun mesh.
Just be sure to have it fire a harmless projectile of some type and that it have the same ammo count/reload time as your main handweapon or else it will interfere with your ability to use the handweapon. You could also just have the firearm object it self be the weapon that fires the main projectile anyway, but you'll still need to keep them synced if you want the HUD to reflect the correct ammo count and such.



I have cameras in your head!
Re: Rotational bundles in Handweapon files
So I added a firearms thing and that works, but how do I attach a spinning barrel to it? 

Walk quietly and carry a sniper rifle
Re: Rotational bundles in Handweapon files
So are you saying that I can fire two weapons at once when I click the left mouse button? For the longest time, I've been curious about adding one or two FireArms to a HandFireArm and set the to be fired when the main gun is fired.Apache Thunder wrote:It is possible to addTemplate a FireArm object to handweapons. I have in the past been able to fire things from them despite them being a child object of a handweapon. What you could do is addTemplate a firearm object to your handweapon and use that for your rotating minigun mesh.
(Forum Thread|Download) Swaffy'sMod v0.34 | Download link to come Soon™