Forum Jump : FORUMS Editing / Addon editing Editing / Mission editing Editing / Scripting Editing / Addon editing / Armed Assault Editing / Addon editing / Arma 2 / Arma 2: Operation Arrowhead Editing / Addon editing / Arma 3 Editing / Mission editing / Armed Assault Editing / Mission editing / Arma 2 / Arma 2: Operation Arrowhead Editing / Mission editing / Arma 3 Editing / Scripting / Armed Assault Editing / Scripting / Arma 2 / Arma 2: Operation Arrowhead Editing / Scripting / Arma 3 Arma 3 / General Discussion Arma 3 / Troubleshooting Arma 3 / Addons and Mods: Complete Arma 3 / Addons and Mods Arma 3 / Missions: Complete Arma 3 / Missions WIP Arma 3 / Addons and Mods: Complete / Islands Arma 3 / Addons and Mods: Complete / Modules Arma 3 / Addons and Mods: Complete / Sounds Arma 3 / Addons and Mods: Complete / Units Arma 3 / Addons and Mods: Complete / Vehicles Arma 3 / Addons and Mods: Complete / Weapons Arma 3 / Addons and Mods: Complete / Other Arma 3 / Addons and Mods: Complete / Gear Arma 3 / Addons and Mods / Addons and Mods: WIP Arma 3 / Addons and Mods / Addon requests Arma 3 / Missions: Complete / Multiplayer missions Arma 3 / Missions: Complete / Singleplayer missions Operation Arrowhead / General Discussion Operation Arrowhead / Troubleshooting Operation Arrowhead / Addons and Mods: Complete Operation Arrowhead / Addons and Mods Operation Arrowhead / Missions: Complete Operation Arrowhead / Missions WIP Operation Arrowhead / Addons and Mods: Complete / Islands Operation Arrowhead / Addons and Mods: Complete / Modules Operation Arrowhead / Addons and Mods: Complete / Sounds Operation Arrowhead / Addons and Mods: Complete / Units Operation Arrowhead / Addons and Mods: Complete / Vehicles Operation Arrowhead / Addons and Mods: Complete / Weapons Operation Arrowhead / Addons and Mods: Complete / Other Operation Arrowhead / Addons and Mods / Addons and Mods: WIP Operation Arrowhead / Addons and Mods / Addon requests Operation Arrowhead / Missions: Complete / Multiplayer missions Operation Arrowhead / Missions: Complete / Singleplayer missions Arma 2 / General Discussion Arma 2 / Troubleshooting Arma 2 / Addons and Mods: Complete Arma 2 / Addons and Mods Arma 2 / Missions: Complete Arma 2 / Missions WIP Arma 2 / Addons and Mods: Complete / Islands Arma 2 / Addons and Mods: Complete / Modules Arma 2 / Addons and Mods: Complete / Sounds Arma 2 / Addons and Mods: Complete / Units Arma 2 / Addons and Mods: Complete / Vehicles Arma 2 / Addons and Mods: Complete / Weapons Arma 2 / Addons and Mods: Complete / Other Arma 2 / Missions: Complete / Multiplayer missions Arma 2 / Missions: Complete / Singleplayer missions Arma 2 / Addons and Mods / Addon requests Arma 2 / Addons and Mods / Addons and Mods: WIP Armed Assault / General Discussion Armed Assault / Troubleshooting Armed Assault / Addons and Mods: Complete Armed Assault / Addons and Mods: Discussion Armed Assault / Missions: Complete Armed Assault / Missions WIP Armed Assault / Missions: Complete / Multiplayer missions Armed Assault / Missions: Complete / Singleplayer missions Armed Assault / Addons and Mods: Complete / Islands Armed Assault / Addons and Mods: Complete / Modules Armed Assault / Addons and Mods: Complete / Sounds Armed Assault / Addons and Mods: Complete / Units Armed Assault / Addons and Mods: Complete / Vehicles Armed Assault / Addons and Mods: Complete / Weapons Armed Assault / Addons and Mods: Complete / Other Armed Assault / Addons and Mods: Discussion / Addons and Mods: WIP Armed Assault / Addons and Mods: Discussion / Addon requests Advertising / Advertisement Site Related / Armaholic in general Site Related / Armaholic Subscription System Site Related / Armaholic in general / Announcements Offtopic / Chit chat Offtopic / Hardware and software Offtopic / Other Games Offtopic / Other Games / Arma: Cold War Assault / Operation Flashpoint Offtopic / Other Games / Take On Helicopters Offtopic / Other Games / Carrier Command: Gaea Mission Internation Forum / Français Internation Forum / Español Internation Forum / Dutch
Author
Message
Posts: 18
Rank:
Country:
Location:
Occupation:
Age:
In-game name:
#1 Posted at 2017-08-18 11:28
Hi good sirs
Appologies if I'm posting this in the wrong section.
I'm creating a MP PvP mission where if the blufor shoot too many civilians, the resistance players are able to get the current radio channel that blufor are using.
I've tried:
_allWEST = group H1;
_leader = leader _allWEST;
_channel = (group _leader) getVariable ["tf_sw_frequency"];
Hint format ["Channel is %1", _channel];
but I get:
Error 1 elements provided, 2 expected
Also, if nobody is playing the "H1" slot I get:
Error Undefined variable in expression: H1
Any help or comments appreciated.
Author
Message
Posts: 1525
Rank:
Country:
Location:
Occupation:
Age:
In-game name:
#2 Posted at 2017-08-18 12:23
Try removing the square brackets around "tf_sw_frequency" , it's not wrong but may not be needed here.
as for H1 issue you may need to check if it exists
if (isNull group H1) exitWith {};
I'm not sure about that one i5t should work for a unit not sure about groups.
Author
Message
Posts: 18
Rank:
Country:
Location:
Occupation:
Age:
In-game name:
#3 Posted at 2017-08-19 01:21
It's great when one of the Master Scripters comes to the rescue. Thanks F2kSel!
Yes - removing the square brackets helped in this case, and I got a whole bunch of stuff returned in the variable (more than a bargined for). Now I just need to try and decipher it and attempt to extract just the channel. Hmmm . . .
In regards to getting the required info from blufor, what I really need to know is how can I get the _leader variable if unit "H1" isn't being played. Say for example 2 people are playing the blufor side, and they have chosen slots "H3" and "H6"?
Thoughts?
I've also just found that the channel info returned through "tf_sw_frequency" seems to be the default settings at the beginning of the mission only. Any changes of frequencies are not reflected in the variable further through the mission.
This post was edited by Vapour (2017-08-19 01:43, ago)