Jump to content
🛡️FORUMS ARE IN READ-ONLY MODE Read more... ×

Recommended Posts

Hello everyone,


I'm in need of help with a script for the "player to leave a unit there", which seems to me not to exist". I use a script to add Ai to my unit and I need another script for "me" to leave that unit and leave a leader in the group. Is this possible?

 

However, if there should be, if someone can share it I appreciate it. Thank you for your attention

Share this post


Link to post
Share on other sites

Hi, yes. It is simple, you just have to join to non existent group. Group you'll leave will choose leader automatically, so no need to worry about that.
 

[player] joinSilent grpNull;
(group player) deleteGroupWhenEmpty true;

Since you joined non-existent group, engine will automatically create new group for you. And thus we have to ensure that when you either die or join other group or so, that newly created group will be deleted once it's empty, otherwise you might reach number of groups limit.

  • Like 1

Share this post


Link to post
Share on other sites

Thank you soldierXXXX!
Is this added in trigger, in the init of the mission or init of the player?

ex: I'm using it in warlords. I add soldiers to my group, take them to the conquered city and there I leave the group leaving them to defend the city. Only one character on each side has this script to avoid uncontrolled amount of Ais on the map. According to the script below (I don't remember its author) is it possible to add in ActMenu "the "player" to leave the AI group or enter the non-existent group?

 

[] spawn {
  if !(player in [player13,player14]) exitWith {};
  waitUntil {!isNull player};
  while {true} do {
    { 
      _x setVariable ["addedAction",true]; 
      _x setVariable ["oldGrp",if (group _x == group player) then [{grpNull},{group _x}]];
      _x addAction [
        if (group player isEqualTo group _x) then [{"Leave my squad"},{"Join my squad"}],
        {
          params ["_unit","_player","_id"];
          _ActMenu = (_unit actionParams _id) select 0;
          _unit setUserActionText [_id,_ActMenu]; 
          if (_ActMenu isEqualTo "Join my squad") then { 
            _ActMenu = "Leave my squad"; 
            [_unit] join group _player;
          } else {
            _ActMenu = "Join my squad";
            [_unit] join (_unit getVariable ["oldGrp",grpNull]);
          } else {
            _ActMenu = "Get out squad";
            [_unit] join (_unit getVariable ["oldGrp",grpNull]);
          };
          _unit setUserActionText [_id,_ActMenu];
        },nil,0.8,false,true,"side _this isEqualTo side _target"
      ];
    } forEach (allunits select { !(_x getVariable ["addedAction",false]) && !isPlayer _x});
    sleep 2;
  };
};

 

Share this post


Link to post
Share on other sites

You can try something like:
 

XXX_ManageGroup = [
    "<t color='#ff3333'>Dismiss</t>",{
        params ["_unit","_plyr","_id"];
        if (group _unit isNotEqualTo group _plyr) then {
            [_unit] joinSilent group _plyr;
            _unit setUserActionText [_id,"<t color='#ff3333'>Dismiss</t>"];
        } else {
            [_unit] joinSilent grpNull;
            _unit setUserActionText [_id,"<t color='#33ff33'>Join group</t>"];
        };
    },
    [],
    0,
    false,
    true,
    "",
    "true",
    8
];

{_x addAction XXX_ManageGroup} forEach (units player select {!isPlayer _x});
group player addEventHandler ["UnitJoined", {
    params ["_group", "_newUnit"];
    if (isNil {_newUnit getVariable "XXX_joined"}) then {
        _newUnit setVariable ["XXX_joined",TRUE];
        _newUnit addAction XXX_ManageGroup;
    };
}];

In init.sqf or initPlayerLocal.sqf or even a trigger (not server only)

 

Share this post


Link to post
Share on other sites

So if I'm right, you need to be able to recruit AIs one by one like in your current function, then assign them a task like move here and then be able to left the group, so AIs are all still together and not each AI in it's own group correct ? Well...I tried to put some code together that would allow this behavior. Let us know if that is what you're after 🙂.
 

Spoiler

In my code, I solved it by creating more than one action as I think it would be better for readibility and customisability. Each action does specific task and should appear exactly when needed. Radius of activation is 5 meters here, increase it by your needs. Even though actions are evaluated each frame, it shouldn't affect game performance as much. If it would then we would have to solve it by removing and adding actions and I'm kinda lazy to do that now 😄.
 


[player13,player14] spawn {
scriptName "Simple_recruit_system";
if !(player in _this) exitWith {};
AllowedPlayers = _this apply {str _x};
soldierXXXX_fnc_RecruitAction = {
scriptName "soldierXXXX_fnc_RecruitAction";
params ["_unit"];
if (_unit isEqualTo player) exitWith {};
_unit addAction
[
	"Join group",
	{
	 params ["_target", "_caller", "_actionId", "_arguments"];
	 [_target] joinSilent group _caller;
	},
	nil,
	1.5,
	true,
	true,
	"",
	"alive _target AND {group _target isNotEqualTo group _this AND {str _this in AllowedPlayers}}",
	5,
	false,
	"",
	""
];
_unit addAction
[
	"Dismiss",
	{
	 params ["_target", "_caller", "_actionId", "_arguments"];
	 [_target] joinSilent grpNull;
	 (group _target) deleteGroupWhenEmpty true;
	},
	nil,
	1.5,
	true,
	true,
	"",
	"alive _target AND {group _target isEqualTo group _this AND {str _this in AllowedPlayers}}",
	5,
	false,
	"",
	""
];
};
soldierXXXX_fnc_addPlayerGroupActions = {
scriptName "soldierXXXX_fnc_addPlayerGroupActions";
player addAction
[
	"Leave group",
	{
	 params ["_target", "_caller", "_actionId", "_arguments"];
	 [_caller] joinSilent grpNull;
     (group _caller) deleteGroupWhenEmpty true;
	},
	nil,
	1.5,
	true,
	true,
	"",
	"(units group _target) isNotEqualTo [_target] AND {str _this in AllowedPlayers}",
	5,
	false,
	"",
	""
];
/*
//remove this if not needed-usable when player joins group with different leader
player addAction
[
	"Become leader",
	{
	 params ["_target", "_caller", "_actionId", "_arguments"];
	 group _caller selectLeader _caller;
	},
	nil,
	1.5,
	true,
	true,
	"",
	"(leader group _target) isNotEqualTo _target AND {str _this in AllowedPlayers}",
	5,
	false,
	"",
	""
];
*/
};
call soldierXXXX_fnc_addPlayerGroupActions;
player addEventHandler ["Killed",{removeAllActions (_this select 0);}];
private _allPlayers = (allUnits + allDead) select {isPlayer _x};
private _friendlyUnits = (allUnits - _allPlayers) select {side _x isEqualTo side player};
{
 _x call soldierXXXX_fnc_RecruitAction;
} forEach _friendlyUnits;//recruit friendly AI only

//handle new units
addMissionEventHandler ["EntityCreated",{
params ["_entity"];
if !(_entity isKindOf "Man") exitWith {};
if (side _entity isNotEqualTo side player) exitWith {};
_entity call soldierXXXX_fnc_RecruitAction;
if (str _entity in AllowedPlayers) then {call soldierXXXX_fnc_addPlayerGroupActions};
}];
};

 

 

Edited by soldierXXXX
Added friendly units filter

Share this post


Link to post
Share on other sites

Thank you for your attention! Excuse me gentlemen, it would be like: I recruit individually, I dismiss individually.. The script I use works fine. But I don't have a script that I get out of the group that I formed. Like: I dismiss myself from the group I formed.  That's it! 

 

Thank you Pierremgi, 
Your script worked great. However, I can't leave the group to form another.

 

 

Thank you soldierXXXX

Exactly, me and another specific player ( player13 (blue), player14 (red) ) have the option to leave the group we created.

 

Thank you once again for the attention received.

Share this post


Link to post
Share on other sites
5 hours ago, Coy74 said:

 Pierremgi, 
Your script worked great. However, I can't leave the group to form another.

Exactly, me and another specific player ( player13 (blue), player14 (red) ) have the option to leave the group we created.


You just have to leave your group (no impact on Warlords setting and player's data iirc). So the units will stay grouped, without you.
add this in initPlayerLocal.sqf or trigger
 

if (player in [player13,player14]) then {
	player addAction ["<t color='#3333ff'>leaving group</t>",{
		params ["_unit","_plyr","_id"];
		[_plyr] joinSilent grpNull
		},
		[],
		0,
		false,
		true,
		"",
		"units _this isNotEqualTo [_this]"
	];
};

 

  • Like 1

Share this post


Link to post
Share on other sites

Hello again,
You guys are awesome! It's a shame I don't understand anything about scripts and I won't be able to understand, too old for that, especially in another language. I try very hard to understand this language. It was very good pierremgi, now I can redeploy the same troops by truck to conquered terrain. This way I maintain strategic cities with a good defense.

 

There are two points to correct:

 

1 - when my character is eliminated the function is lost. How do you solve this?

 

2 - 

On 1/19/2025 at 3:08 PM, pierremgi said:

You can try something like:
 


XXX_ManageGroup = [
    "<t color='#ff3333'>Dismiss</t>",{
        params ["_unit","_plyr","_id"];
        if (group _unit isNotEqualTo group _plyr) then {
            [_unit] joinSilent group _plyr;
            _unit setUserActionText [_id,"<t color='#ff3333'>Dismiss</t>"];
        } else {
            [_unit] joinSilent grpNull;
            _unit setUserActionText [_id,"<t color='#33ff33'>Join group</t>"];
        };
    },
    [],
    0,
    false,
    true,
    "",
    "true",
    8
];

{_x addAction XXX_ManageGroup} forEach (units player select {!isPlayer _x});
group player addEventHandler ["UnitJoined", {
    params ["_group", "_newUnit"];
    if (isNil {_newUnit getVariable "XXX_joined"}) then {
        _newUnit setVariable ["XXX_joined",TRUE];
        _newUnit addAction XXX_ManageGroup;
    };
}];

In init.sqf or initPlayerLocal.sqf or even a trigger (not server only)

 

With this script I have 3 problems: 1- error in line 13, 2- other characters besides player 13 and 14 also perform the function of recruiting and dismissing soldiers, 3- when I leave a created squad, they don't leave completely. When I roll the mouse pointing at the recruits it still appears "dismiss".

 

------------------------------------

 

And with this script below I have 1  problem:

 

1- when I leave a created squad, they don't leave completely. When I roll the mouse pointing at the recruits it still appears "Leave my squad".

 

[] spawn {
  if !(player in [player13,player14]) exitWith {};
  waitUntil {!isNull player};
  while {true} do {
    { 
      _x setVariable ["addedAction",true]; 
      _x setVariable ["oldGrp",if (group _x == group player) then [{grpNull},{group _x}]];
      _x addAction [
        if (group player isEqualTo group _x) then [{"Leave my squad"},{"Join my squad"}],
        {
          params ["_unit","_player","_id"];
          _ActMenu = (_unit actionParams _id) select 0;
          _unit setUserActionText [_id,_ActMenu]; 
          if (_ActMenu isEqualTo "Join my squad") then { 
            _ActMenu = "Leave my squad"; 
            [_unit] join group _player;
          } else {
            _ActMenu = "Join my squad";
            [_unit] join (_unit getVariable ["oldGrp",grpNull]);
          };
          _unit setUserActionText [_id,_ActMenu];
        },nil,0.8,false,true,"side _this isEqualTo side _target"
      ];
    } forEach (allunits select { !(_x getVariable ["addedAction",false]) && !isPlayer _x});
    sleep 2;
  };
};
 

OBS: Of course, when it comes to playing arma 3 cleanly without cheating. Because otherwise the problems would be many. It shouldn't be easy to script even for experts. You see, when I'm losing the battle to a friend I end up thinking about recruiting a soldier or his leader. I almost lost my friendship the other day. hehehehe 

 

Share this post


Link to post
Share on other sites

I gotta ask, have you also tried my script? Seems to me that all issues you have right now are already solved in it.

Share this post


Link to post
Share on other sites

Simple correction:
 


 

if (player in [player13,player14]) then {

XXX_ManageGroup = [
  "<t color='#ff3333'>Dismiss</t>",{
  params ["_unit","_plyr","_id"];
  if (group _unit isNotEqualTo group _plyr) then {
    [_unit] joinSilent group _plyr;
    _unit setUserActionText [_id,"<t color='#ff3333'>Dismiss</t>"];
  } else {
    [_unit] joinSilent grpNull;
    _unit setUserActionText [_id,"<t color='#33ff33'>Join group</t>"];
  };
  },
  [],
  0,
  false,
  true,
  "",
  "true",
  8
];
 
{
  _x addAction XXX_ManageGroup;
} forEach (units player select {!isPlayer _x});

group player addEventHandler ["UnitJoined", {
    params ["_group", "_newUnit"];
    _newUnit addAction XXX_ManageGroup;
}];


player addAction [
  "<t color='#3333ff'>leaving group</t>",{
  params ["_unit","_plyr","_unit"];
  {_unit = _x; _unit setUserActionText [(actionIds _unit) findIf {((_unit actionParams _x)#0) isEqualTo "<t color='#ff3333'>Dismiss</t>"},"<t color='#33ff33'>Join group</t>"]} forEach units player;
  [_plyr] joinSilent grpNull;
  },
  [],
  0,
  false,
  true,
  "",
  "units _this isNotEqualTo [_this]"
];
};

 

That allows you to regroup dismissed units (within 8 m distance).

If you don't want them anymore when you leave the group, it's also simple:
replace the last player addAction by:
 

player addAction ["<t color='#3333ff'>leaving group</t>",{
  params ["_unit","_plyr","_unit"];
  {removeAllActions _x} forEach units player;
  [_plyr] joinSilent grpNull;
}, [], 0, false, true, "", "units _this isNotEqualTo [_this]"];

 

Share this post


Link to post
Share on other sites
On 1/19/2025 at 4:09 PM, soldierXXXX said:

Então, se eu estiver certo, você precisa ser capaz de recrutar IAs uma a uma, como em sua função atual, depois atribuir a elas uma tarefa como mover aqui e depois ser capaz de sair do grupo, para que as IAs ainda estejam todas juntas e não cada IA em seu próprio grupo, correto? Poço... Tentei montar algum código que permitisse esse comportamento. Deixe-nos saber se é isso que você está procurando 🙂.
 

  Ocultar conteúdo

No meu código, resolvi criando mais de uma ação, pois acho que seria melhor para legibilidade e personalização. Cada ação executa uma tarefa específica e deve aparecer exatamente quando necessário. O raio de ativação é de 5 metros aqui, aumente-o de acordo com suas necessidades. Mesmo que as ações sejam avaliadas a cada quadro, isso não deve afetar tanto o desempenho do jogo. Se fosse, teríamos que resolvê-lo removendo e adicionando ações e estou com preguiça de fazer isso agora 😄.
 



[player13,player14] spawn {
scriptName "Simple_recruit_system";
if !(player in _this) exitWith {};
AllowedPlayers = _this apply {str _x};
soldierXXXX_fnc_RecruitAction = {
scriptName "soldierXXXX_fnc_RecruitAction";
params ["_unit"];
if (_unit isEqualTo player) exitWith {};
_unit addAction
[
	"Join group",
	{
	 params ["_target", "_caller", "_actionId", "_arguments"];
	 [_target] joinSilent group _caller;
	},
	nil,
	1.5,
	true,
	true,
	"",
	"alive _target AND {group _target isNotEqualTo group _this AND {str _this in AllowedPlayers}}",
	5,
	false,
	"",
	""
];
_unit addAction
[
	"Dismiss",
	{
	 params ["_target", "_caller", "_actionId", "_arguments"];
	 [_target] joinSilent grpNull;
	 (group _target) deleteGroupWhenEmpty true;
	},
	nil,
	1.5,
	true,
	true,
	"",
	"alive _target AND {group _target isEqualTo group _this AND {str _this in AllowedPlayers}}",
	5,
	false,
	"",
	""
];
};
soldierXXXX_fnc_addPlayerGroupActions = {
scriptName "soldierXXXX_fnc_addPlayerGroupActions";
player addAction
[
	"Leave group",
	{
	 params ["_target", "_caller", "_actionId", "_arguments"];
	 [_caller] joinSilent grpNull;
     (group _caller) deleteGroupWhenEmpty true;
	},
	nil,
	1.5,
	true,
	true,
	"",
	"(units group _target) isNotEqualTo [_target] AND {str _this in AllowedPlayers}",
	5,
	false,
	"",
	""
];
/*
//remove this if not needed-usable when player joins group with different leader
player addAction
[
	"Become leader",
	{
	 params ["_target", "_caller", "_actionId", "_arguments"];
	 group _caller selectLeader _caller;
	},
	nil,
	1.5,
	true,
	true,
	"",
	"(leader group _target) isNotEqualTo _target AND {str _this in AllowedPlayers}",
	5,
	false,
	"",
	""
];
*/
};
call soldierXXXX_fnc_addPlayerGroupActions;
player addEventHandler ["Killed",{removeAllActions (_this select 0);}];
private _allPlayers = (allUnits + allDead) select {isPlayer _x};
{
 _x call soldierXXXX_fnc_RecruitAction;
} forEach allUnits - _allPlayers;//recruit AI only

//handle new units
addMissionEventHandler ["EntityCreated",{
params ["_entity"];
if !(_entity isKindOf "Man") exitWith {};
if (side _entity isNotEqualTo side player) exitWith {};
_entity call soldierXXXX_fnc_RecruitAction;
if (str _entity in AllowedPlayers) then {call soldierXXXX_fnc_addPlayerGroupActions};
}];
};

 

 

Hello soldier XXXX,
Oh yes, I forgot to talk about the script. I didn't know how to use it. And I asked if it's to create SQF file or to add in INIT or playerlocal. Which of these would it be?

Share this post


Link to post
Share on other sites
Just now, Coy74 said:

Hello soldier XXXX,
Oh yes, I forgot to talk about the script. I didn't know how to use it. And I asked if it's to create SQF file or to add in INIT or playerlocal. Which of these would it be?

You can put it into initPlayerLocal.sqf , trigger, separate file, init.sqf...basically anywhere you want. But preferably into initPlayerLocal.sqf

Share this post


Link to post
Share on other sites
44 minutes ago, pierremgi said:

params ["_unit","_plyr","_unit"];

 

line 25: "invalid number error in the expression"

 

in the option "join Group" and dismiss appears

Share this post


Link to post
Share on other sites

my bad:
params ["_unit","_plyr"];

don't double _unit param!

 

Check also if you didn't erase the last }; at bottom end of the script for closing:   if (player in [player13,player14]) then {...} brackets!

Share this post


Link to post
Share on other sites

Hello again,
I did some tests today after work and it's much better in both scripts.

 

Pierremgi, very grateful for the great help. I loved that I can't recruit other subordinate characters from allies, neither allies nor adversaries and their subordinates, only my subordinates. I understood what you meant and I didn't delete the bracket. Your correction worked on both sides (blue and red), it was great! With one detail: after character 13 and 14 are eliminated, from the second respawn the "addaction 'leaving group'" disappears on both sides, making it impossible to leave the group.

 

soldierXXXX, your script is also great! After respawning it works great. I have only 1 problem, I am not prevented from recruiting opponents. Is it possible to limit recruitment to only my subordinates?

 

 

Note: I'm doing some tests to see if warlords accepts some scripts that I researched and collected on the internet. So far everything is going well.  Thank you again!

Share this post


Link to post
Share on other sites

Ah, right. I overlooked that :-D. Action was added to all units that were available at the mission start (editor placed). I've edited the script, so now it should be added to only units that are on player's side. By your subordinates you mean all friendly units or your group only? If all units that are moving on the map, which I think it's better approach if you want to send them to defend cities, do you need also restriction to not be able to recruit other player's AI units or that is not necessary?

Share this post


Link to post
Share on other sites
2 hours ago, Coy74 said:

Pierremgi, very grateful for the great help. I loved that I can't recruit other subordinate characters from allies, neither allies nor adversaries and their subordinates, only my subordinates. I understood what you meant and I didn't delete the bracket. Your correction worked on both sides (blue and red),second respawn the "addaction 'leaving group'" disappears on both sides, making it impossible to leave the group.

 

Yes, as any addAction on respawning unit. Script like this:
 

if (player in [player13,player14]) then {

XXX_ManageGroup = [
  "<t color='#ff3333'>Dismiss</t>",{
  params ["_unit","_plyr","_id"];
  if (group _unit isNotEqualTo group _plyr) then {
    [_unit] joinSilent group _plyr;
    _unit setUserActionText [_id,"<t color='#ff3333'>Dismiss</t>"];
  } else {
    [_unit] joinSilent grpNull;
    _unit setUserActionText [_id,"<t color='#33ff33'>Join group</t>"];
  };
  },
  [],
  0,
  false,
  true,
  "",
  "true",
  8
];

XXX_PlyrLeavingGroup = [
  "<t color='#3333ff'>leaving group</t>",{
  params ["_unit","_plyr"];
  {removeAllActions _x} forEach units player;
  [_plyr] joinSilent grpNull;
  },
  [],
  0,
  false,
  true,
  "",
  "units _this isNotEqualTo [_this]"
];
 
{
  _x addAction XXX_ManageGroup;
} forEach (units player select {!isPlayer _x});
player addAction XXX_PlyrLeavingGroup;

group player addEventHandler ["UnitJoined", {
    params ["_group", "_newUnit"];
    _newUnit addAction XXX_ManageGroup;
}];

player addMPEventHandler ["MPRespawn",{
  params ["_new","_old"];
  removeAllActions _old;
  _new addAction XXX_PlyrLeavingGroup;
}];

};

 

Share this post


Link to post
Share on other sites

soldierXXXX

 

7 hours ago, soldierXXXX said:

your group only?

But is it possible to recruit only subordinate units of character 13 and 14 and subordinate units of allies (players)?

If it is possible it is more interesting to recruit my subordinates and subordinates of allies only, but if only the subordinates of character 13 and 14 can also serve.

 

 

Pierremgi

Pierremgi, I'm sorry for the writing. I think I expressed myself wrong, and the translator also doesn't understand popular language. 
What I meant is that I need the addaction function "leaving group" because after character 13 and 14 are eliminated the function disappears, prohibiting me from recruiting again for troop redeployment. Is it possible to activate again the addaction leaving group function after characters 13 and 14 are eliminated?

 

Note: I spend 1 hour every day trying to understand this language that you do. How can language be different and perform the same functions. I learn and when I learn it will be a great pastime. I appreciate the time you are dedicating to my curiosity and need for learning.

Share this post


Link to post
Share on other sites
13 minutes ago, Coy74 said:

What I meant is that I need the addaction function "leaving group" because after character 13 and 14 are eliminated the function disappears, prohibiting me from recruiting again for troop redeployment. Is it possible to activate again the addaction leaving group function after characters 13 and 14 are eliminated?

 

 

Did you test the last script?  I added an MPEH for respawn. That works on respawn!

 

Eliminated?  if player13 (or 14) respawns in MP, that  doesn't change anything for him. They are still player13 (or14) as variable name. The respawn EH throws the addAction on new unit. So, I don't understand what "eliminated" means.

Did you name two slots with player13 and player14?

If not, what are characters 13 and 14 ? What means "eliminated"? What occurs? respawn, back to lobby?  How can they still play if eliminated?
 

Share this post


Link to post
Share on other sites
1 hour ago, Coy74 said:

But is it possible to recruit only subordinate units of character 13 and 14 and subordinate units of allies (players)?

Yes, I updated the script and currently works for all AI units that are on player's side, including other player's group AI members. If you need to exclude groups that doesn't include any player I would have to update it again.

1 hour ago, Coy74 said:

If it is possible it is more interesting to recruit my subordinates and subordinates of allies only, but if only the subordinates of character 13 and 14 can also serve.

Well, I have to admit I'm kinda confused by this sentence. Can you explain further, how you expect the script to behave ?

Share this post


Link to post
Share on other sites
1 hour ago, pierremgi said:

Did you test the last script? 

Yes, I tested it! Now when I leave the group I can no longer get the subordinates to join my group again. The previous script gave this option (leaving group) just by scrolling the mouse. The problem was that after the character died in combat, on respawn, the leaving group function no longer worked. That was the only problem.
Now early testing again, I found that every time I join group and then dismiss unit it appears repeated dismissal (2x, 3x, 4x...) every time I join group.

 

1 hour ago, pierremgi said:

Eliminated?  if player13 (or 14) respawns in MP, that  doesn't change anything for him. They are still player13 (or14) as variable name. The respawn EH throws the addAction on new unit. So, I don't understand what "eliminated" means.

This option does not appear on the screen, not even when scrolling the mouse after respawning.

 

1 hour ago, pierremgi said:

Did you name two slots with player13 and player14?

Everything is right here!

 

1 hour ago, pierremgi said:

If not, what are characters 13 and 14 ? What means "eliminated"? What occurs? respawn, back to lobby?  How can they still play if eliminated?

After being killed in combat, the Leaving Group function disappears from the screen without scrolling the mouse.

Share this post


Link to post
Share on other sites
19 minutes ago, soldierXXXX said:

Well, I have to admit I'm kinda confused by this sentence. Can you explain further, how you expect the script to behave ?

It's just that I don't know yet whether it's better to recruit only my units or also to recruit units of subordinates of allies. Bugs appear. I need to test it!

Your answer to my first question answered that. I will test and get back to you. Thank you for your patience.

Share this post


Link to post
Share on other sites
30 minutes ago, Coy74 said:

Yes, I tested it! Now when I leave the group I can no longer get the subordinates to join my group again. The previous script gave this option (leaving group) just by scrolling the mouse. The problem was that after the character died in combat, on respawn, the leaving group function no longer worked. That was the only problem.
Now early testing again, I found that every time I join group and then dismiss unit it appears repeated dismissal (2x, 3x, 4x...) every time I join group.

 

This option does not appear on the screen, not even when scrolling the mouse after respawning.

 

Everything is right here!

 

After being killed in combat, the Leaving Group function disappears from the screen without scrolling the mouse.

 

We don't have the same script.
https://forums.bohemia.net/forums/topic/317664-player-leave-ai-group/?do=findComment&amp;comment=3594257
Everything works fine for me.

I can't understand why you can have multiple dismissal, tested multiple Join/dismiss. There is no reason for adding another action on a AI unit! So, you did something on your side, a loop or else... I can't say.

I keep the "leaving group" option, working fine, after a respawn... the script has been corrected for that, as you required. So, if you can't find this action menu after a normal respawn (BI respawn system) I can't understand. That's the first time I read the MPEH MPRespawn fails.

I hope you don't try 2 codes at the same time... or add multiple mods already managing stuff on respawn. No clue about what to do more.

 

  • Like 1

Share this post


Link to post
Share on other sites
1 hour ago, soldierXXXX said:

If you need to exclude groups that doesn't include any player I would have to update it again.

I won't need to because I can join group for these AI. As it was before. correct?

 

On 1/19/2025 at 4:09 PM, soldierXXXX said:

}];

line 105 - Invalid number error in expression

Share this post


Link to post
Share on other sites
15 minutes ago, pierremgi said:

I hope you don't try 2 codes at the same time... or add multiple mods already managing stuff on respawn. No clue about what to do more.

Thank you Pierremgi

Probably it's the extra scripts that are already in the mission that are causing conflict. And there are several! I'll be redoing the Warlors without Modes quest now to see that. Only weekend, because for an amateur like me, it's hours of redoing. The good thing is that I practice. Thank you again.

 

The two scripts in this topic are separate and I do them individually.

Share this post


Link to post
Share on other sites

×