Sorry guys!! This question is so complicated for me that I even don't know how to name the subject for it... I'll try to explain it.
I have 7 wooden crates which the player has to carry from A to B.
There is a trigger around each crate which gives the player the addaction menu "Lift crate". If the player doesn't want to carry it, he just needs to go away from the crate and the option will disappear.
But when then the player selects "Lift crate" from the action menu, the crate is attached to the player and he can move around with it.
He can drop the crate by choosing the action "Drop crate", which always is shown to him while he carries it.
After the crate is dropped, the action "Drop crate" is removed and the trigger which adds action "Lift crate" is setpossed on the crate - this way the player can repeat the whole procedure again if he wants / needs.
The problem begins here: When objects are attached to units, they don't collide with other objects or walls or units, etc. Another unit can pass through the attached crate and also the player can make the carried crate go through another crate.
When this happens though, the shit is not far anymore...
Because: If the player drops a crate "into" another (since there's no "collision check"), the addaction "Lift crate" will get buggy - suddenly I have 2 of them and even if I don't want to carry anything and go away, the action won't disappear!
I'm not quite sure why this happens, and I also made my best to avoid this bug, but I didn't succeed.
So here I am asking for your help for a workaround:
I saw two possibilities so far:
1. Is there a way to "enable" the collision check so that the player can't move crates through other crates / objects / persons?
(Btw. this solution would help me as well on another part of my misison, where the player has to drag an injured one in a castle ruins and since there is no collision check for attached objects / units, the legs and half of his body keep disappearing in the wall of the castle...)2. I would need a script code for the following solution:
When the player wants to drop the crate and it would drop into another one, it doesn't work and a hint appears: "There is no room for the crate right here! Drop it somewhere else!" - the crate stays attached to the player. He has to move a bit away (let's say 1,6m) and drop the crate there.
Well, this is the part, where I'm an absolut N00b...
Maybe this is a first thought on it though:
DropCrate.sqf:
if ((CarriedCrate distance OneOfTheOther6Crates) < 1.6) then
{
hint "This is too close, your crate is floating in one other. There is no room for the crate right here!";
_ExitTheScript_
} else
{
hint "Ok, you're far enough from the other crate(s).";
//And then follows the DropCrate script, the crate is dropped, since there was enough space for it.
};
But I have absolutely no idea how the code for the mentioned "CarriedCrate" and "OneOfTheOther6Crates" would look like...
Can you help me?
To be honest, I really would like to know the solution for both.
Just in case.
Thanks for your patience and your help and especially your time!!