Jump to content
Sign in to follow this  
lightspeed_aust

Make Afrenian Army enemy?

Recommended Posts

I know I will be told to search but I have and could not quite find the suitable solution.

I want to use the Afrenian units on a new campaign I'm doing on Lingor but want them to be enemy.

I use UPSMON script and at the moment I would create Afrenian units add a senior opfor unit as the leader of group and set presence at zero.

But I'm not sure this is the easiest/most logical way to do it.

Any advice please.

Thanx

Lighty.

Share this post


Link to post
Share on other sites
I know I will be told to search but I have and could not quite find the suitable solution.

I want to use the Afrenian units on a new campaign I'm doing on Lingor but want them to be enemy.

I use UPSMON script and at the moment I would create Afrenian units add a senior opfor unit as the leader of group and set presence at zero.

But I'm not sure this is the easiest/most logical way to do it.

Any advice please.

Thanx

Lighty.

Can you do it by script, or do you need to place the units via the editor?

Here is a mission I made you to show how to do it via the editor. If you need a script, I might be able to help.

A quick run down though for an editor placed unit:

1). Add an opfor unit in the editor but set his Probability of presence to "0", and set his rank to sargeant or something higher than your Afrenians who are going to be in his group.

2). Make him the leader of your Afrenian by dragging a group line from each of your Afrenes to the opfor guy (who will never spawn).

3). Don't let him see you without shooting him first : P

How's your new campaign shaping up by the way? Good luck with it.

Thanks

Rough Knight.

Share this post


Link to post
Share on other sites

I would edit the mission.sqm.

side="WEST"; » side="EAST";

With Notepad++ you can perform search and replace within marked text. So you can convert a lot of units with just a few clicks. Also, next time you load the mission after that, all changed units will have red icons in the editor.

Share this post


Link to post
Share on other sites

Editing the mission.sqm is currenty the best option IMHO. But anyways a scripting command would be very useful. I'm hopin for it in Arma 3.

Or you can vote for the dev-heaven issue in my signature.

Share this post


Link to post
Share on other sites

thanx for the responses - they are all in line with what i'd been looking at but none are ideal.

was hoping for a way to convert all afrenians quickly and easily rather then picking through mission.sqm for all afrenian units only - not usmc.

if i wanted to do it by assigning lead opfor to each upsmon patrol then each patrol would need an opfor leader which again is fiddly.

Share this post


Link to post
Share on other sites
if i wanted to do it by assigning lead opfor to each upsmon patrol then each patrol would need an opfor leader which again is fiddly.

I think the only other option may be a script. But by the time you mess around with that, it will be much easier to use one of the above methods. I do actually have a rough scipt which you could modify if required (or I could help if not). It will generate a group and a patrol marker then execute UPSMON.

Share this post


Link to post
Share on other sites
How about making yourself/your unit OPFOR? :confused:

Thanks for ignoring me :rolleyes:

Share this post


Link to post
Share on other sites

Sorry did not ignore you. I want to keep players blufor. I did try adding an opfor leader without presence which does switch sides, but again we become opfor. Thanx for suggestion though. Lighty

Share this post


Link to post
Share on other sites
Sorry did not ignore you. I want to keep players blufor. I did try adding an opfor leader without presence which does switch sides, but again we become opfor. Thanx for suggestion though. Lighty

Sorry Lighty, I think I am confused about what you are trying to do? Are the players in the same group as the east Afrenians you are generating but you want to be side west?

Share this post


Link to post
Share on other sites

1) Open a blank test mission in editor

2) Create OPFOR units in editor with respective unit types (TL, GL, Medic etc)

3) Create the BLUFOR Afrenian army team

4) Save mission

5) Open up mission.sqm and copy all class names from both unit equivalents to a separate document

6) Open actual mission

7) Create UPSMON squads as opfor units used in test mission. (Ie Taki Army TL = Afrenian Army TL)

8) After mission is finished, save mission. Quit editor

9) Open mission.sqm and use CTRL-H to replace all unit types from their Taki models to Afrenian equivalents.

10) Save mission.sqm in notepad and open the mission in the editor. Save from within the editor and export the mission.

OPFOR will be afrenian army. No strings attached :)

This also works with player units btw.

Share this post


Link to post
Share on other sites

Are you making this MP compatible? If not then you could also possibly use the "addSwitchableUnit" and ""selectPlayer" commands to switch into whatever unit you want when the mission is setup.

I did this on one of my campaign missions where I was spawning Dualan civilians (armed) which are by default side "EAST". I was able to spawn them as side "Resistance" by using the probability of presence "0" method via script, make them switchable, addswitchable all the units then play as whoever you want. Perhaps this is also possible with what you are trying to do.

Share this post


Link to post
Share on other sites

I made these last functions last night as I needed to make East hostile to Civilians. One or all might work for you mate.

In your init.sqf:-

fn_unitSwitchSide = compile preprocessFileLineNumbers "func\fn_unitSwitchSide.sqf";

fn_grpSwitchSide = compile preprocessFileLineNumbers "func\fn_grpSwitchSide.sqf";

fn_facSwitchSide = compile preprocessFileLineNumbers "func\fn_facSwitchSide.sqf";

fn_unitSwitchSide.sqf will switch a unit to another side... returns the unit.

fn_grpSwitchSide.sqf will switch a group to another side... returns the group.

fn_facSwitchSide.sqf will switch a faction to another side... returns the list of groups.

The scripts....

fn_unitSwitchSide.sqf:-

//*******************************************************************
//*******************************************************************
//**
//**	Name: fn_unitSwitchSide.sqf
//**	Desc: Function to change a units side
//**	Use: _unit = [group,WEST] call fn_unitSwitchSide;
//**	Returns: New unit
//**	TWIRLY - April 10th 2012
//**
//*******************************************************************
//*******************************************************************
private ["_unit","_newside","_newgroup"];
_unit = _this select 0;
_newside = _this select 1;
if (side _unit == _newside) exitWith {hint "fn_unitSwitchSide.sqf\nSame side error!"};
_newgroup = createGroup _newside;
[_unit] joinSilent grpNull;
[_unit] joinSilent _newgroup;
_unit

fn_grpSwitchSide.sqf:-

//*******************************************************************
//*******************************************************************
//**
//**	Name: fn_grpSwitchSide.sqf
//**	Desc: Function to switch a group's side to another side
//**	Use: _newgrp = [group,WEST] call fn_grpSwitchSide;
//**	Returns: New group
//**	Author: TWIRLY - April 10th 2012
//**
//*******************************************************************
//*******************************************************************
private ["_group","_newside","_newgroup"];
_group = _this select 0;
_newside = _this select 1;
if (side _group == _newside) exitWith {hint "fn_grpSwitchSide.sqf\nSame side error!"};
_newgroup = createGroup _newside;
{[_x] joinSilent grpNull;[_x] joinSilent _newgroup} foreach units _group;
_newgroup

fn_facSwitchSide.sqf:-

//*******************************************************************
//*******************************************************************
//**
//**	Name: fn_facSwitchSide.sqf
//**	Desc: Function to switch a group's entire side to another side
//**	Use: _newgrp = [group,WEST] call fn_facSwitchSide;
//**	Returns: List of new groups
//**	Author: TWIRLY - April 10th 2012
//**
//*******************************************************************
//*******************************************************************
private ["_group","_newside","_faction","_allgrps","_newgrps","_newgrp","_i","_grp"];
_group = _this select 0;
_newside = _this select 1;
_faction = faction leader _group;
if (side _group == _newside) exitWith {hint "fn_facSwitchSide.sqf\nSame side error!"};
_allgrps = allGroups;
_newgrps = [];
_newgrp = [];
for "_i" from 0 to (count _allgrps)-1 do {
_grp = _allgrps select _i;
if (faction leader _grp == _faction and not (_grp in _newgrps)) then {
	_newgrp = createGroup _newside;
	{[_x] joinSilent grpNull;[_x] joinSilent _newgrp} foreach units _grp;
	_newgrps set [count _newgrps,_newgrp];
};
};
_newgrps

Call examples:-

_unit = [_unit,west] call fn_unitSwitchSide;    //switch one unit to WEST

_group = [_group,east] call fn_grpSwitchSide;   //switch one group to EAST

_groups = [_group,west] call fn_facSwitchSide;  //switch a whole faction to WEST... the function needs a group as input

Hope you... or someone... gets some joy out of them.

EDIT: Added demo mission here.

Edited by twirly
Added stuff

Share this post


Link to post
Share on other sites

You really shouldn't complicate things if all you want is some Afrenians in opfor.

Changing mission.sqm should work, however it will need to be done ever time after you save the mission and before you turn it into a PBO. Not sure if it'll work if you turn it into PBO in-game, you might have to turn it into PBO with an extrenal tool.

What I find easier is simply giving each Afernian group a Takistani leader with probability of presence being 0. Don't place the UPSMON init in the Takistani solider's init line, but rather in the init line of whoever will become the leader once the game decides the Takistani leader will not spawn. In general, that would be the highest ranking soldier in the group, and in case of equal ranks, the one linked first is chosen (so make sure nobody has a higher rank than whoever you want to lead the group, and that you always link the leader to the 0% presence takistani before you link the rest of the group).

If you still can't get either of the above to work, the only thing I can tell you is to post a youtube video to show what the hell you're doing wrong. Because it really should be *that* simple.

If you want to change sides during mission via script (which UPSMON will not like! Unless you do it on units right as they spawn and before you start UPSMON on them!), you will have to create a new EAST group, and have the Afrenians join it using the joinSilent command.

Share this post


Link to post
Share on other sites
If you want to change sides during mission via script (which UPSMON will not like! Unless you do it on units right as they spawn and before you start UPSMON on them!), you will have to create a new EAST group, and have the Afrenians join it using the joinSilent command.

Which is exactly what one of the functions above does!

_group = [afrenian_group,east] call fn_grpSwitchSide;

How hard is that?

Edited by twirly

Share this post


Link to post
Share on other sites

@galzohar

I had actually got it to work the way you suggested but it seemed like there should be an easier way particularly if I'm creating 15 different upsmon patrols.

Share this post


Link to post
Share on other sites

I think this would work if you had several groups, it would be much the same for all three calls. Replace groupname with _x and create an array of the group names.

{_x = [_x,east] call fn_grpSwitchSide; } foreach [_group1,_group2,_group3] ; //switch one group to EAST

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
Sign in to follow this  

×