Jump to content
Sign in to follow this  
D. Patterson

Disable movement, unless significant force is applied?

Recommended Posts

I was wondering how to disable a vehicles movement, unless a certain amount of damage is done to it in an impact.

Share this post


Link to post
Share on other sites

while {true} do {

if (_vehicle damage < 0.5) then {

//disable move

} else {

//enable move

};

sleep 1;

};

Or use a "Hit" event handler with a check on damage.

Share this post


Link to post
Share on other sites

What commands would I use for enabling and disabling movement? This is going to be used on boats, cause I dont want them to float away.

Share this post


Link to post
Share on other sites
What commands would I use for enabling and disabling movement? This is going to be used on boats, cause I dont want them to float away.

disableAI, but this only works for voluntary movement by the AI. Since they are boats, they are able to float away if they get rammed into or something similar. In this case, it may be easier to constantly spam setVelocity until something happens.

_noVelocity = [] spawn
{
while {true} do
{
	setVelocity [0,0,0];
};
};

waitUntil {YOUR_CONDITION_HERE};
terminate _noVelocity;

Share this post


Link to post
Share on other sites

This all looks like unnecessary hassle to me.

There's a physics rope in the game. Anchor it or moor it to something.

anchor.jpg

Share this post


Link to post
Share on other sites
This all looks like unnecessary hassle to me.

There's a physics rope in the game. Anchor it or moor it to something.

I've never had a picture cause so many questions in my head...

What's the classname for this?

How do I anchor it?

Is it really physics-enabled?

Share this post


Link to post
Share on other sites

Also dreadedentity you have to wait until 4th nov for the ropes to in stable

Share this post


Link to post
Share on other sites

I can't be too long as we've got spooky people round for Hallowe'en, but yes the rope does all sorts of physics things.

Make one like this:

_spookyRope = ropeCreate [_boatName,[0,1.8,-0.9],_anchorObject,[0,0,0],10];

So you have an addAction (anchor boat) - then depending how you want to do it, search for somewhere to anchor, or maybe spawn an ob on the sea floor if it's less than say 10m deep.

Then run that code up there ^ and it will attach the boat.

Then remove that action and add another to cut the rope.

Have a good one tonight! :m::m::m::m::m:

Share this post


Link to post
Share on other sites

you can try:

_vehicle forceSpeed 0;

And to change it back to normal via:

_vehicle forceSpeed (0 - 1);

A quick test in ARMA 3 with a trigger seems to indicate that the boat stops. I didn't do extensive testing though.

This will not help if the boat is floating away due to any physics etc. I only recently got a rig that can run this game so I don't know what physics have been coded in with water (ie: currents etc).

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
Sign in to follow this  

×