Page 1 of 3

1P Animations on PCOs

Posted: 2012-08-18 08:11
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

Re: 1P Animations on PCOs

Posted: 2012-08-18 08:28
by Doc.Pock
this is nice. 'd love to have this in PR

Re: 1P Animations on PCOs

Posted: 2012-08-18 08:47
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?

Re: 1P Animations on PCOs

Posted: 2012-08-18 08:59
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.

Re: 1P Animations on PCOs

Posted: 2012-08-18 08:59
by dodek96_pl
AWESOME!

Re: 1P Animations on PCOs

Posted: 2012-08-18 09:06
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

Re: 1P Animations on PCOs

Posted: 2012-08-18 09:07
by Alek-say
Also this:


I think that many of his works can be very helpful for PR.

Re: 1P Animations on PCOs

Posted: 2012-08-18 09:44
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.

Re: 1P Animations on PCOs

Posted: 2012-08-18 09:48
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.

Re: 1P Animations on PCOs

Posted: 2012-08-18 09:51
by -=anders=-
now THIS is indeed good news!

Re: 1P Animations on PCOs

Posted: 2012-08-18 10:33
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?

Re: 1P Animations on PCOs

Posted: 2012-08-18 11:36
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

Re: 1P Animations on PCOs

Posted: 2012-08-18 13:19
by Arc_Shielder
Throw all your gold to this man! Make him stay!

Re: 1P Animations on PCOs

Posted: 2012-08-18 14:11
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.

Re: 1P Animations on PCOs

Posted: 2012-08-19 04:43
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.

Re: 1P Animations on PCOs

Posted: 2012-08-19 13:17
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 ;-)

Re: 1P Animations on PCOs

Posted: 2012-08-19 18:51
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.

Re: 1P Animations on PCOs

Posted: 2012-08-19 21:55
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

Re: 1P Animations on PCOs

Posted: 2012-08-19 22:09
by richyrich55
Navo wrote:AND 1.0 IS DELAYED ONCE AGAIN
This so much!

Impressive work, Santa!

Re: 1P Animations on PCOs

Posted: 2012-08-28 12:42
by Arab
richyrich55 wrote:This so much!

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

Really Awesome, Fantastic, Beautiful, Great work Santa!