Blackops ACU mod not working in coop

Forum for Blackops Featured Mods.

Moderators: ExavierMacbeth, lt_hawkeye, OrangeKNight

Re: Blackops ACU mod not working in coop

Postby postscripter8 » 08 Oct 2019, 01:54

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 :-/
postscripter8
 
Posts: 3
Joined: 08 Oct 2019, 01:08
Has liked: 0 time
Been liked: 0 time
FAF User Name: postscripter8

Re: Blackops ACU mod not working in coop

Postby Uveso » 08 Oct 2019, 10:24

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:
https://github.com/FAForever/faf-coop-m ... .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:
http://forums.faforever.com/memberlist. ... ile&u=1934

Or join us on Discord:
https://discord.gg/jj9yGUP

Greetings, Uveso.
User avatar
Uveso
Supreme Commander
 
Posts: 1788
Joined: 11 Dec 2015, 20:56
Location: Germany
Has liked: 70 times
Been liked: 291 times
FAF User Name: Uveso

Re: Blackops ACU mod not working in coop

Postby postscripter8 » 08 Oct 2019, 19:19

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.
postscripter8
 
Posts: 3
Joined: 08 Oct 2019, 01:08
Has liked: 0 time
Been liked: 0 time
FAF User Name: postscripter8

Re: Blackops ACU mod not working in coop

Postby postscripter8 » 09 Oct 2019, 04:18

Ok, I've got this. Categories object is described in FAF wiki here.
Changing
Code: Select all
categories.url0001
to
Code: Select all
categories.COMMAND
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.
postscripter8
 
Posts: 3
Joined: 08 Oct 2019, 01:08
Has liked: 0 time
Been liked: 0 time
FAF User Name: postscripter8

Previous

Return to Blackops

Who is online

Users browsing this forum: No registered users and 1 guest