Jump to content
Sign in to follow this  
spitfire007

addAction not working. Even the examples provided in the BIKY.

Recommended Posts

This is driving me nuts. :391:

The addAction menus are not appearing as expected.

I have disabled all addons for testing.

The BIKI example commands https://community.bistudio.com/wiki/addAction that are working are,

player addAction ["A Useless Action", ""];
player addAction ["<t color='#FF0000'>This Useless Action Is RED</t>", ""];
player addAction ["string exec", "hint 'this is also compiled'"];

Not working

player addAction ["Hint Hello!", { hint format ["Hello %1!", _this select 3] }, name player];

myhint = compile preprocessFileLineNumbers "hint.sqf";

No errors in RPT when run as dedicated. (Other than the usual BI undeclared variables on 1.63 server)

Does not work in editor preview either.

None of my commands work.

player addAction [ "Test Hint 1", { myhit }];
player addAction [ "Test Hint 2", { "hint.sqf" }];
player addAction [ "Test Hint 3", { "hint.sqf","" }];

Edited by spitfire007

Share this post


Link to post
Share on other sites

I am a dill. :icon_redface:

The command you need is.

player addAction [ "Test Hint", "hint.sqf"];

Share this post


Link to post
Share on other sites

Just to add - simply providing a string as the 2nd parameter will tell the engine to execVM this script. Providing code (using { }) will tell the engine to run that code.

E.g.

player addAction [ "Test Hint", "hint.sqf"]; 

is the same as:

player addAction [ "Test Hint", {[] execVM "hint.sqf"}];

or

player addAction [ "Test Hint", {hint "My test hint"}];

Share this post


Link to post
Share on other sites

Also, I just noticed a mistake in your 2nd example:

player addAction ["Hint Hello!", { hint format ["Hello %1!", _this select 3] }, name player];

Should be:

player addAction ["Hint Hello!", { hint format ["Hello %1!", name player] };

Edit: Nevermind, I just noticed you were copying this from the BI wiki for the sake of testing.

Edited by Goodson

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  

×