Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Prop anims with 'eventlock' now remain active if player leaves vehicle (+multiplayer). #2949

Merged
merged 2 commits into from
Oct 11, 2022

Conversation

ohlidalp
Copy link
Member

@ohlidalp ohlidalp commented Oct 10, 2022

Kindly requested from Discord by Flip889#6304 and BRobinson#9257

As a bonus, key-triggered prop animations now propagate over network:
busHeadsUnite

RoRnet was bumped to .44

Even if player exits the vehicle, the animations remain active.

Also the code is now cleaner
 - user inputs are tracked in simulation realm (see `Actor::UpdatePropAnimInputEvents()`) , then recorded to simbuffer
 - gfx realm only applies the states to OGRE (see `GfxActor::UpdatePropAnimations()`).
 - as result, GfxScene::UpdateScene() no longer needs to track which actors are linked to player actor - it's now done in simulation as with all other updates.

Code changes:
* RigDef_File.h: renamed `event` to `event_name` to get rid of VisualStudio highlighting it as keyword, and it's also more specific.
* SimData.h: added `struct PropAnimKeyState` to track user inputs within simulation step, as it should be.
* GfxData.h: removed obsolete fields from `struct PropAnim`.
* Actor.h/cpp: added prop anim keystate array + Update() function.
* ActorSpawner.cpp: when prop animation uses 'event:source', register the keystate with the actor.
* GameContext.cpp: update anim key states for player actor and all connected actors.
* GfxActor.cpp: use simbuffer to fetch anim key states from simulation.
@ohlidalp ohlidalp changed the title Prop anims with 'eventlock' now remain active if player leaves vehicle. Prop anims with 'eventlock' now remain active if player leaves vehicle (+multiplayer). Oct 10, 2022
@ohlidalp ohlidalp requested a review from tritonas00 October 10, 2022 06:36
Copy link
Collaborator

@tritonas00 tritonas00 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Works fine, tested on network also.

@ohlidalp ohlidalp merged commit aed38fd into RigsOfRods:master Oct 11, 2022
@ohlidalp ohlidalp deleted the prop-anims branch October 11, 2022 12:58
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants