Page 2 of 2

Re: Blackops ACU mod not working in coop

PostPosted: 08 Oct 2019, 01:54
by postscripter8
Did the topic die or was it resolved elsewhere (how)?

My first post, pardon myself, hello everyone.

So I found a fancy piece of code in Blackops ACU mod sources (aeoncleanse user's repo named mods file named factions.lua, sorry I'm not yet permitted to post a direct URL), quote:
Code: Select all
Factions[1].InitialUnit = "eel0001"
Factions[2].InitialUnit = "eal0001"
Factions[3].InitialUnit = "erl0001"
Factions[4].InitialUnit = "esl0001"

What the above effectively does, is it replaces the command unit of each faction from vanilla SC/SC:FA/FAF defaults (which for sake of completeness are: UAL0001 for Aeon, UEL0001 for UEF, URL0001 for Cybran and XSL0001 for Seraphim) with those new values. So it basically scraps the pre-existing ACUs blueprints and replaces them with entirely new units with new blueprint IDs. That's a bold move, but let's go on.

Now when we check e.g. second Cybran vanilla SupCom mission named Artifact, in FAForever/faf-coop-maps github repository, on the line 2320
of SCCA_Coop_R02_script.lua (constituting the mission scenario script) within the definition of function M3P1Complete there is this line:
Code: Select all
ScenarioFramework.CreateUnitNearTypeTrigger(M3PlayerReachedGate, ScenarioInfo.M3Gate, ArmyBrains[Player1], categories.url0001, 2)

which effectively creates a new trigger (which upon activation continues the mission scenario) which can only be triggered by moving unit with exact blueprint ID url0001 to tha gate. And if you play with Blackops ACU mod enabled you have no way of possibly doing it, because the only ACU you're given has the ID of erl0001.

What is the best continuation now? I'm not exactly sure how to fix this without changing some architectural foundations of either FAF coop map or Blackops ACU mod.

PS: Am I a bad person for necroing this old thread? I just tested it and the issue persists :-/

Re: Blackops ACU mod not working in coop

PostPosted: 08 Oct 2019, 10:24
by Uveso
Hello postscripter8,

you can't just change the unitID from a unit.
But you can change the script inside the map.

Instead of only using the category url0001 you can use the original and Black Ops unitID.

Code: Select all
ScenarioFramework.CreateUnitNearTypeTrigger(M3PlayerReachedGate, ScenarioInfo.M3Gate, ArmyBrains[Player1], categories.url0001 + categories.erl0001, 2)

(The "+" inside categories.url0001 + categories.erl0001 means "OR" not "AND")

Link to the coresponding line inside FAF-coop repository: ... .lua#L2320

Speed2CZ was the last one who changed the code of this map.
Maybe you want to ask him, if he can change this for you.
(Or you can make a PR and ask for merge it)

You can contact Speed2cz over this forum: ... ile&u=1934

Or join us on Discord:

Greetings, Uveso.

Re: Blackops ACU mod not working in coop

PostPosted: 08 Oct 2019, 19:19
by postscripter8
Hello Uveso, you are such a good person :-)
I appreciate your answer, thank you very much.

I had no idea the + sign can be used like that. What does make it do it? It's not LUA specific, is it?

Honestly though, even if it indeed works the way you described, I have a feeling it is just a workaround and not a definite "correct" solution.
It would only work with both vanilla and BlackOps ACU mod, but if there was another mod replacing the initial faction unit,
the objectives in question still wouldn't be achievable. In this sense it would remain broken.

The obvious and most straightforward approach to make it right, in my opinion,
would be to somehow make use of Factions[3].InitialUnit instead of categories.url0001.
And that idea brings a lot of questions, hence my pitiful call for help.

Where is the categories object defined? What type of objects are categories.url0001 and categories.erl0001?
I can tell Factions[3].InitialUnit is a string property, but what does lie beneath the categories object? Does it have to be used at all?
Or maybe does it already have an ACU category? That would also solve the problem.
I'd be really grateful for a link to framework/API documentation if there is any available.

Besides, I'd like to contribute. When we sort this out, I'll gladly make a pull-request myself.

Re: Blackops ACU mod not working in coop

PostPosted: 09 Oct 2019, 04:18
by postscripter8
Ok, I've got this. Categories object is described in FAF wiki here.
Code: Select all
Code: Select all
did the trick. Still don't know what kind of object those categories are, yet they're definitely magical (not plain string in particular). I'll scout the other missions for similar flaws. I'm pretty sure Vanilalla SupCom Cybran mission 5 got the same.