Jump to content
avibird 1

Need clarification how the joinSilent command works for spawned groups.

Recommended Posts

I know how to use the the joinSilent  command  to get one group to join another group. 

 

It works fine with two different editor placed groups. It works fine if I spawn in the seconds group to join a editor group but if I attempt to have two different groups spawn in and join the first group that spawns inn first.  it will not work. 

 

My question is. Is this a Arma engine limitation or is it a JEBUS limitation? 

 

In a trigger 

Type none

Activation opfor 

Activation type present

Repeatable

Condition 

                 Call {this}

On activation

                  Call {[ Yautja1, Yautja2,Yautja3] joinSilent grp_predator; hint "get to the chopper";};

 

This is how I spawn the groups in

0 = [ this, "Delay =",0,"exit=", myexitTrigger2] spawn jabs_fnc_main;

 

If somebody could explain this to me thanks avibird.

 

Share this post


Link to post
Share on other sites

Hello,

Not sure to understand your problem.

If you are sure that the spawned group in named grp_predator, so, I can't see why you couldn't make Yautja1, ..2, ..3 join it. joinSilent is a GA GE command, so you can make it work from anywhere.

First thing to do is verify this group exists with it's name grp_predator, before you try to join some extra units.

 

By the way:

When you spawn a group with another function than yours (if yours, you can easily add a code on it), and if you don't have a name for this group, you need to wait for some group created. The useful event handler, here, is the MEH "groupCreated"

In init.sqf:

addMissionEventHandler ["GroupCreated", {

   params ["_group"];

   if (your condition here) then {  do something on this group};

}];

 

Share this post


Link to post
Share on other sites

@pierremgi thanks for the response. Haven't been able to get online for a few days. I think the issue is jebus despawns editor placed units at the mission start and then respawns them back in. I know that the individual variable names do carry over because the second group will join the first group if not using jebus on that group and just editor placed. There may be a timing issue if the second group spawns in before the first group then the variable name will not be available for the second group to join. There is a function in jebus that can delay the initial spawn in time after initial respawn of the editor placed units. I don't know if that is the issue. Need to test more to see. 

 

Question for you on spawning units. If I change a units clothes weapons and gear it carries over when the unit is spawned into the game but if I change a units character features such as voice or face textures from the editor and if I use jebus and and voice reverts back to the original units and does not keep the editor modified face textures and voice. I don't know if this is a armor limitation or jebus. 

Share this post


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

Question for you on spawning units. If I change a units clothes weapons and gear it carries over when the unit is spawned into the game but if I change a units character features such as voice or face textures from the editor and if I use jebus and and voice reverts back to the original units and does not keep the editor modified face textures and voice. I don't know if this is a armor limitation or jebus. 

 

I can't say how jebus work. We can't speak about limitation so far. Probably due to commands used for setting face (setFace?) and voice (setSpeaker?) , which are both Effect Local so you need to remoteExec them everywhere.

Share this post


Link to post
Share on other sites

@pierremgi how would I even go getting the modified face and voice from the editor dropped down list to carry over after respawning. Uniforms gear weapons all carry over when respawning my units but not faces/heads or voices? 

Share this post


Link to post
Share on other sites
addMissionEventHandler ["entityRespawned", {
  params ["_new", "_old"];
  if (_new isKindOf "CAManBase") then {
    _new setFace face _old;
    _new setSpeaker speaker _old
  }
}];


If this MEH already exists, you just have to add the code (with the right variables)

Share this post


Link to post
Share on other sites

Stupid question where do I add that. Mission init  iniplayerlocal  initserver  ect 

Share this post


Link to post
Share on other sites

init.sqf is OK. The MEH is LE (local effect) and the commands are also LE, so, in init.sqf, the code fires everywhere, locally. That doesn't hurt without interface like dedicated server.

  • Thanks 1

Share this post


Link to post
Share on other sites

Hey I put it in my init.sqf it's not keeping the faces or voice changes ?

Share this post


Link to post
Share on other sites

Well, I don't know why. Try:

addMissionEventHandler ["entityRespawned",{
   params ["_new","_old"];
   if (_new isKindOf "CAManBase") then {  
     [_new,face _old] remoteExec ["setFace"];
     [_new,speaker _old] remoteExec ["setSpeaker"];
   }
 }];

just to be sure.

Share this post


Link to post
Share on other sites

@pierremgi    Thank you for the help. 

 

here is my init.sqf with your second code.

 

//mission Init.sqf

enableSaving [true, true];
enableTeamSwitch true; 

if (!hasInterface) exitWith {};
waitUntil {!isNull player};

player createDiaryRecord ["Diary",["Additional Intel",
"XXX"]];

player createDiaryRecord ["Diary",["Rules Of Engagement",
"XXX"]];

player createDiaryRecord ["Diary",["Objective1",
"vvv"]];

player createDiaryRecord ["Diary",["Current Situation",
"XXX"]];

player createDiaryRecord ["Diary",["Raven Platoon",
"20 men Platoon Alpha and Bravo Squads that can be assigned to Assault Weapons and Tactical Teams using radio channels 1-5. Only Squad leaders and Team leaders have access to the radio channels"]];

player createDiaryRecord ["Diary",["Mission Info",
"210 Enemy units present in the AO consistent of 40 groups. 27 of the 32 will respawn in time if specific objectives are not completed. The mission can be completed by two ways. Complete Objectives 1-4 and Go to the EVAC location for Extraction back to HQ or stay and fight! Take out all 4 Secondary Objectives and Eliminate all Hostile Forces in the AO."]];

player creatediarysubject ["weather","Weather"];

player createDiaryRecord  ["weather", ["info", "the weather is nice."]];

player createDiaryRecord  ["weather", ["next week", "the weather is bad."]];

player createDiaryRecord  ["weather", ["next year", "the weather will be the best."]];

//**********Mission cheats**********
//turns off Fatigue Sway & Recoil for player unit**********

{
	if (side _x == West) then 
	{
		_x enableFatigue false;
		_x setCustomAimCoef 0.1;
		_x setUnitRecoilCoefficient 0.2;
		_x addEventHandler 
		[
			"Respawn",
			{
				(_this select 0) enableFatigue false;
				(_this select 0) setCustomAimCoef 0.1;
				(_this select 0) setUnitRecoilCoefficient 0.2;
			}
		];
	};
} foreach (playableUnits + switchableUnits);

//Unlimited Ammo2**********
grantUnlimitedAmmo2 = compile preprocessFileLineNumbers "grantUnlimitedAmmo2.sqf";

addMissionEventHandler ["entityRespawned",{
   params ["_new","_old"];
   if (_new isKindOf "CAManBase") then {  
     [_new,face _old] remoteExec ["setFace"];
     [_new,speaker _old] remoteExec ["setSpeaker"];
   }
 }];

//Init UPSMON script
call compile preprocessFileLineNumbers "scripts\Init_UPSMON.sqf";

0 =[] execVM "autoflip.sqf";


 

Share this post


Link to post
Share on other sites

if (!hasInterface) exitWith {}; means dedicated server are out. That means you can't apply from server some MEH for playable (non-played units, but respawnable by Arma engine) as far as they stay on server.

 

As rule of thumb, all codes for player should be in initPlayerLocal.sqf  (initPlayerServer can help when code concerns player but should run on server. Some commands need that).

player is defined straight in initPlayerLocal.sqf

 

Init.sqf is fine for general code, in accordance with Initialisation_Order every time a code must run on every PC (and it runs locally each time a player joins. then, if a command/function is Effect Global, you can have multiple times for this/these effect(s) ).

 

 

Share this post


Link to post
Share on other sites

IDK I placed it in the initplayerSeverlocal.sqf  with no success. 

Share this post


Link to post
Share on other sites

@schatten so who would I do this ? 

Share this post


Link to post
Share on other sites
12 hours ago, avibird 1 said:

IDK I placed it in the initplayerSeverlocal.sqf  with no success. 

That doesn't exist.

Try in init.sqf but remove the if (!hasInterface) exitWith {}; if you test on dedicated server. (or place this line after if you are sure you need it for something else). All line with player (createDiaryRecord) should be in initPlayerLocal.sqf

Share this post


Link to post
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now

×