1P Animations on PCOs

Making or wanting help making your own asset? Check in here
|HBD|Bad_santa12345
Posts: 23
Joined: 2011-11-30 11:35

1P Animations on PCOs

Post by |HBD|Bad_santa12345 »

A cool thing i discovered.


It allows 1p animatons with skinnedmesh properties to be used on basicaly any object. But only 1p because the animation triggering is 100% client sided so there can't be 3p reload animations unless someone discovers a way for sending client side commands from python.

I'm not very good at explaining how things work so i will just give you a link to a demo mod with this feature implemented to the stationary m249. I have commented the code as well as i could so it should be easy to reverse engineer. https://dl.dropbox.com/u/52873126/vehic ... s_demo.rar
Last edited by |HBD|Bad_santa12345 on 2012-08-18 08:15, edited 1 time in total.
Reason: Fixed YouTube link.
Doc.Pock
Posts: 2899
Joined: 2010-08-23 14:53

Re: 1P Animations on PCOs

Post by Doc.Pock »

this is nice. 'd love to have this in PR
Chuc
Retired PR Developer
Posts: 7016
Joined: 2007-02-11 03:14

Re: 1P Animations on PCOs

Post by Chuc »

Thanks so much BadSanta! We'll put this discovery to good use :)
Is it possible also to have a 'deploy' animation where the player enters the PCO?
Last edited by Chuc on 2012-08-18 08:52, edited 1 time in total.
Image
Personal Folio - http://www.studioash.net
|HBD|Bad_santa12345
Posts: 23
Joined: 2011-11-30 11:35

Re: 1P Animations on PCOs

Post by |HBD|Bad_santa12345 »

[R-DEV]Chuc wrote:Thanks so much BadSanta! We'll put this discovery to good use :)
Is it possible also to have a 'deploy' animation where the player enters the PCO?
Animation can be triggered when quiindex changes so yes it is. Anything that can be used as a variable for "hudBuilder.setNodeShowVariable/setnodeLogicshowVariable" can be used as an animation trigger. Cameras cannot be animated with this system so there won't be animations like open door and then enter vehicle.
dodek96_pl
Posts: 45
Joined: 2010-11-19 15:14

Re: 1P Animations on PCOs

Post by dodek96_pl »

AWESOME!
If you think something is impossible, let someone who doesn't know that do it ;)
Chuc
Retired PR Developer
Posts: 7016
Joined: 2007-02-11 03:14

Re: 1P Animations on PCOs

Post by Chuc »

That's fine. So we can't have anything like animated camera shake or camera pans.

Having a look at it now, if you had the entire mesh in the skinnedmesh, and a placeholder in the bundlemesh, could you potentially also animate the weapon independent of the camera as well?

Also, how did you get the right-click ironsights to work? We've always done it by changing the chase-camera :S
Image
Personal Folio - http://www.studioash.net
Alek-say
Posts: 349
Joined: 2010-11-27 20:17

Re: 1P Animations on PCOs

Post by Alek-say »

Also this:


I think that many of his works can be very helpful for PR.
Image
Image
|HBD|Bad_santa12345
Posts: 23
Joined: 2011-11-30 11:35

Re: 1P Animations on PCOs

Post by |HBD|Bad_santa12345 »

[R-DEV]Chuc wrote: Also, how did you get the right-click ironsights to work? We've always done it by changing the chase-camera :S
Two cameras addTemplated to the GenericFireArm or to the PCO and a togglecameracomp for the GenericFireArm.

Code: Select all

ObjectTemplate.activeSafe GenericFireArm uslmg_m249saw_stationary
...
...
...
rem ---BeginComp:ToggleCameraComp ---
rem *** Using this way to zoomin causes a bug of allowing reloading while zoomed. ***
ObjectTemplate.createComponent ToggleCameraComp
ObjectTemplate.zoom.startCameraId 1001
ObjectTemplate.zoom.changeCameraId 1002
rem ---EndComp ---
And cameras coded like this.

Code: Select all

ObjectTemplate.create Camera us_bipod_Camera_UnZoomed
...
...
...
ObjectTemplate.CameraId 1001

Code: Select all

ObjectTemplate.create Camera us_bipod_Camera_Zoomed
...
...
...
ObjectTemplate.CameraId 1002
There is no tozoom animation the camera swap will be instantanious when you press the zoom in button.
|HBD|Bad_santa12345
Posts: 23
Joined: 2011-11-30 11:35

Re: 1P Animations on PCOs

Post by |HBD|Bad_santa12345 »

Alek-say wrote:Also this:


I think that many of his works can be very helpful for PR.
This system uses readbytefrommemory function. Problem is that i have not been able to find a static memory offset to the PrimaryAmmoString so i will have to find it manyally using tsearch each time i restart the game.
-=anders=-
Retired PR Developer
Posts: 1532
Joined: 2005-10-27 14:48

Re: 1P Animations on PCOs

Post by -=anders=- »

now THIS is indeed good news!
[img]https://dl.dropboxusercontent.com/u/11035283/anders_prsig.png[/img]
PR:BF2 Sound & VisualFX

Alek-say
Posts: 349
Joined: 2010-11-27 20:17

Re: 1P Animations on PCOs

Post by Alek-say »

|HBD|Bad_santa12345 wrote:This system uses readbytefrommemory function. Problem is that i have not been able to find a static memory offset to the PrimaryAmmoString so i will have to find it manyally using tsearch each time i restart the game.
And so, it's impossible to fix this problem?
Image
Image
J.F.Leusch69
Retired PR Developer
Posts: 2988
Joined: 2008-04-23 16:37

Re: 1P Animations on PCOs

Post by J.F.Leusch69 »

found this in Common.zip\Scripts\USJEP_HMMWV_1p_anims.con

if v_arg2 == enable
rem *** May have some side effects but it is the only way to prevent a bug of seeing the 1p hands of another player in 3p ***
renderer.minculldistance 2
elseif v_arg2 == disable
rem *** Revert back to default value. ***
renderer.minculldistance 80
endif

might it be fixable with using a different geometry for the hands than the soldier geometries, could also help with performance to only have a mesh with geom0
Arc_Shielder
Retired PR Developer
Posts: 1621
Joined: 2010-09-15 06:39

Re: 1P Animations on PCOs

Post by Arc_Shielder »

Throw all your gold to this man! Make him stay!
Image
|HBD|Bad_santa12345
Posts: 23
Joined: 2011-11-30 11:35

Re: 1P Animations on PCOs

Post by |HBD|Bad_santa12345 »

[R-DEV]J.F.Leusch69 wrote:found this in Common.zip\Scripts\USJEP_HMMWV_1p_anims.con

if v_arg2 == enable
rem *** May have some side effects but it is the only way to prevent a bug of seeing the 1p hands of another player in 3p ***
renderer.minculldistance 2
elseif v_arg2 == disable
rem *** Revert back to default value. ***
renderer.minculldistance 80
endif

might it be fixable with using a different geometry for the hands than the soldier geometries, could also help with performance to only have a mesh with geom0
No it doesn't matter if the mesh has geom1 or not because animatedBundle will always use geom0. The bug i am talking about is sort of shown in this video http://www.youtube.com/watch?v=NpsSfhV8hqk It is that you see the actual 1p hands from 3p. Changing the minculldistance hides the hands if they are farther than 2 meters from you and it is practically impossible to have two vehicles that close to each other so the bug is fixed. It may cause some other small objects to be culled out at very low distances too.
Last edited by |HBD|Bad_santa12345 on 2012-08-18 14:37, edited 2 times in total.
|HBD|Bad_santa12345
Posts: 23
Joined: 2011-11-30 11:35

Re: 1P Animations on PCOs

Post by |HBD|Bad_santa12345 »

Alek-say wrote:And so, it's impossible to fix this problem?
Someone with experience in memory/assembly hacks might be able to solve the problem but I am not.
Nemes1s
Posts: 42
Joined: 2011-08-04 13:40

Re: 1P Animations on PCOs

Post by Nemes1s »

|HBD|Bad_santa12345 wrote:Someone with experience in memory/assembly hacks might be able to solve the problem but I am not.
I'll take a look at it when I have time ;-)
Image
|HBD|Bad_santa12345
Posts: 23
Joined: 2011-11-30 11:35

Re: 1P Animations on PCOs

Post by |HBD|Bad_santa12345 »

Nemes1s wrote:I'll take a look at it when I have time ;-)
Actually i did some testing and came up with something that works pretty well for determening the exact ammount of bullets you have in your mag without reading the info directly from memory. Reading it from memory would always be better and more reliable though.
Navo
Posts: 1389
Joined: 2011-05-22 14:34

Re: 1P Animations on PCOs

Post by Navo »

AND 1.0 IS DELAYED ONCE AGAIN

Awesome work man, I like how you discover features that were thought to be hardcoded for ages.
Does this also work on boats and such?

*edit*

Accidently a word
Last edited by Navo on 2012-08-20 09:42, edited 3 times in total.
richyrich55
Posts: 332
Joined: 2007-07-18 16:04

Re: 1P Animations on PCOs

Post by richyrich55 »

Navo wrote:AND 1.0 IS DELAYED ONCE AGAIN
This so much!

Impressive work, Santa!
"What's the advantage of these choppers when compared to a squad medic?"

Pirate

"Medics dont have rotors."

rampo93(FIN)

Arab
PR:BF2 Developer
Posts: 2898
Joined: 2012-05-18 03:37

Re: 1P Animations on PCOs

Post by Arab »

richyrich55 wrote:This so much!

Impressive work, Santa!
Seconded! PR 1.0 + this = Win!

Really Awesome, Fantastic, Beautiful, Great work Santa!
Image
Post Reply

Return to “PR:BF2 Community Modding”