Jump to content
Sign in to follow this  
blackgrain

Help!! why addAction shows the acction!??

Recommended Posts

Hello!! I need help!!! notworthy.gif

I spend a lot of hours to try make it... but makes me impossible...

The problem is in: addaction

http://community.bistudio.com/wiki/addAction

In the parameter showWindow

In wiki read:

<table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">

showWindow: Boolean - If set True; players see "Titletext". At mid-lower screen, as they approach the object. False turns it off.

But... it not work... I always set this param to FALSE and not works... If I attach a action to one player.. anothers players can see the action when approach to him...

How can I hide the acction to another players?? banghead.gif

Thanks!! thanks!!

Share this post


Link to post
Share on other sites
You took the wrong approach.

Check this thread for a way to solve your problem:

Limit addaction for one player only

Thanks Balschoiw ... but this is not a solution for me... I have not the problem of the DaChevs post (http://www.flashpoint1985.com/cgi-bin/ikonboard311/ikonboard.cgi?act=ST;f=71;t=72640).. . I have other poblem... excuse me for my bad english... I not explained my self...

The problem is not assign one addaction to especific player (player1 for example)... the problem is that another players (player2, player3...) can see the acction attach to player1 when approach to him...

The authentic problem is that showWindow parameter don´t work for me... confused_o.gif

<table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">

showWindow: Boolean - If set True; players see "Titletext". At mid-lower screen, as they approach the object. False turns it off.

Any ideas?... thanks!!! notworthy.gif

Share this post


Link to post
Share on other sites

You need to go to configs for that.

<table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE"> class UserActions

{

class OpenDoors

{

displayNameDefault = "$STR_DN_OUT_O_DOOR_DEFAULT";

displayName = "$STR_DN_OUT_O_DOOR";

position = "osa_dvere1";

radius = 2.5;

onlyForPlayer = 1;

condition = "this animationPhase ""Dvere1"" < 0.5";

statement = "this animate [""Dvere1"", 1]";

};

In the condition you can make the correct check.

Share this post


Link to post
Share on other sites

No, showWindow is only the text that you see in the middle down below of your screen.  With the boolean set to true or false, you will always still get the action in the action menu, right down below.

This is also the reason why other players get the action.

Balschiow is right, your problem is that you add the action to the specific player, on every computer. The addAction command is a local command. Which means that if you execute it only on 1 computer, and not on all of them, then it will work as you intended.

you can do this by adding a local check. E.g if the unit object is called: p1

then when you execute:

if (local p1) then { p1 addAction [balblablalbalblablalbalba] };

Then the new action will only show up on the computer of P1.

And not on other player's computers.

And that's exactly what you wanted.

Share this post


Link to post
Share on other sites

G'day' If you mean that other players are seeing "Your addAction text"? you could try somthing like this in a script,

addaction script (.sqf);

<table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">//_target = _this select 0; // action param

_caller = _this select 1;

//id = _this select 2; // action param

if (_caller != player) exitWith {};

titleText["It smells like Elder Berries", "PLAIN DOWN"];

_my_dialog_Action = myObject addaction ["Myaddaction", "myscript.sqs",[],-1, false, false, ""];

you can change "myscipt.sqs" to .sqf without the need for execVM

GL

Odin

Share this post


Link to post
Share on other sites

Thanks for all guys!! wink_o.gif thanks very much!!

May be my problem is that I assign addaction with setVehicleInit and processInitCommands ... then I think... If I use setVehicleInit make this addaction GLOBAL!!... I´m fool!! banghead.gif

This is my code execute ONLY for the server machine in a dedicated server.

<table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">

_unit_to_add_action setVehicleInit "this addAction [""Action Visible for all!!"", ""something.sqf"","""",0,false,false,""""];";

processInitCommands;

clearVehicleInit _unit_to_add_action;

Really... I must do:

<table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">

_unit_to_add_action addAction ["Action Visible for all!!", "something.sqf","",0,false,false,""];

I'm right??

But... now.. I have another question... (I'm not seat on my development computer tounge2.gif ).. If this code executed ONLY on the server machine... the cliente machine of "_unit_to_add_action" really get the addAction??... or I have to do something for client machine execute locally this code?

Thanks!! this forum is really usefull!! biggrin_o.gif

Share this post


Link to post
Share on other sites

_unit_to_add_action setVehicleInit "if (local this) then { this addAction [""Action Visible for all!!"", ""something.sqf"","""",0,false,false,""&

quot;"];}";

Share this post


Link to post
Share on other sites
_unit_to_add_action setVehicleInit "if (local this) then { this addAction [""Action Visible for all!!"", ""something.sqf"","""",0,false,false,""&

amp;

amp;

amp;

amp;

amp;

quot;"];}";

Yeah!!! now I see!!! sure!!!! this will work!! I will try this afternoon!

Wow Sickboy!! you are fast!!!! and good!! tounge2.gif

Thanks all!! wink_o.gif

********** EDIT *************

Well... yesterday I try it... and.. not work !! tounge2.gif ... but If I associate a sqf to the init field .. YES WORK!! wink_o.gif

<table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">

_unit_to_add_action setVehicleInit "nil = [this] execVM ""add_action_sqf""";

And in add_action_sqf

<table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">

_unit = _this select 0;

if(local _unit) then

{

_unit addAction ["Action Only visible for me!!", "something.sqf","",0,false,false,"];

};

Works fine! wink_o.gif

Thanks guys!! thanks!! notworthy.gif

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  

×