Jump to content
Sign in to follow this  
wass24

Addaction for player only

Recommended Posts

I've added Addaction commands to several of the units in my mission which displays and conceals their weapon repetitively. The problem I have is that when Man1 approaches Man2, Man2's Addaction commands pop-up. So Man1 could display and conceal Man2's weapon.

Is there a way for the Addaction commands to only be available for the Man2 player to use?

Share this post


Link to post
Share on other sites

That article didn't really fix my problem. Are there any other suggestions?

Share this post


Link to post
Share on other sites

I don't have a quick solution to hiding actions, you can note many addons suffer from the same.

However, you can have it so that only a specific unit can execute the action..

Let's say your addaction command launches action1.sqs. In action1.sqs the first line you'd have is:

?_this select 1 != the_guy_you_want_to_be_able_to_execute_this_particular_action: exit

The above will prevent anyone expect the_guy_you_want_to_be_able_to_execute_this_particular_action from performing the action. smile_o.gif

Still, if you got a bunch of guys close together and you go in the middle of them, you'll have

action

action

action

action

in your action menu, which is not nice. confused_o.gif

Share this post


Link to post
Share on other sites

I don't think that there's a way to prevent this in single player, since everything is local in SP. Maybe you should use some other method to execute those scripts.

Another problem that you should be aware of is that if you're in the area where the action is visible and board a vehicle, that action stays visible even if you leave the area. To counter this you should add something like this in the beginning of the script that the action executes:

?player distance object_that_action_belongs_to > 10 : hint "You are too far away."; exit;

Share this post


Link to post
Share on other sites

actually, that doesn't work all the time. I think, no matter what you do, there will always be a few times when the player sees the action after he enters a vehicle. I've tried adding lots of stuff to remove actions, like check if the player is in a vehicle, and if he is, exit, and in the same script, check the distance to a object, and if it's too far, exit...and more...sometimes it works, sometimes it don't.

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  

×