Author Topic: Mission Making Help  (Read 8744 times)

VandeVord

  • Posts: 401
Mission Making Help
« 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?

SPC (Ret) Harrison

  • 11B Infantryman
  • Retired
  • Posts: 616
Re: Mission Making Help
« Reply #1 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.
N. HARRISON
SPC, USA
Retired


CW2 (Ret) Leshock

  • 153A Rotary Wing Aviator
  • Retired
  • Posts: 290
Re: Mission Making Help
« Reply #2 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?
J. LESHOCK
CW2, USAF
Retired


SPC (Ret) Harrison

  • 11B Infantryman
  • Retired
  • Posts: 616
Re: Mission Making Help
« Reply #3 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.
N. HARRISON
SPC, USA
Retired


Genesi

  • Posts: 64
Re: Mission Making Help
« Reply #4 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;
« Last Edit: January 30, 2015, 03:29:16 PM by WO1 Genesi »

CW2 (Ret) Leshock

  • 153A Rotary Wing Aviator
  • Retired
  • Posts: 290
Re: Mission Making Help
« Reply #5 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.
« Last Edit: January 30, 2015, 03:29:03 PM by WO1 Leshock »
J. LESHOCK
CW2, USAF
Retired


SPC (Ret) Harrison

  • 11B Infantryman
  • Retired
  • Posts: 616
Re: Mission Making Help
« Reply #6 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.
« Last Edit: January 30, 2015, 03:31:20 PM by CPL Harrison »
N. HARRISON
SPC, USA
Retired


SSG (Ret) Atkinson

  • 68W3O Health Care Specialist
  • Retired
  • Posts: 277
Re: Mission Making Help
« Reply #7 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?
N. ATKINSON
SSG, USA
Retired


VandeVord

  • Posts: 401
Re: Mission Making Help
« Reply #8 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.

SFC (Ret) Otto

  • 11B4O Infantryman
  • Retired
  • Posts: 196
Re: Mission Making Help
« Reply #9 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.
W. OTTO
SFC, USA
Retired


VandeVord

  • Posts: 401
Re: Mission Making Help
« Reply #10 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.

CW2 (Ret) Leshock

  • 153A Rotary Wing Aviator
  • Retired
  • Posts: 290
Re: Mission Making Help
« Reply #11 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.
« Last Edit: January 30, 2015, 07:53:17 PM by WO1 Leshock »
J. LESHOCK
CW2, USAF
Retired


SSG (Ret) Atkinson

  • 68W3O Health Care Specialist
  • Retired
  • Posts: 277
Re: Mission Making Help
« Reply #12 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.
N. ATKINSON
SSG, USA
Retired


VandeVord

  • Posts: 401
Re: Mission Making Help
« Reply #13 on: January 30, 2015, 08:25:51 PM »
I'm gonna test these ideas tomorrow, thanks guys.
« Last Edit: January 31, 2015, 09:36:10 AM by SGT VandeVord »

VandeVord

  • Posts: 401
Re: Mission Making Help
« Reply #14 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.