Skip to content
New issue

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

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

Already on GitHub? Sign in to your account

Interaction - Add actions based on animations #6144

Merged
merged 34 commits into from
Aug 11, 2024

Conversation

Dystopian
Copy link
Contributor

@Dystopian Dystopian commented Feb 11, 2018

When merged this pull request will:

  • add animation based actions framework;
  • add Take off action to:
    • backpacks on Offroad and some armored vehicles (since 1.82);
    • spare wheel on Wrangler and Van;
    • spare wheel on RHS AFRF cars (UAZ, Ural, KamAZ, Tigr, GAZ-66, ZIL-131) and BTRs;
    • spare wheel on RHS USF trucks (FMTV and HEMMT);
    • spare tracks on Kamysh and Tigris;
    • fuel canisters on Marid and arty;
    • entrench tool on some armored vehicles (since 1.82);
  • disable RHS AFRF vehicles Retread system (except BTRs which is not so simple).

Some vehicles have animations which could be useful for in-game interaction. At first I thought to add all possible animations like remove doors and some vehicle parts. But then I decided to stop on really useful animations which can give you spare wheel e.g.

Animation based actions Framework allows to use any vehicle animations, which can give some items or not. I tried to make it universal enough but not too overloaded with all possible parameters. It can be easily used in 3rd party mods because it's based on configs and not on code.

Any ideas about other useful animations are welcomed.

If this PR is merged I'll add documentation in another PR.

Also at least CUP has Datsun with animated spare wheel.

Testing missions with modified vehicles:
ace_interaction_anims.VR.zip
ace_interaction_anims_RHS.VR.zip

@jonpas jonpas added kind/feature Release Notes: **ADDED:** status/review-pending labels Feb 11, 2018
@jonpas
Copy link
Member

jonpas commented Feb 11, 2018

Neat!

I think some more API allowing disabling of such actions (a setting maybe) would be good. Additionally also setting items[] array via SQF in addition to config, so mission makers can set different types of eg. backpacks on offroads.

Those animated parts, aren't they just proxies? In that case it should be possible to get their location programmatically maybe?

@Dystopian
Copy link
Contributor Author

I think some more API allowing disabling of such actions (a setting maybe) would be good.

You want settings for each feature :) User can easily disable such actions with switching these anims to disabled state (even in editor via Vehicle Customization). So I don't think another setting is really needed.

Additionally also setting items[] array via SQF in addition to config, so mission makers can set different types of eg. backpacks on offroads.

Can't imagine any real use cases for that. Only some vehicles have working anims and only few of them are really useful. Please don't think I try to avoid additional coding, I just need to know if it worth it.
I didn't add any user API exactly because of that.

Those animated parts, aren't they just proxies? In that case it should be possible to get their location programmatically maybe?

I don't understand about proxies. Some anims have config values source = "Proxy" but I don't know how to use this info. Some vehicles have named selections in appropriate places (Wrangler) and it's much easier; some have them too dislodged (Van) and some don't have any (Offroad) - so you have to use absolute position.

@jonpas
Copy link
Member

jonpas commented Feb 11, 2018

Toggling one setting is a lot faster than disabling animations on all the vehicles.

API is probably not worth it, but I was already seeing possibilities for future, ability to put those items back on trucks and so on. :D

@Dystopian
Copy link
Contributor Author

Dystopian commented Apr 22, 2018

1.82 brought some new animations so I added more backpacks and fuel canisters, spare tracks, entrench tool.
Also now backpacks and items go to WeaponHolder not to own vehicle.

Still not sure about hybrid config entries (which can be string or array) - it's not so good for mods.

@Dystopian
Copy link
Contributor Author

Another time merged with master. Also found a way to disable RHS retread on BTRs.

@Dystopian
Copy link
Contributor Author

Is it a good idea to move anim configs to subfolder because they are independent enough (at least in interaction module)?

@Dystopian
Copy link
Contributor Author

Found CUP anims: Datsun, RG31, UAZ (spare wheel); Land Rover (spare wheels, jerrycans, Entrenching Tool, wire cutter (what?)). Can't start implement them if this PR is not merged.

@jonpas jonpas added this to the 3.14.0 milestone Apr 20, 2021
@jonpas
Copy link
Member

jonpas commented Apr 20, 2021

Still not sure about hybrid config entries (which can be string or array) - it's not so good for mods.

Make it just array, it can be array with one item.

Is it a good idea to move anim configs to subfolder because they are independent enough (at least in interaction module)?

Could do that but you will quickly run into issues with base classes, eg. where multiple files reference same base class, it just goes all over the place.

@PabstMirror PabstMirror added this to the Ongoing milestone Oct 12, 2021
jonpas and others added 4 commits October 13, 2021 01:57
- Made anim setting require a mission restart
- Handle more types of items that can be spawned
- Prioritise adding items to inventory and only drop on ground if no inventory space
- Add more position checks to make certain no valid position are present before stopping
- If 1 item was spawned in, it's considered as success
- Disable RHS' wheel replacement only if ace_repair is loaded
Copy link
Contributor

@johnb432 johnb432 left a comment

Choose a reason for hiding this comment

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

LGTM, but given I've redone some of the code, having another person take a look would be good.

@johnb432 johnb432 modified the milestones: Ongoing, 3.18.0 Jul 20, 2024
@johnb432
Copy link
Contributor

johnb432 commented Aug 9, 2024

Sorry to add this many changes, but I felt they were necessary:

  • Added option to give the progress bar a title
  • Used better names & progress bar titles than the default
  • Added some missing interactions (rhs_kraz255b1_base's spare wheel, 2x base game HEMTTs' spare wheel)
  • Restructured compats, so that interactions load only if the dependencies are there
  • Improved interaction positions on turrets (previously some of them were static and didn't follow the turret, now they do)

@PabstMirror PabstMirror merged commit 96f81f1 into acemod:master Aug 11, 2024
5 checks passed
blake8090 pushed a commit to blake8090/ACE3 that referenced this pull request Aug 18, 2024
* Add actions based on animations

* Add setting

* Add ability to set items for users

* Add actions for 1.82 changes

Add actions for backpacks, canisters, entrench tool.
Move items and backpack to WeaponHolder.

* Add RHS 0.4.6 ZIL spare

* Update to new standards

* Handle RHS BTR retread system

* Make init faster: move condition to configClasses

* Fix CUP fake anims

* Refactor

* Rework

* Rename init function

* Decrease number of classes to init

* Fix merge mistake

* Apply suggestions from code review

* Updated code for current mod structure

* Multiple fixes & tweaks

- Made anim setting require a mission restart
- Handle more types of items that can be spawned
- Prioritise adding items to inventory and only drop on ground if no inventory space
- Add more position checks to make certain no valid position are present before stopping
- If 1 item was spawned in, it's considered as success
- Disable RHS' wheel replacement only if ace_repair is loaded

* Update CfgVehicles.hpp

* cache config lookup at preStart

* Fix error

* Add text config entry for progress bar title

* Restructure interactions, improved some locations & added interaction to some missing vehicles

* Reverted preInit change

---------

Co-authored-by: jonpas <jonpas33@gmail.com>
Co-authored-by: johnb432 <58661205+johnb432@users.noreply.github.com>
Co-authored-by: PabstMirror <pabstmirror@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/feature Release Notes: **ADDED:**
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants