[CSM] Changing the three default animation states

Ask questions, discuss ideas, get answers

Changing the three default animation states

Postby Classical Modder » Sat Nov 21, 2015 1:20 am

Hi guys, I'm trying to solve a little issue with the default animation states. In Battlefield 1942, there are three default animation states. These are the standing position, the crouch position and the lie (prone) position.

All those default animation states have cameras as well as HUD elements tied to them (these are defined in CommonSoldierData.inc as well as in the Soldier files from Objects.rfa). I know it is possible to remove default animation states, for example, my infantry only mod removes the lie state entirely.

However, I've always been curious about whether it would be possible to have more than three default animation states in BF1942. In my mod, I am looking for a way to add right and left leans on top of the existing default animation states. So in total, since I have disabled the lie state, my mod would need to have four default animation states. These are 1) Lb_Stand 2) Lb_Crouch 3) Lb_RightLean (replacing Lb_Lie) 4)Lb_LeftLean (new default state that I create myself).

The right and left lean animation states which I would like to create would have cameras tied to them and new 1p and 3p animations. Creating the new animations is not the main issue here but rather finding a way to add a fourth default animation state. I have never tried nor have I seen any mod that has more than three default animation states.

I would like to know if you guys have seen a mod which has more than three default animation states. And by default animation states I don't mean walking, jumping or strafing left and right. Just default animation states added on top on Stand, Crouch and Lie. This has to be an easy modification.
{SoH} Clan Leader // http://sohclan.forumotion.com/
See my Strasbourg map project here.
GSC: diamondback67
Steam: diamondback67
Classical Modder
 
Posts: 373
Joined: Mon Oct 01, 2012 3:13 pm
Location: Canada

Re: Changing the three default animation states

Postby Seth » Thu Dec 03, 2015 1:22 pm

How about just a lean forward state, and use the mouse to look left or right?

You know how when you stay in one place and start turning left or right with the mouse the soldier's body doesn't immediately turn in that direction (you can see that in third person or through the arrow on the minimap)? Only the upper body (head, weapon) rotates, until you turn beyond a certain angle (60 degrees to the left or 42 degrees to the right) and only then does the lower body start to rotate. This is set in Soldiers/Common/CommonSoldierData.inc:

Code: Select all
ObjectTemplate.setAnimationState 1 Ub_StandAim
ObjectTemplate.setTurnLeftRightAngle 20.0 14.0


The values there are 1/3 the values in degrees.

So if you let the soldier look (and aim) up to about 90 degrees to either side (not unrealistic in many cases) then you can have a single lean forward (a.k.a. bow, bend) position, which would be a few inches forward and perhaps rotated a few degrees in the forward vertical plane (like a bow), and this lets you look and shoot around corners on either side. Not only that, it also lets you shoot directly down from a window! How frustrating not to be able to do this! When you want to look around a corner you just need to go near the corner facing the direction where you want to bend (as you would in a normal situation) and stop moving. Then you bend and turn in the desired direction, not necessarily in that order. I think this will work very well.

The only drawback is that if you instinctively press the key to move forward a little, perhaps wanting to get closer to the corner or whatever, the lower body's rotation resets to wherever the soldier is looking, thus potentially either hiding the upper body back behind the corner, or exposing the lower body around the corner (depending on how you make it work). Perhaps this can be improved.
Bitcoin address: 1NEoGgsFS9vxLT3eW4w6RFdvzPXLpQX66t
Seth
 
Posts: 14
Joined: Sun Jun 19, 2011 10:49 am


Return to 1942 Modding Discussion

Who is online

Users browsing this forum: Baidu [Spider] and 10 guests

cron