Jump to content
Sign in to follow this  
lethal

addaction without calling script?

Recommended Posts

I'm trying to add a few debug actions to the player while building and testing my mission - they are mostly single-line commands and hardly worth making a seperate file for every one of them. Can i use addaction without calling an external script but entering code directly somehow? i have searched the biki and tried a few variations but haven't been successful, yet.

Share this post


Link to post
Share on other sites

Make a single Script which calls your single line:

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

and in addAction:

<table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">_code = {hint "Debug"}; //put your code in the brackets

unit addAction ["Debug", "DebugAction.sqf", _code, 0, false, false, ""]

Not tested.

Share this post


Link to post
Share on other sites

thanks! gonna try that out tomorrow smile_o.gif

does the "_code" part have to be in string format or can i write code with the "{}" brackets?

Share this post


Link to post
Share on other sites

_code = {} have to be in brackets. But I forget that arguments have to be passed as string either that way <table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">unit addAction ["Debug", "DebugAction.sqf", "_code", 0, false, false, ""]

or maybe that way <table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">unit addAction ["Debug", "DebugAction.sqf", str(_code), 0, false, false, ""]

You have to test which one is working.

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  

×