Custom Faction

Workshop for all Mission Engineer Comrades. Home of the FA Mission Making Template.

Custom Faction

Postby anfo » Mon Aug 15, 2016 8:38 am

Hi Fer

This Bohemia post from 2 years ago more or less resembles what I also am trying to achieve, where our clan has a custom faction that I am attempting to add.

(Credit CaptainGalaxy, 5th May 14, Bohemia Forum)
Hi F3 team.
I've been using F3 group markers for all my missions and it worked just great for vanilla units and factions (NATO, CSAT, AAF, FIA). Currently I'm building a mission using "Russians" addon and I can't make the group markers appear on the map. I tried to change:
Code: Select all
case "AAF":

to
Code: Select all
case "sud_russians":

in the folk_setLocalGroupMarkers.sqf but that didn't work. Could you give me a hint on how to add third party factions to the group marker script?

EDIT: I discovered that the class name for Russains is SUD_RU, but that doesn't work as well...


In the f_setLocalGroupMarkers_Blufor.sqf file I've added some new lines to accommodate the change:

Code: Select all
// MARKERS: BLUFOR > 39BN
// Markers seen by players in 39BN slots.

if (_unitfaction in ["a39th_battalion"]) then {

   //B COY, 1PL, 1 Section, Alpha/Bravo FT
   ["Grp21A1",_ft, "Alpha", "ColorRed"] spawn f_fnc_localSpecialistMarker;

};


I am certain our faction name is correct however when I preview in Eden, a debug message appears relating to line 31 in fn_localSpecialistMarker.sqf. The markers do not work either.

Is there another location the custom faction needs to be defined to possibly fix this?
anfo
 
Posts: 4
Joined: Sat Aug 13, 2016 4:15 am

Re: Custom Faction

Postby darkChozo » Mon Aug 15, 2016 1:38 pm

f_fnc_localSpecialistMarker is for marking individual objects (usually units). The default ORBAT uses it for marking medics, if you want an example.

If you're trying to mark a group, you'll want to use f_fnc_localGroupMarker instead. Syntax should be exactly the same, just change the function name.
darkChozo
Host
 
Posts: 199
Joined: Fri Aug 14, 2015 12:48 pm

Re: Custom Faction

Postby anfo » Mon Aug 15, 2016 3:56 pm

darkChozo wrote:f_fnc_localSpecialistMarker is for marking individual objects (usually units).

I never edited the fn_localSpecialistMarker.sqf file, I only referred to it because debug mentioned an error in it after I edited the f_setLocalGroupMarkers_Blufor.sqf file.

darkChozo wrote:If you're trying to mark a group, you'll want to use f_fnc_localGroupMarker instead. Syntax should be exactly the same, just change the function name.

Do you mean the fn_localGroupMarker.sqf file? It appears it's syntax is not the same as f_setLocalGroupMarkers_Blufor.sqf?
anfo
 
Posts: 4
Joined: Sat Aug 13, 2016 4:15 am

Re: Custom Faction

Postby darkChozo » Mon Aug 15, 2016 4:22 pm

In your code, you're calling f_fnc_localSpecialistMarker for what looks like a group. You should be calling f_fnc_localGroupMarker instead.
darkChozo
Host
 
Posts: 199
Joined: Fri Aug 14, 2015 12:48 pm

Re: Custom Faction

Postby anfo » Tue Aug 16, 2016 3:05 am

Thanks darkChozo, I'm not a coder, so your patience is appreciated

In summary you're saying, I should change from this:

Code: Select all
// MARKERS: BLUFOR > 39BN
// Markers seen by players in 39BN slots.

if (_unitfaction in ["a39th_battalion"]) then {

   //B COY, 1PL, 1 Section, Alpha/Bravo FT
   ["Grp21A1",_ft, "Alpha", "ColorRed"] spawn f_fnc_localSpecialistMarker;

};


to

Code: Select all
// MARKERS: BLUFOR > 39BN
// Markers seen by players in 39BN slots.

if (_unitfaction in ["a39th_battalion"]) then {

   //B COY, 1PL, 1 Section, Alpha/Bravo FT
   ["Grp21A1",_ft, "Alpha", "ColorRed"] spawn f_fnc_localGroupMarker;

};


The penny has just dropped I think. :)
anfo
 
Posts: 4
Joined: Sat Aug 13, 2016 4:15 am

Re: Custom Faction

Postby anfo » Tue Aug 16, 2016 7:05 am

Sorry to bother again, but I must be still missing something.

As I mentioned previously, I added custom faction code to the top of the f_setLocalGroupMarkers_Blufor.sqf (thanks darkChozo for the correct function)

Code: Select all
// MARKERS: BLUFOR > 39BN
// Markers seen by players in 39BN slots.

if (_unitfaction in ["a39th_battalion"]) then {

   //B COY, 1PL, 1 Section, Alpha/Bravo FT
   ["Grp21A1",_ft, "Alpha", "ColorRed"] spawn f_fnc_localGroupMarker;

};


However I'm still getting debug errors and the markers do not work

Eden setup:
http://imgur.com/a/VYdKw

Debug error:
http://imgur.com/a/Arfm9

Outcome:
http://imgur.com/a/mUPoZ

I hope I've made it easy to see where I have gone wrong.
anfo
 
Posts: 4
Joined: Sat Aug 13, 2016 4:15 am

Re: Custom Faction

Postby darkChozo » Wed Aug 17, 2016 4:51 pm

Judging by the error message, you're trying to call a function's file instead of just calling the function directly. Somewhere in your files you have "[some stuff] spawn f_fn_localGroupMarker.sqf", which should be changed to "[stuff] spawn f_fnc_localGroupMarker".

Just to give you an idea of what's going on, there's a function defined in the file f_fn_localGroupMarker.sqf. You can actually execute this file directly, but you'd have to read and compile it every time which is slow. So instead, when you load up the mission the file gets compiled and stored as a function, f_fnc_localGroupMarker, which is a lot faster to access because you skip reading and compiling the file.

Also, if you want more timely help I'd recommend using our Discord's missionmaking channel, you can ask questions and usually get answers pretty quick.
darkChozo
Host
 
Posts: 199
Joined: Fri Aug 14, 2015 12:48 pm


Return to ArmA 3: Mission Making & F3 Development

Who is online

Users browsing this forum: No registered users and 1 guest

cron