Page MenuHomeFeedback Tracker

[CLOSABLE] New "addAction" command needed for manually settable "actionUID"
Closed, ResolvedPublic

Description

Say I'm adding some actions ["a", "b", "c", "d"] manually (hardcoded), I know the indexes by the order of addition. But if I add action "e" and "f" by two different triggers, there's no way to find out the index of these actions if I wanted to remove one of them again, unless I save them to variables. But saving every action index to an own variable is in many ways a lot of effort if you have a big mission with a lot of "addAction" statements.

So therefore it might be very useful to operate with either manually settable indexes or <b>"actionUIDs"</b>, just as the variable name used by the command "getVariable". Currently, the workaround would be an array with custom "actionUIDs":

<i>
customActionUIDs = [];
customActionUIDs set [player addAction ["Custom Action", {hint "hello, world";}], "myCustomUID"];
player removeAction (customActionUIDs find "myCustomUID");
customActionUIDs set [customActionUIDs find "myCustomUID", nil];
</i>

This works, but it's three long lines instead of just one, plus if you forget to remove the UID it from your UID array at just one position, your whole addAction system is screwed, so it's a very unstable system. Sure you can put it in a function, but the problem remains. If you forget to call your function at just one point, you're f**ked.

An SQF command (call it <i><b>"addActionUID"</b></i> if you will), where you can set the identifier yourself without a workaround:

<i>
actionUID = object addActionUID action //actionUID should be of type STRING
object removeActionUID actionUID
</i>

This would be safer and way more comfortable. And it should be able to work alongside the default "addAction" command as "addActionUID" could stores and connect UID and index internally.

I'd be very glad if you considered this request.

Best regards,
Johnny

Details

Legacy ID
3834022982
Severity
None
Resolution
Not A Bug
Reproducibility
Have Not Tried
Category
Scripting
Additional Information

This ticket may be closed as a reasonable answer made it sort of obsolete.

Event Timeline

HereisJohnny edited Additional Information. (Show Details)
HereisJohnny set Category to Scripting.
HereisJohnny set Reproducibility to Have Not Tried.
HereisJohnny set Severity to None.
HereisJohnny set Resolution to Not A Bug.
HereisJohnny set Legacy ID to 3834022982.May 7 2016, 7:21 PM

I don't think this is needed. Here is a better readable version of what you posted.

<pre>
thing setVariable ["TAG_myAction", thing addAction ["Stuff", "stuff.sqf"]];
// ...
thing removeAction (thing getVariable ["TAG_myAction", -1]);
</pre>

Well ... but ... fuck. XD

Alright, nevermind. Close this thing.

Closing as requested.