种族增加MOD

Custom Faction Support mod v3

http://forums.gaspowered.com/viewtopic.php?t=30795

Custom Faction Support mod v3第三方种族支持MOD

The last couple of days I’ve been working on this mod. It’s a mod forForged Alliance that can be used by other modders to make their factionmod compatible with other faction mods (that also rely on this mod).Additionally it allows to change the availability of the new faction(s)through the mod manager.

What it does作用

  • Makes it easier for modders to add their own faction and keep compatibility with other faction mods
    使MOD制作者可以更轻松地添加他们制作的种族并使他们可以和其它种族并存
  • Adds functionality that makes new factions available based on the status of specific mods in the mod manager
    增加可以在MOD管理器中选择/不选择新种族的功能

What it doesn’t

  • Add a new faction
  • Add other playable content

Requirements

  • Supreme Commander: Forged Alliance fully patched to version 1.5.3599 (it may work with older versions but I didn’t test that)
    适用于最高指挥官:FA的最新版3599,在其它版本也可能适用,但是并没有测试

Download下载
mirror 1
mirror 2

How to use怎样适用
This mod overwrites the stock FA files (doesn’t hook) and thereforit needs to be in the gamedata folder. This is also why there isn’t aZIP version available. It also isn’t Vault compatible.

Here’s what you need to do to use this mod for your own faction mod:

  • Put the SCD file in the gamedata folder
  • In your own faction mod add a folder called ‘CustomFactions’ to the lua folder. In /lua/CustomFactions and create a new lua file in it. The name of the file doesn’t matter but it must have the .lua extension. This file is meant to contain the data for your new faction so it’s recommended to give it an appropriate name.
  • Open the new file and copy-paste in this file the Factions tablefound in the stock file /lua/factions.lua . Edit the faction data asyou see fit for your new factions, delete the excess faction entries.Then save the file.

If you want to make your faction available only when one or moremods are selected in the mod manager then you have to complete thesesteps aswell:

  • Open the file for your faction in /lua/CustomFactions again
  • In the Factions table, in the entry for your new faction add a new table variable called ‘ModsPrerequisite’. In this table variable list the UID’s of the mods you want enabled before your faction can be selected in the game lobby.
  • Save file and test

note: The mod prerequisite uses mod UIDs so you can only use regular mods that can be enabled through the mod manager.
note: The modsspecified as prerequisite don’t have to do anything. You can simplycreate a mod which only contains the mod_info.lua file and use it’s UIDto toggle your faction(s).
note: If you get confused by the above then check the readme file included in this mod, it contains an example.

Additional information and notes

  • Don’t include the files in this mod in your own mod. Instead provide this mod with your own mod. This way you keep compatibility with other faction mods.
  • This mod overwrites the files \lua\factions.lua and\lua\ui\lobby\lobby.lua . It’s not compatible with mods that alsochange any of these files.
  • This mod is inspired by Sorians AI support mod.
  • It took quite some time to make this mod, much more than youwould think when looking through the code. I hope you find it useful!

Please let me know what you think. Also please report any errors you find. Thanks!

这个MOD的作用是用来提供玩家自制种族的管理功能,主要是可以使种族之间共存,并提供选择功能,玩家可以选择启用/不启用那个新种族。