Jump to content
🛡️FORUMS ARE IN READ-ONLY MODE Read more... ×
Sign in to follow this  
McArcher

Action added by addAction

Recommended Posts

When I add an action to a player with addAction, it shows the text on the screen, at the center of screen. I need to press backspace twice to hide this action in game. How can I make this action stay in the list and not appear at the screen after adding it?

Share this post


Link to post
Share on other sites

What action? Addaction does not output a text in the center of the screen by default, it simply adds it to the action menu. If you use unit addAction ["text","scriptfile.sqf",[]] you're getting the text in the center of the screen from the script.

Share this post


Link to post
Share on other sites

Hi McArcher

I added for eg. a repeated save game to the action menu so the player can save the game by using the action menu.

I use following code:

Player addaction ["save", "savegame.sqs"]

Now it will show "save" in the middle of the screen. If you want to remove the writing in the center use this

Player addaction [" ", "savegame.sqs"]

leave the first string argument empty and you won't see any messages appearing anymore.

kind regards

nettrucker:D

Share this post


Link to post
Share on other sites

hi, nettrucker

so, I can simply add another action without script and with " " name (to "hide" text) ? :) I have thought about that. Nice idea :) Thanx.

Player addaction [" ", ""]

is that possible?

---------- Post added at 15:24 ---------- Previous post was at 15:23 ----------

btw, I remember the same thing in crCTI or MFCTI.... I saw empty line in actions menu and thought what for did they do that , lol :D

---------- Post added at 15:26 ---------- Previous post was at 15:24 ----------

What action? Addaction does not output a text in the center of the screen by default, it simply adds it to the action menu. If you use unit addAction ["text","scriptfile.sqf",[]] you're getting the text in the center of the screen from the script.

unfortunately it DOES show the text of the action at the center of screen :D lol

Share this post


Link to post
Share on other sites
The solution was much easier, you told!

Number = unitName addAction [title, filename, (arguments, priority, showWindow, hideOnUse, shortcut, condition)]

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

showWindow must be false and that's all ! :)

So how would I use this?

If I have this in a civilian unit's init line:

Player addaction ["Talk to Informant", "Informant.sqf"]

How would I incorporate what you have posted above? Do I put it in Informant.sqf and what would it look like? I need the "Talk to Informant" action to be removed from the menu.

I also tried this in the Informant.sqf:

player removeAction 0

but this doesn't remove the action either. Thought it did for some reason.

I'm still trying to learn what the BIKI means.

Edited by Manzilla

Share this post


Link to post
Share on other sites

Player addaction ["Talk to Informant", "Informant.sqf"]

Informant.sqf:

_player = _this select 0;
_action = _this select 2;

_player removeAction _action;

This is the correct way of doing this.

If you add a action then the action ID will be increased by +1 every time you add a action.

So for example after adding a action 3 times you can not use "player removeAction 0" becouse the current action already has the index 3.

By saving the action to a variable like i did in the example you always will remove the correct action index.

Share this post


Link to post
Share on other sites

How do I get one symbol on screen, but a nice text line in the scroll menu?

For example, when I go near a vehicle, the steering wheel icon pops up on the screen, but the corresponding menu item says "get in as driver".

I want to do similar for healing at an MHQ. I have the script ready to go, but can't tidy up the addaction it looks as I want.

Share this post


Link to post
Share on other sites
Sign in to follow this  

×