-
Notifications
You must be signed in to change notification settings - Fork 737
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
Cargo - Add unloading of cargo to killed vehicles #10017
base: master
Are you sure you want to change the base?
Conversation
Co-authored-by: PabstMirror <[email protected]>
Would it be worth giving the unloaded cargo some percentage of the velocity of the destroyed vehicle? |
…eh/ACE3 into vehicle-death-unload-cargo
Co-authored-by: PabstMirror <[email protected]>
Converted to draft because |
Co-authored-by: johnb432 <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Imo it might be better to replace Killed
with Destroyed
, but on the other hand it might cause confusion and make people think it also applies when the vehicle is deleted. Thoughts?
Co-authored-by: johnb432 <[email protected]>
I prefer |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Seems to work ok. It's a bit unsettling seeing all the cargo be unloaded at once, but I'm not sure if adding a delay between unloading items would help with that perception.
I like to think of it as the vehicle exploding blowing them all out of it lol it would be nice it was a little smoother, but not sure much can be done about it |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
- Explosion pattern is not random enough imo. Most items are thrown towards the front and rear.
- Torque is applied on the wrong axis when items are fly to the side.
- The larger items in the test script don't move, when I feel they should.
- I'm not sure things such as ammo boxes and fuel canisters should be able to survive, imo ammo boxes should cook off and fuel canister explode/burn.
I used this test script:
_truck = createVehicle ["B_Truck_01_box_F", (getPos player) vectorAdd (player vectorModelToWorld [0, 10, 1]), [], 0, ""];
_objects = [];
{
for "_index" from 1 to (_x select 1) do {
private _object = createVehicle [_x select 0, [0, 0, 0], [], 0, ""];
[_object, _truck, true] call ace_cargo_fnc_loadItem;
_objects pushBack _object;
};
} forEach [["FlexibleTank_01_forest_F", 2], ["ACE_Wheel", 10], ["ACE_Track", 10], ["ACE_Box_82mm_Mo_Combo", 1], ["CargoNet_01_box_F", 1]];
_truck setVelocity [0, 0, 0];
[{
params ["_truck", "_objects"];
(getAssignedCuratorLogic player) addCuratorEditableObjects [_objects, true];
_truck setDamage 1;
}, [_truck, _objects], 1] call CBA_fnc_waitAndExecute;
I'm not sure what you mean by "explosion pattern" the unload position is controlled entirely by the FUNC(unloadItem), and the cargo shouldn't get any velocity unless the vehicle was moving, in which case it's always less than the velocity of the vehicle. I added the torque to just give it a little motion. I'm not sure how to take the direction and velocity of the vehicle and then get torque to be applied in that same direction on the cargo. If you want to add that I'm more than happy to accept it. I don't want to deliberately damage or destroy cargo regardless of contents; there's little point in having it unload just to kill it vs having it be deleted as it was previously doing. |
By "explosion pattern" I meant the objects flying in random directions from the vehicle, regardless of where they are unloaded. Maybe my expectations are wrong: Are the unloaded objects supposed to fly away or remain on the ground and roll/fall over? I initially thought it was the prior, but now I'm guessing you were aiming more towards the latter.
I haven't tested my idea yet, but it would be to wait for the object to be unloaded, then get the vector between the object's center and the vehicle's. That direction vector would be the basis for generating velocity and torque. The vehicle's velocity would then be added to the generated velocity of the object.
For fuel containers I agree, we could kill them inside the vehicle, but I disagree for ammo boxes, as we have |
My work has turned into a shitshow and I won't be able to work on this for a while. |
I've been planning on pushing my suggestion for a while now, finally got around to doing it. Really unfortunate timing, I was hoping you would be able to take a look at the proposed changes soon, but we can easily postpone this PR after 3.18.0.
I also pushed code that would address this in b9531b0. Feedback in general is needed and welcome. |
Yeah, I work with a small team of 5 people and 3 of them have put in their resignations lol |
When merged this pull request will: