Copy weapon in custom map

Ask questions, discuss ideas, get answers
Poow
Posts: 271
Joined: Sun Nov 01, 2009 8:00 pm
Location: Germany
Contact:

Re: Copy weapon in custom map

Post by Poow »

Code: Select all

    AnimationStateMachine.createState Ub_FirePistol
    AnimationStateMachine.addAnimation animations/WeaponHandling/3p/Pistol/3PFirePistol.baf 1.0 c_AsmPlayOnce
    AnimationStateMachine.addAnimation animations/WeaponHandling/1p/Pistol/1pFirePistol.baf 1.0 c_AsmPlayOnce
  AnimationStateMachine.setOtherState c_AsmWeaponState WeaponFirePistol
    AnimationStateMachine.addTransitionWhenDone _POSE_
    AnimationStateMachine.setMorphFactor 10000.0
    AnimationStateMachine.setFlag c_AsmIsCrouching



    AnimationStateMachine.addTransitionOne c_PIFire 0.5 1 Ub_FireColt
And all .baf files are at the right location. I'm pretty sure.

Map (3,44 MB)
You’re entering a world of pain!
Poow
Posts: 271
Joined: Sun Nov 01, 2009 8:00 pm
Location: Germany
Contact:

Re: Copy weapon in custom map

Post by Poow »

*Slightly push* :)
You’re entering a world of pain!
erwin rommel
Posts: 18
Joined: Wed Dec 16, 2009 9:02 am

Re: Copy weapon in custom map

Post by erwin rommel »

Coding animations is undoubtedly the hardest part of modding. Some days I wonder if DICE intentionally made it hard to understand. I'll download the map and check it out.

Edit:
I did a quick test. Some thoughts:

1) LOL pirates! At first I thought it was a glitch.

2) Your animations are in the right folders (You just copy/pasted stuff, right?)

3) I messed with the code a little, and even tried copying over the more basic states and turning them to pistol (stand, turn, etc.) but it didn't work.

4) Frustrated with (3), I even tried:

Code: Select all

AnimationStateMachine.createState Ub_StandAK47
AnimationStateMachine.addAnimation Animations/StandWalkRun/3p/pistol/3PStandUpperpistol.baf 0.8 1
AnimationStateMachine.addAnimation Animations/StandWalkRun/1p/pistol/1PStandpistol.baf 0.1 1
AnimationStateMachine.addTransitionOne c_PIFire 0.5 1 Ub_Fire
AnimationStateMachine.addTransitionOne c_PIAltFire 0.5 1 Ub_AltFire
AnimationStateMachine.addTransitionOne c_PIThrottle 0.5 1 Ub_RunForwardpistol
AnimationStateMachine.addTransitionOne c_PIThrottle -1 -0.5 Ub_RunBackwardpistol
AnimationStateMachine.addTransitionOne c_PIYaw  -1 -0.01 Ub_StrafeLeftpistol
AnimationStateMachine.addTransitionOne c_PIAction 0.5 1 Ub_StandJumppistol
AnimationStateMachine.addTransitionOne c_PIYaw  0.01 1 Ub_StrafeRightpistol
AnimationStateMachine.addTransitionOne c_PIMouseLookX -1000 -0.0001 Ub_Turnpistol
AnimationStateMachine.addTransitionOne c_PIMouseLookX 0.0001 1000 Ub_Turnpistol
AnimationStateMachine.returnToState Ub_Standpistol
AnimationStateMachine.setMorphFactor 0.3
This should cause an error since the state Ub_StandAK47 already exists. But it ran without a hitch and the AK47 worked swell. This tells me that the game isn't even reading this code. This could be either A) because the game isn't running these .con files (which it is being told to) or B) because it doesn't like ASM stuff here.

***

I'll look into it more later ... One thing I'm really good at is learning from already existing code. Does anyone know of a custom map with custom animations?
Poow
Posts: 271
Joined: Sun Nov 01, 2009 8:00 pm
Location: Germany
Contact:

Re: Copy weapon in custom map

Post by Poow »

Hey!
Thanks for your effort so far! :)

I searched a long time for a map with custom animations in it. And "CamelNele" gave me a tip:
His map "The battle at Einunnabridge" includes a whole new army (with new weapons & animations)
From the TDP Mappack 8 for FH1
Or use this link:
The_battle_at_Einunnabridge.rar (23,6 MB)

But that map was a bit confusing for me as a "beginner". Because almost everything is custom made there... Very confusing :roll:
:P
You’re entering a world of pain!
erwin rommel
Posts: 18
Joined: Wed Dec 16, 2009 9:02 am

Re: Copy weapon in custom map

Post by erwin rommel »

Well, that's an interesting way of doing it.

That's a map for FH, clearly. And it appears that th FH devs were very nice coders. See, they coded the FH animations.rfa so it calls files "SingleShotWeaponsmod2.inc" and "MultiShotWeaponsmod2.inc" These do not appear in FH's animations.rfa. Rather, it appears that they intended mappers to place these in their maps to allow for custom animations. It's actually quite clever. Unfortunately, DC does not have this feature...

This tells me two things:

1) The FH devs are awesome
2) There might not be a way to do what you want. If the FH devs had to structure their animations.rfa in a special way to allow this, it is likely that they could find no other way of doing it.
Poow
Posts: 271
Joined: Sun Nov 01, 2009 8:00 pm
Location: Germany
Contact:

Re: Copy weapon in custom map

Post by Poow »

Mhh, bad news :(
Is it difficult to make a mini mod with the weapon + all my custom objects that requires DC?
Because the players needs to download my map anyway.
You’re entering a world of pain!
erwin rommel
Posts: 18
Joined: Wed Dec 16, 2009 9:02 am

Re: Copy weapon in custom map

Post by erwin rommel »

I would say it's pretty easy, actually.
User avatar
Senshi
Posts: 697
Joined: Sun Oct 18, 2009 1:14 pm
Location: Germany
Contact:

Re: Copy weapon in custom map

Post by Senshi »

Sorry, I didn't post because I was quite busy over the holidays (the usual...family, friends and especially in combination with the latter, quite some amount of booze ;) ).

I'll take a look into this later today or tomorrow as I'm currently at my parents and have no modding equipment on my laptop atm.

I'm intrigued by the FH map you posted. If FH made the game call the singleshotweapons2.inc etc., there is no reason why it shouldn't read the singleshotweapons.inc too, as you provide that with your map and it should be read by BF and "patch"/replace the original animations.rfa-singleshotweapons.inc too.

Rommel, if you create a state that already exists, doesn't the second one simply replace the first one? At least I never got error messages for doing that.

But as said, when I'm back home, I'll give further input.

And yes, making a minimod with all this is extremly easy. Just pack the files you placed in your map that are respective for "regular content" up in the correct .rfa files (animations, objects, sound, standardmesh etc.) , give your mod a init.con (just take a look how the other modfolders are set up).
erwin rommel
Posts: 18
Joined: Wed Dec 16, 2009 9:02 am

Re: Copy weapon in custom map

Post by erwin rommel »

I have definitely gotten an error message for that, but perhaps that was because I was running it with the debugger? In any case, I was running the debugger for this as well.

Image

Actually, the very first thing I tried was creating a new singleshotweaponsmod.inc. Perhaps I made a stupid error? I don't know.
Post Reply