Cryptdik 5 Posted May 31, 2018 Trying to use the BIS_fnc_holdActionAdd function in a unit's Init line so that you can approach them and recruit their group to your group, MP compatible. I've tried a number of variations based on the info here but have had no success: https://community.bistudio.com/wiki/BIS_fnc_holdActionAdd [player, "Recruit", "", "", "_this distance _target < 3", "_caller distance _target < 3", {}, {}, {(group _target) join (group _caller)}, {}, [], 2, nil, true, false] remoteExec ["BIS_fnc_holdActionAdd", 0, _target]; The error I get is: |#|remoteExec ["BIS_fnc_holdActionAdd", 0, _target]; ERROR TYPE ANY Any help is appreciated, I'm not too fluent in scripting. Share this post Link to post Share on other sites
Cryptdik 5 Posted May 31, 2018 I think I got it to work by doing this, one for each of the civs in the group. Is there a simpler way to do this yet? [civ1, "Recruit", "", "", "_this distance _target < 3", "_caller distance _target < 3", {}, {}, {[civ1, civ2, civ3, civ4] join _caller}, {}, [], 2, nil, true, false] remoteExec ["BIS_fnc_holdActionAdd", 0, civ1]; [civ2, "Recruit", "", "", "_this distance _target < 3", "_caller distance _target < 3", {}, {}, {[civ1, civ2, civ3, civ4] join _caller}, {}, [], 2, nil, true, false] remoteExec ["BIS_fnc_holdActionAdd", 0, civ2]; [civ3, "Recruit", "", "", "_this distance _target < 3", "_caller distance _target < 3", {}, {}, {[civ1, civ2, civ3, civ4] join _caller}, {}, [], 2, nil, true, false] remoteExec ["BIS_fnc_holdActionAdd", 0, civ3]; [civ4, "Recruit", "", "", "_this distance _target < 3", "_caller distance _target < 3", {}, {}, {[civ1, civ2, civ3, civ4] join _caller}, {}, [], 2, nil, true, false] remoteExec ["BIS_fnc_holdActionAdd", 0, civ4]; Share this post Link to post Share on other sites
gokitty1199 225 Posted June 1, 2018 On 5/31/2018 at 1:38 PM, Cryptdik said: I think I got it to work by doing this, one for each of the civs in the group. Is there a simpler way to do this yet? [civ1, "Recruit", "", "", "_this distance _target < 3", "_caller distance _target < 3", {}, {}, {[civ1, civ2, civ3, civ4] join _caller}, {}, [], 2, nil, true, false] remoteExec ["BIS_fnc_holdActionAdd", 0, civ1]; [civ2, "Recruit", "", "", "_this distance _target < 3", "_caller distance _target < 3", {}, {}, {[civ1, civ2, civ3, civ4] join _caller}, {}, [], 2, nil, true, false] remoteExec ["BIS_fnc_holdActionAdd", 0, civ2]; [civ3, "Recruit", "", "", "_this distance _target < 3", "_caller distance _target < 3", {}, {}, {[civ1, civ2, civ3, civ4] join _caller}, {}, [], 2, nil, true, false] remoteExec ["BIS_fnc_holdActionAdd", 0, civ3]; [civ4, "Recruit", "", "", "_this distance _target < 3", "_caller distance _target < 3", {}, {}, {[civ1, civ2, civ3, civ4] join _caller}, {}, [], 2, nil, true, false] remoteExec ["BIS_fnc_holdActionAdd", 0, civ4]; you could use cursorObject and isKindOf to go about this. heres the setup but with addAction, only shows on units that are not in your group, same faction, less than 2 meters. convert it to use with holdActionAdd and just change conditions to your liking. cursorObject being the main help player addAction ["Invite to group", { _unit = cursorObject; _sender = (_this select 0); [_sender] remoteExecCall ["BUF_fnc_addPlayerToGroup", _unit, true]; }, [], 0, false, true, "", "cursorObject isKindOf 'MAN' && !(group cursorObject isEqualTo group _this) && side cursorObject isEqualTo side _this && cursorObject distance _target < 2"]; Share this post Link to post Share on other sites