506th IR Realism Unit

Recruiting => The Duty Desk => Topic started by: VandeVord on January 30, 2015, 02:37:15 PM

Title: Mission Making Help
Post by: VandeVord on January 30, 2015, 02:37:15 PM
I'm trying to add specific text in an ammobox's scroll wheel menu. For example so I can insert a message or grid coords to assist in the mission.

Anyone know how to do this?
Title: Re: Mission Making Help
Post by: SPC (Ret) Harrison on January 30, 2015, 02:48:53 PM
Yeah. Make a script in the mission that does an addaction to display a hint with whatever you need in it. More here: https://community.bistudio.com/wiki/addAction . Then just call the script in the init of the box.
Title: Re: Mission Making Help
Post by: CW2 (Ret) Leshock on January 30, 2015, 02:59:40 PM
I think he would have locality issues if he used hint in the init field of the box, wouldn't he?
Title: Re: Mission Making Help
Post by: SPC (Ret) Harrison on January 30, 2015, 03:04:43 PM
I think he would have locality issues if he used hint in the init field of the box, wouldn't he?
Which is the reason I said to put it in a script. It should be called globally that way, I believe.
Title: Re: Mission Making Help
Post by: Genesi on January 30, 2015, 03:21:20 PM
I think he would have locality issues if he used hint in the init field of the box, wouldn't he?
Which is the reason I said to put it in a script. It should be called globally that way, I believe.

AddActions are not global. they are client side. addActions have to be executed on every client.(If you want Everyone to be able to use it.) If im understanding what he is trying to do.

Use this function to add Action on every client

Code: [Select]
Fock_addactionMP =
{
private["_object","_screenMsg","_scriptToCall"];
_object = _this select 0;
_screenMsg = _this select 1;
_scriptToCall = _this select 2;

if(isNull _object) exitWith {};

_object addaction [_screenMsg,_scriptToCall];
};

Call the function like this.
Code: [Select]
[["Object or player here","<t color='#FF0000'>OnScreen Text</t>","Script you want to call here"],"Fock_addactionMP",nil,false] spawn BIS_fnc_MP;
Title: Re: Mission Making Help
Post by: CW2 (Ret) Leshock on January 30, 2015, 03:27:24 PM
I don't think that's right.  Both hint and addaction have local effect.  I believe the called script by addaction is only executed on the client of the player using the action.

EDIT: This message was in response to CPL Harrison.  WO1 Genesi sounds like he is on the right track but I can't test this right now.
Title: Re: Mission Making Help
Post by: SPC (Ret) Harrison on January 30, 2015, 03:28:26 PM
I don't think that's right.  Both hint and addaction have local effect.  I believe the called script by addaction is only executed on the client of the player using the action.
Ah, see, that's what I thought he wanted. I must've misunderstood what he was saying. Also, I just remembered that ARMA 3's localization is different than ARMA 2's, and I haven't done much scripting in A3.
Title: Re: Mission Making Help
Post by: SSG (Ret) Atkinson on January 30, 2015, 03:36:25 PM
You want to add grid coords to the text of the scroll menu or you want to display grid coords when you use the action?
Title: Re: Mission Making Help
Post by: VandeVord on January 30, 2015, 05:26:19 PM
You want to add grid coords to the text of the scroll menu or you want to display grid coords when you use the action?
I want to add grid coords to the text of the scroll menu, where you'd see inventory or arsenal, it would also have a writing with grids that when clicked doesnt do anything. I'm building a land nav thing.
Title: Re: Mission Making Help
Post by: SFC (Ret) Otto on January 30, 2015, 05:31:55 PM
You could make an image with the grid coords and then put it as the texture on a sign. I know Arma says you need to convert to .paa but .jpg works just fine.
Title: Re: Mission Making Help
Post by: VandeVord on January 30, 2015, 06:33:20 PM
You could make an image with the grid coords and then put it as the texture on a sign. I know Arma says you need to convert to .paa but .jpg works just fine.
I'd prefer not to do that since I want them to actual work to find the locations and not just spot a sign at 500m.
Title: Re: Mission Making Help
Post by: CW2 (Ret) Leshock on January 30, 2015, 07:32:13 PM
I think I have something that would work.  Put this in the init box for the object you want the players to find:

Code: [Select]
this addAction ["<t color='#FFFF00'>Show Position</t>", { hint format ["Your coordinates are %1!", _this select 3] }, mapGridPosition this];
Tested this on a dedicated server with success.
Title: Re: Mission Making Help
Post by: SSG (Ret) Atkinson on January 30, 2015, 08:01:12 PM
I'm not sure how strings in sqf work off the top of my head, but you could getPos the grids of the box, store/convert them to a string, and then use them in the addAction.
Title: Re: Mission Making Help
Post by: VandeVord on January 30, 2015, 08:25:51 PM
I'm gonna test these ideas tomorrow, thanks guys.
Title: Re: Mission Making Help
Post by: VandeVord on January 31, 2015, 11:55:24 AM
I think I have something that would work.  Put this in the init box for the object you want the players to find:

Code: [Select]
this addAction ["<t color='#FFFF00'>Show Position</t>", { hint format ["Your coordinates are %1!", _this select 3] }, mapGridPosition this];
Tested this on a dedicated server with success.
Works beautifully! Thank you very much Leshock.
Title: Re: Mission Making Help
Post by: VandeVord on January 31, 2015, 02:20:24 PM
Does anyone know what the classname for our infantry uniforms are?

None of these work on this page.
http://doc.rhsmods.org/index.php/USAF_Uniforms
Title: Re: Mission Making Help
Post by: VandeVord on January 31, 2015, 02:37:17 PM
Does anyone know what the classname for our infantry uniforms are?

None of these work on this page.
http://doc.rhsmods.org/index.php/USAF_Uniforms
Disregard.