Home   Help Search Login Register  

Author Topic: Artilery only used with radio bag.  (Read 2379 times)

0 Members and 1 Guest are viewing this topic.

Offline Grimfist

  • Members
  • *
    • Armaholic
Artilery only used with radio bag.
« on: 23 Feb 2009, 17:31:51 »
i have a co-op mission using 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?
« Last Edit: 24 Feb 2009, 14:55:57 by Grimfist »

Offline laggy

  • Members
  • *
  • "Behold a pale horse"
Re: Artilery only used with radio bag.
« Reply #1 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
« Last Edit: 26 Feb 2009, 21:55:07 by laggy »
And I looked and beheld a pale horse and his name that sat on him was Death and Hell followed with him.

Offline SnowSky

  • Members
  • *
Re: Artilery only used with radio bag.
« Reply #2 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^^

Offline Grimfist

  • Members
  • *
    • Armaholic
Re: Artilery only used with radio bag.
« Reply #3 on: 27 Feb 2009, 17:35:30 »
TY guys but i don't understand that well what u mean.

Offline laggy

  • Members
  • *
  • "Behold a pale horse"
Re: Artilery only used with radio bag.
« Reply #4 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
And I looked and beheld a pale horse and his name that sat on him was Death and Hell followed with him.

Offline Grimfist

  • Members
  • *
    • Armaholic
Re: Artilery only used with radio bag.
« Reply #5 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?

Offline SnowSky

  • Members
  • *
Re: Artilery only used with radio bag.
« Reply #6 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

Offline laggy

  • Members
  • *
  • "Behold a pale horse"
Re: Artilery only used with radio bag.
« Reply #7 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
« Last Edit: 28 Feb 2009, 14:36:02 by laggy »
And I looked and beheld a pale horse and his name that sat on him was Death and Hell followed with him.

Offline Grimfist

  • Members
  • *
    • Armaholic
Re: Artilery only used with radio bag.
« Reply #8 on: 28 Feb 2009, 18:06:24 »
ty guys - ill try this out