A Full New Faction for FAF Offline.
-
Yea, how the heck did you do that!?
-
This post is deleted! -
@SplashGG How did you manage that?
-
It's a hack where you run lua from a mod's LobbyOptions.lua and find your way into the lobby's code from there.
-
@RavenCurow Hello, copied from a previous reply I posted on Discord:
lobbyoptions.lua I'm using it because it is the earliest point where a normal mod code can run in the lobby. while loading, its ImportModAIOptions() imports lua/AI/LobbyOptions/lobbyoptions.lua from every installed mod, to read the mod's AI settings, importing a file runs all of its code, so besides giving back an empty AIOpts, ours adds Sentinels (my faction) to the lobby. from FAF's faction list factions.lua i copy the UEF entry, rename it to Sentinels, and give it our icons and our commander id, then it is added to the end of the list, so lobby and my code shares the same list that way the lobby sees Sentinels(my faction) as faction 5 or (6 if Nomads enabled) then i fill the extras needed: hover desc, list of AI names (without one the lobby errors), and purple skin I keep random as the default, FAF works out which number means random with "last faction + 1" before we add ours, so i apply small fix button and lobby background images are loaded from game folders that mods can't add files to. I catch those two image loads and swap in the files from the mod extra fix for lobby.lua private list of faction names, it uses that list the background, skin and chat color. In this case my Sentinels fac is 5, which that list calls "random faction" , this list is private to the file, but one lobby function uses it so I wait for that function to be defined, then use Lua's debug tools to reach the list and rewrite it with real names (Sentinels name now included) mod turned to ON when anyone presses launch. after launch, so FAF loads its normal hooks like any mod's. hook/lua/factions.lua adds Sentinels to the game's faction list again. and Voalah!Testing Video
However, I'll be contributing to FAF to add an official way to easily add custom factions, since this method is very “hacky.” -
@SplashGG Oh, you cheeky bastard. So you put the lobby code in the AI options to import the functions earlier than is normally checked so it bypasses the lockout.
-
Yeah, with the advent of all the new factions that are going to pop up sooner or later, something is going to need to be done to help make them all compatible with each other. While an in-game faction picker is nice (that's what I did), they're all very obviously incompatible with each other.
(shameless self-promotion of my own)

-
@Zopto Yea, not really a way to make that work without a patch for each one. Your's looks cool. Much more grounded looking than the neon glow of mine. Kinda almost has an ancient asthetic with te pyramids and the subdued colors.
-
@Zopto Yea, not really a way to make that work without a patch for each one. Your's looks cool. Much more grounded looking than the neon glow of mine. Kinda almost has an ancient asthetic with te pyramids and the subdued colors.
I did make a mod called Universal Faction Picker, which is on the FAF vault, that is designed to help alleviate the problem. Faction mods only need to add a file on their end (so I don't have to keep updating the picker myself) to add themselves to the list. Documentation is simple enough, you can just have your AI agent read it and it should figure it out no problem. Getting everyone to use a single standard is hard, regardless of whatever it is.
-
Success!

For fun, I've also uploaded a BlackOps addon for my faction to the Vault so anyone who wants to play with BlackOps can.
Hello! It looks like you're interested in this conversation, but you don't have an account yet.
Getting fed up of having to scroll through the same posts each visit? When you register for an account, you'll always come back to exactly where you were before, and choose to be notified of new replies (either via email, or push notification). You'll also be able to save bookmarks and upvote posts to show your appreciation to other community members.
With your input, this post could be even better 💗
Register Login