Jump to content
Kailux

[Warlords] Newbie Help - Change vehicle faction

Recommended Posts

Posted (edited)

Hi there,

im just trying to use the SFP BO105 Mod as a Bluefor buyable in my Warlords mission. Since in the mod the (Bundeswehr) BO-105, for whatever reason, is set to independent (AAF), the Bluefor AI gets a liiiittle bit crazy when i buy it and starts shooting it. 🤠

BigDaveHadSomeToo gave some advice on an old reddit, but im a total scripting noob and could use some help to get going.

 

I tried putting this into the description.ext but as a result i got this error.

The "grouping the chopper with an friendly AI" trick obviously is not an option.

class sfp_bo105_pah1; // class name in the mod, i read about inherent classes after ArmA told me about a missing base class. This fixed it.
class bo105: sfp_bo105_pah1 // bo105 shall be my modified bluefor custom class used below in MyWLAssetList.
{
	priority = 500;
	side = 1; // "1" should, according to class viewer, be bluefor.
	faction = "BWA3_Faction_Fleck"; // BWA3_Faction_Fleck is the Bundeswehr Faction already created by the BWMod i also use. Its also got a Helicopter 
};

class CfgWLRequisitionPresets
{
    class MyWLAssetList // --- class name used in the Init module
    {
        class WEST // --- assets available for BLUFOR
        {
        	class Aircraft
			{
				class bo105
                {
					cost = 10;
                    requirements[]={"H"};
                };
			};
		};
	};
};

Any hint or help is apprechiated.

 

07

Edited by Kailux

Share this post


Link to post
Share on other sites

The error seems to be related to the lack of image for your helo.
Try to add:

editorPreview = "\A3\EditorPreviews_F\Data\CfgVehicles\B_Heli_Light_01_dynamicLoadout_F.jpg";

 

in class, as generic picture of helo. Not tested.

Share this post


Link to post
Share on other sites

Didnt work sadly, tried several pictures. Thanks for the reply tho.

Share this post


Link to post
Share on other sites

Okay, totally weird but hey... this is what tried in the very first place because its just straight forward but it didnt work for me.

 

class sfp_bo105_pah1
{
		side = 1;
		faction = "BWA3_Faction_Fleck";
};

class CfgWLRequisitionPresets
{
    class MyWLAssetList // --- class name used in the Init module
    {
        class WEST // --- assets available for BLUFOR
        {
        	class Aircraft
			{				
				class sfp_bo105_pah1
                {
                    cost = 10;
                    requirements[]={"H"};
                };
				
            };
		};
	};
};

I just gave it another try and everything is working now like a charm.

Must have been a typical newbie error when i first tried it, maybe spelling or something else.

  • Like 2

Share this post


Link to post
Share on other sites

Glad you got it working.You can't avoid that zero divisor error by the way. It's just a part of Warlords - I'm pretty sure you can ignore it.

Share this post


Link to post
Share on other sites

Okay, its not solved 😕

 

For some reason, the AI i put on the base does not shoot at the chopper but AI called in later via the buy menu does. I suspect the "temporary pilot" who lands it on the helipad and then despawns might be AAF/independent too and cause that?

 

Already tried

typicalCargo[] = {"BWA3_Helipilot", "BWA3_Helipilot"};

and

 

crew[] = {"BWA3_Helipilot", "BWA3_Helipilot"};

with no result.

 

Again, any help apprechiated.

 

Btw: The chopper itself now is perfectly integrated into the warlords buy menu: no missing image, no zero divisor or any other error. It just gets still shot at by some own AI.

Im just thinking about if it isnt easier now to get permission from the SFP guys, modify the Bo-105 settings and reupload it as a bluefor faction. Never did that too but there seems to be more documentation out there for this.

Share this post


Link to post
Share on other sites

Yep I experienced that. If you spawn:

- custom units with native enemy side (see configfile >> "CfgVehicles" >> typeOf yourUnit >> "side") , the AIs will fire at him when dropped. The workaround is to wait for !isnull objectParent yourUnit then change the side of the unit. 

- For custom aircraft, yes, the Warlord creates the crew depending on native side of the vehicle... So, you have to wait for the crew and make them join the right side.

 

This script should work on server:

 

0 = [] spawn {
  While {true} do {
    _allUnits = allUnits select {side group _x != side _x && {alive _x} && {objectParent _x isKindOf "air"} && {isNil {_x getVariable "unitPassedWl"}}};
    {
      [_x] joinSilent group _x;
      _x setVariable ["unitPassedWl",true];
    } forEach _allUnits;
    uisleep 2;
  }
};

 

Perhaps it could be optimized with specific variable for spawned units...

 

 

  • Like 1

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

×