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

Towing - Fix some issues #9007

Merged
merged 23 commits into from
Feb 5, 2024

Conversation

Dystopian
Copy link
Contributor

@Dystopian Dystopian commented Aug 21, 2022

When merged this pull request will:

  • add multiple towing;
  • add JIP compatibility;
  • add towing to ships and helicopters;
  • add rope to boats inventory;
  • add hook also to parent;
  • add Detach actions to both towing/towed vehicle;
  • replace hook model with invisible one;
  • fix interaction with dead vehicle;
  • fix immediate rope attachment when click Attach tow rope menu if player is close to vehicle;
  • fix MP issue when rope looks detached on other clients;
  • fix MP issue when you attach rope to non-local vehicle;
  • fix MP issue when one player attaches vehicles and other player tows;
  • fix MP issue when "tow" client is disconnected and rope is broken.

Multiple towing means either several ropes between parent and child or one parent with several children one by one and parallel.

setTowParent is not JIP compatible so I added workaround.

It turned out that ships can tow and can be towed, helicopters can be towed as well (at least those with wheels).

With parent hook rope can be detached from parent too.

Current hook model glows very much. This can be a problem at night when you want to hide vehicles. I didn't find more suitable model and used empty one which is OK. There is \A3\Data_f\Hook\Hook_F.p3d which is good but it could be weird for many vehicles.

ropeAttachTo and ropeDetach commands must be run where parent and rope are local.
setTowParent must be run on all clients.
Current implementation runs Deleted and RopeBreak EHs on client where rope was attached. When client disconnects EHs aren't triggered. The PR fixes it.

@Dystopian Dystopian changed the title WIP: Towing - Fix some issues Towing - Fix some issues Aug 29, 2022
@Dystopian
Copy link
Contributor Author

Ready for review.

I didn't find a way to fix possible rope attachment inside vehicles resulting impossible to detach it. I added parent hook as partial workaround but if anybody knows a better way to fix please tell me.

@Dystopian Dystopian marked this pull request as ready for review August 29, 2022 01:24
@veteran29 veteran29 added the kind/enhancement Release Notes: **IMPROVED:** label Aug 29, 2022
@Dystopian
Copy link
Contributor Author

After #8963 and this PR rope can also be added to boats inventory. I can't really decide if it's needed.

@Dystopian
Copy link
Contributor Author

To fix possible rope attachment inside vehicles resulting impossible to detach it I added Detach actions on each towing/towed vehicle.

I tested towing helicopters with enabled AFM and it works OK as with disabled one. But I disabled towed helicopters because I don't think helicopters have suitable towing points (except landing gear maybe). Naturally this can be discussed.

I added rope to boats inventory because it looks quite appropriate.

/*
* Author: Dystopian
* Attaches child to parent vehicle.
* Run globally.
Copy link
Contributor

@rautamiekka rautamiekka Jun 25, 2023

Choose a reason for hiding this comment

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

Would be much better if the fnc did the 'Run globally' parts for themselves automatically.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Didn't get you. Do you mean I should replace one global event and one function with 3 events and its own functions (1 for parent owner, 1 global setTowParent run and 1 for server)?

Copy link
Contributor

Choose a reason for hiding this comment

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

I mean the script is changed to Must be run on the server and the Server runs it globally, otherwise remoteExeced.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Still can't understand how it could be better to move script executing to server and split 1 global event to 3 events (1 of those is global anyway) and functions. In any case we have to run globally setTowParent part. I don't see any profit from function splitting.

@Andx667
Copy link
Contributor

Andx667 commented Oct 25, 2023

Whats the status on this? We had several Issues in our last OP that would probably all be fixed with this PR.

@Dystopian
Copy link
Contributor Author

Whats the status on this?

This PR is quite large and should be tested well by ACE devs. So we have to wait with patience.

@Dystopian Dystopian mentioned this pull request Nov 4, 2023
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.

I haven't tested it yet, but I will soon.

addons/towing/XEH_postInit.sqf Outdated Show resolved Hide resolved
addons/towing/functions/fnc_attachRopePFH.sqf Outdated Show resolved Hide resolved
addons/towing/functions/fnc_detachChild.sqf Outdated Show resolved Hide resolved
addons/towing/XEH_postInit.sqf Show resolved Hide resolved
addons/towing/functions/fnc_detachRope.sqf Outdated Show resolved Hide resolved
addons/towing/functions/fnc_getDetachActions.sqf Outdated Show resolved Hide resolved
addons/towing/functions/fnc_startTow.sqf Show resolved Hide resolved
addons/towing/functions/fnc_towStateMachinePFH.sqf Outdated Show resolved Hide resolved
addons/towing/functions/fnc_detachRope.sqf Show resolved Hide resolved
addons/towing/functions/fnc_detachRope.sqf Show resolved Hide resolved
addons/towing/XEH_postInit.sqf Show resolved Hide resolved
addons/towing/functions/fnc_detachRope.sqf Outdated Show resolved Hide resolved
addons/towing/functions/fnc_detachRope.sqf Outdated Show resolved Hide resolved
addons/towing/functions/fnc_detachRope.sqf Show resolved Hide resolved
addons/towing/functions/fnc_startTow.sqf Show resolved Hide resolved
@matthawkins2
Copy link

Also hoping to see this PR go through. Towing is completely inop in both singleplayer and multiplayer in 3.16

@matthawkins2 matthawkins2 mentioned this pull request Feb 4, 2024
@LinkIsGrim LinkIsGrim added this to the 3.16.4 milestone Feb 5, 2024
@LinkIsGrim
Copy link
Contributor

🍌

@LinkIsGrim LinkIsGrim merged commit b54992b into acemod:master Feb 5, 2024
5 checks passed
@Dystopian Dystopian deleted the towing-fix-attach-on-click branch February 6, 2024 17:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/enhancement Release Notes: **IMPROVED:**
Projects
None yet
Development

Successfully merging this pull request may close these issues.

8 participants