Jump to content
sic-disaster

Can you enable a player to place sandbags during a mission?

Recommended Posts

I'm working on a defense mission, and I would really like to enable the player to place his own (limited amount of) fortifications like sandbag walls, objects to block vehicle movement etc.

I remember this type of mission from a Red Hammer campaign and always loved it, so I wanted to recreate something similar. Is it possible in ArmA 3?

Share this post


Link to post
Share on other sites

Interesting. Wonder if there are any other ways too, as this looks a bit too complicated for what I have in mind.

Share this post


Link to post
Share on other sites

Maybe just adding an action to the sandbags that attaches it to the player, forcing walk and putting them into an animation.

Share this post


Link to post
Share on other sites

Hi. Maybe something like this can give you some ideas.

SiC_fnc_placeSandBag = {
_sandBag = createVehicle ["Land_BagFence_Round_F",(_this select 1) modelToWorld [0,2,0], [], 0, "CAN_COLLIDE"];
_sandBag setDir getDir (_this select 1) - 180;
(_this select 1) removeAction (_this select 2);
_id = _sandBag addAction ["Remove Sandbag", {call SiC_fnc_removeSandBag}]; 
};

SiC_fnc_removeSandBag = {
deleteVehicle (_this select 0);
_id = (_this select 1) addAction ["Place Sandbag", {call SiC_fnc_placeSandBag}];
};

_id = player addAction ["Place Sandbag", {call SiC_fnc_placeSandBag}];

Edited by Iceman77

Share this post


Link to post
Share on other sites

iceman where did you find that script ?? i would like to get a look at the complete script, if it is possible. ?

Share this post


Link to post
Share on other sites
iceman where did you find that script ?? i would like to get a look at the complete script, if it is possible. ?

Hi. I wrote it after reading the original post. There is no additional code.

Share this post


Link to post
Share on other sites

aha okej ;) i thought you found it somewhere :) someday i will be able to pull of functions freestyling like that to :)

Share this post


Link to post
Share on other sites
Hi. Maybe something like this can give you some ideas.

SiC_fnc_placeSandBag = {
_sandBag = createVehicle ["Land_BagFence_Round_F",(_this select 1) modelToWorld [0,2,0], [], 0, "CAN_COLLIDE"];
_sandBag setDir getDir (_this select 1) - 180;
(_this select 1) removeAction (_this select 2);
_id = _sandBag addAction ["Remove Sandbag", {call SiC_fnc_removeSandBag}]; 
};

SiC_fnc_removeSandBag = {
deleteVehicle (_this select 0);
_id = (_this select 1) addAction ["Place Sandbag", {call SiC_fnc_placeSandBag}];
};

_id = player addAction ["Place Sandbag", {call SiC_fnc_placeSandBag}];

Thanks Iceman! How would I go about implementing this? I assume I need to copy that into an .sqf file and call for it in a unit init line?

Share this post


Link to post
Share on other sites

Yea that's great, I just loaded it up instead of using it in the init.sqf I put It in a separate file and called it from an engineer. But to no avail for what I was trying to do. I want it so only the engineer class can use it I assume I have to edit the script to change it.

Thanks for the great codE!!!

Edit - Sorry being really stupid - Changed - player to engineer instead and got it to work exact!!!!!

Edited by ricko3

Share this post


Link to post
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now

×