OFPEC Forum

Editors Depot - Mission Editing and Scripting => ArmA - Editing/Scripting Multiplayer => Topic started by: Grimfist on 23 Feb 2009, 17:31:51

Title: Artilery only used with radio bag.
Post by: Grimfist on 23 Feb 2009, 17:31:51
i have a co-op mission using http://www.armaholic.com/page.php?id=2540 (http://www.armaholic.com/page.php?id=2540) winters realistic arty script, it uses the in game radio to call in different strikes, i would like to create a script that disables the radio if the player is not wearing a ACE radio bag. or disables the arty script on that player. i think the new domination does this so i had a look but i couldnt fint it. ty.

i think it something to do with 'enableradio true'

any ideas plz?
Title: Re: Artilery only used with radio bag.
Post by: laggy on 26 Feb 2009, 21:49:39
Have you tried BAS mods old OFP solution?

Trigger:
Repetedly.
Condition: player hasWeapon "ACE radio bag"
OnActivation: useradio = player addaction ["Call in Artillery", "artScript.sqs"]
OnDeActivation: player removeaction useradio

Then in artScript.sqs you put whatever solution or effect you want.

OR:

Radio Alpha trigger with wanted effect for your script (i.e [] exec "artillery.sqs").
initialize: 1 setradioMsg "Null"

then:

Trigger:
Repetedly.
Condition: player hasWeapon "ACE radio bag"
OnActivation: 1 setRadioMsg "Call in artillery"
OnDeActivation: 1 setradioMsg "Null"

Just make sure you have the correct weapon name for "ACE radio bag", I have no idea what it is.

Laggy
Title: Re: Artilery only used with radio bag.
Post by: SnowSky on 26 Feb 2009, 21:49:52
Hi.
I'm actually not a verry experienced scriptwriter, but I think there are some possibilities getting this radiobag doing his Job:
you could try to modificate the config of those radiobags so that they get an own Actionmenu (like for example the Nightvision got the "automatic Adjust NV". This script could call a DisplayDialogControl which could call the script.
Another way to a solution could be a small script which looks every second if player has a Radiobag. example:

Code: [Select]
_gotAlreadyAction = false;
_actionNumber = -1;

while {true} do
{
  if (player hasWeapon "RadioBagName1" || player hasWeapon "RadioBagName2" || and so on) then
  {
    if (!_gotAlreadyAction) then
    {
      _actionNumber = player addAction["Use Radio", "radioScript.sq*"];
      _gotAlreadyAction = true;
    };
  } else {
    if (_gotAlreadyAction) then
    {
      player removeAction _actionNumber; //or what so ever the actionnumber is
      _gotAlreadyAction = false;
    };
  };
  sleep 0.25;
};

I think this should work - didn't test it and wasn't watching how many Radiobags ACE has implemented, or how their names are, but theoretically - this should work.

uhh - seems that Laggy had a better Idea^^
Title: Re: Artilery only used with radio bag.
Post by: Grimfist on 27 Feb 2009, 17:35:30
TY guys but i don't understand that well what u mean.
Title: Re: Artilery only used with radio bag.
Post by: laggy on 27 Feb 2009, 18:34:56
Solution 1:

Place a trigger in the mission editor.
Set it to Repetedly activation.
Condition: player hasWeapon "ACE radio bag"
OnActivation: useradio = player addaction ["Call in Artillery", "GrimfistsFavouriteArtilleryScript.sqs"]
OnDeActivation: player removeaction useradio

Then in GrimfistsFavouriteArtilleryScript.sqs you put whatever solution or effect you want.

Solution 2:

Initialize: 1 setradioMsg "Null".
This means in any units init line or in init.sqs write simply: 1 setradioMsg "Null"

Place a Radio Alpha trigger in the mission editor.
Set it to Repetedly activation.
OnActivation: [] exec "GrimfistsFavouriteArtilleryScript.sqs"

Place a second trigger in the mission editor.
Set it to Repetedly activation.
Condition: player hasWeapon "ACE radio bag"
OnActivation: 1 setRadioMsg "Call in artillery"
OnDeActivation: 1 setradioMsg "Null"

Just make sure you have the correct weapon class name for "ACE radio bag", I have no idea what it is.
Every weapon in ArmA has a class name which is the name that makes ArmA recognize the weapon as an existing object, and allows you to create a weapon in thin air. For example, The AK74 with grenade launcher has the class name "AK74GL".

Laggy
Title: Re: Artilery only used with radio bag.
Post by: Grimfist on 28 Feb 2009, 14:09:34
is there any way to disable the radio on the map screen to all but 1 player (not leader) in MP?
Title: Re: Artilery only used with radio bag.
Post by: SnowSky on 28 Feb 2009, 14:27:54
is there any way to disable the radio on the map screen to all but 1 player (not leader) in MP?
showRadio false could be what you're searching for, but I didn't use it till yet so I don't know how this would work in MP, but maybe this is also just the Dialog we can see in the lower left corner if a unit reports something.
The Link: http://community.bistudio.com/wiki/showRadio
Title: Re: Artilery only used with radio bag.
Post by: laggy on 28 Feb 2009, 14:32:53
To hide the actual radio model in map mode? Not sure.

I would try:

Decription.ext
Code: [Select]
showRadio=0;

For the second trigger in the mission editor.
Set it to Repetedly activation.
Condition: player hasWeapon "ACE radio bag" AND leader player == player
OnActivation: showRadio=1; 1 setRadioMsg "Call in artillery"
OnDeActivation: showRadio=0; 1 setradioMsg "Null"

The correct command to use might be showRadio false and showRadio true instead of the =1 or =0
Title: Re: Artilery only used with radio bag.
Post by: Grimfist on 28 Feb 2009, 18:06:24
ty guys - ill try this out