sizraide 4 Posted July 13, 2021 Hello, i'm creating a COOP mission. I want a group of AI to reveal to a group of players Quote _players = players; { _x enableAI "MOVE"; _x reveal _players; } forEach [a1,a2,a3,a4,a5]; sleep 3; This is my script but it doesn't work. I have this in the squad leader of the players group Quote players = group this; I want to have a trigger where when players walk into it. It runs a script and it unhides a few AI and immediately makes the AI aware of the group of players so the AI will immediately start shooting the group of players. Share this post Link to post Share on other sites
sarogahtyp 1109 Posted July 13, 2021 You did Object reveal group But as pf biki there is not such syntax but there is Group reveal object 1 Share this post Link to post Share on other sites
sizraide 4 Posted July 13, 2021 44 minutes ago, sarogahtyp said: You did Object reveal group But as pf biki there is not such syntax but there is Group reveal object It doesn't work for some reason Share this post Link to post Share on other sites
sizraide 4 Posted July 13, 2021 48 minutes ago, sarogahtyp said: You did Object reveal group But as pf biki there is not such syntax but there is Group reveal object If I replace _players with just player will it reveal each player to each ai in forEach? Share this post Link to post Share on other sites
beno_83au 1369 Posted July 14, 2021 Perhaps you need to read sarogahtyp's reply a little more closely: 4 hours ago, sarogahtyp said: You did Object reveal group But as pf biki there is not such syntax but there is Group reveal object Looking at the command reveal would explain his reply in detail. Share this post Link to post Share on other sites
sizraide 4 Posted July 14, 2021 5 minutes ago, beno_83au said: Perhaps you need to read sarogahtyp's reply a little more closely: Looking at the command reveal would explain his reply in detail. "If toWhom is a unit, unit's group is considered" This means the player's group is considered? so I can just type _x reveal player; and the player's group is already considered. Share this post Link to post Share on other sites
beno_83au 1369 Posted July 14, 2021 4 hours ago, sizraide said: I want a group of AI to reveal to a group of players makes the AI aware of the group of players Wait, which one is it? Do you want to reveal the players to the AI? Share this post Link to post Share on other sites
sizraide 4 Posted July 14, 2021 Just now, beno_83au said: Wait, which one is it? Do you want to reveal the players to the AI? No, I want to reveal a group of players to a bunch of AI's Share this post Link to post Share on other sites
beno_83au 1369 Posted July 14, 2021 Ok, in that case let's start with: _players = players; You've declared players as a group (in the leaders init) - https://community.bistudio.com/wiki/group. So _players is a group. Keep that in mind. 50 minutes ago, sizraide said: "If toWhom is a unit, unit's group is considered" This means the player's group is considered? so I can just type _x reveal player; and the player's group is already considered. toWhom is the first parameter, which here is _x. The group of a1, a2, etc, is considered, and in this case you are just revealing the player to the group of a1, then a2, then a3 and so on, because of how you've written it. But even in your original example you've just using a group (_players) instead of an object, so it was failing at that point. So........ toWhom reveal target toWhom: Object or Group which receives revealing information target: Object which is revealed You need to write it so that an object or group has an object revealed to them: { _aiGroup reveal _x; } forEach (units _playerGroup); With _aiGroup and _playerGroup defined correctly, that will reveal each unit in the player's group to the AI group. Share this post Link to post Share on other sites
sizraide 4 Posted July 14, 2021 19 minutes ago, beno_83au said: Ok, in that case let's start with: _players = players; You've declared players as a group (in the leaders init) - https://community.bistudio.com/wiki/group. So _players is a group. Keep that in mind. toWhom is the first parameter, which here is _x. The group of a1, a2, etc, is considered, and in this case you are just revealing the player to the group of a1, then a2, then a3 and so on, because of how you've written it. But even in your original example you've just using a group (_players) instead of an object, so it was failing at that point. So........ toWhom reveal target toWhom: Object or Group which receives revealing information target: Object which is revealed You need to write it so that an object or group has an object revealed to them: { _aiGroup reveal _x; } forEach (units _playerGroup); With _aiGroup and _playerGroup defined correctly, that will reveal each unit in the player's group to the AI group. How can I define it correctly? Just placing _aiGroup = group this; and _playerGroup = group this; in the squadleaders init fields? Share this post Link to post Share on other sites
beno_83au 1369 Posted July 14, 2021 There's a few ways, but probably the easiest is in the init of each group leader, as you've said. Doing it this way though, you need to define them as global variables: https://community.bistudio.com/wiki/Variables#:~:text=two main scopes%3A-,Global Scope,-A global variable. So just removing the _ from _aiGroup and _playerGroup is enough, as the _ treats them as local (explained in that link). I only used local variables to demonstrate what info needed to go where. Share this post Link to post Share on other sites
sizraide 4 Posted July 14, 2021 39 minutes ago, beno_83au said: There's a few ways, but probably the easiest is in the init of each group leader, as you've said. Doing it this way though, you need to define them as global variables: https://community.bistudio.com/wiki/Variables#:~:text=two main scopes%3A-,Global Scope,-A global variable. So just removing the _ from _aiGroup and _playerGroup is enough, as the _ treats them as local (explained in that link). I only used local variables to demonstrate what info needed to go where. Got it, it works. Thanks! Share this post Link to post Share on other sites