Modifier/Requirement Auto-Generator

作者 thecrazyscot·版本 v1.0·更新於 2018-10-23

Modifier/Requirement Auto-Generator

模組介紹 作者原文

Modifier/Requirement Auto-Generator

我厭倦了每當我創建一個修改器時都必須手動更新多個表,並且一旦你擁有相當數量的修改器就會變得非常繁瑣,因爲代碼可能會變得非常長。

我在SQL中創建了這個Modifier Generator,這樣我就可以將Modifiers和ModifierArguments中的所有修飾符字段輸入到一行中,並且兩個表都將自動更新。修飾符附件也將自動爲(幾乎)所有表生成,例外是

GreatPersonIndividualActionModifiers和GreatPersonIndividualBirthModifiers。

我對所有需求表(Requirements,RequirementArguments,RequirementSets,RequirementSetRequirements等)做了同樣的事情,因此一行將更新所有相關表。

當你一次創建多個修改器時,這是最有用的......當創建一些修改器時,它將具有更多有限的用途,儘管你當然仍然可以使用它。

我確實在過去一週一直在教自己SQL,所以如果真正瞭解SQL的人想看看它來改進/優化它我會很高興如果你這樣做,只要你告訴我我做了什麼錯誤或效率低下

我不知道這對其他人是否有用,但我想我會分享它。

這是代碼:

/*

SQL Modifier Generator for Civilization VI

Created by thecrazyscotsman (7 Dec 2016)

This framework allows you to input all the relevant parts of a modifier and/or a requirement into a single line. The rest is automatically generated for you.

EXAMPLE:

INSERT INTO ModTempTable (ModifierId, RunOnce, Permanent, OwnerRequirementSetId, SubjectRequirementSetId, ModifierType, Name, Value, Extra, Name2, Value2, Extra2, Name3, Value3, Extra3, AttachedTo)

VALUES

("MODIFIER_ADD_RICEFOOD", 0, 0, NULL, "REQUIREMENT_PLOT_HAS_RICE", "MODIFIER_CITY_PLOT_YIELDS_ADJUST_PLOT_YIELD", "YieldType", "YIELD_FOOD", NULL, "Amount", 1, NULL, NULL, NULL, NULL, "BUILDING_GRANARY");

INSERT INTO ReqTempTable (RequirementSetId, RequirementSetType, RequirementId, RequirementType, Inverse, Name, Value, Extra, Name2, Value2, Extra2)

VALUES

("REQUIREMENT_PLOT_HAS_RICE", "REQUIREMENTSET_TEST_ALL", "PLOT_HAS_RICE", "REQUIREMENT_PLOT_RESOURCE_TYPE_MATCHES", 0, "ResourceType", "RESOURCE_RICE", NULL, NULL, NULL, NULL);

These inputs will generate and insert the correct rows on the Modifiers, ModifierArguments, Requirements, RequirementArguments, RequirementSetRequirements, and RequirementSets tables. It will also automatically attach the modifier to the Granary.

Modifier attachments are automatically created (using the AttachedTo field), with the exception of these two:

GreatPersonIndividualActionModifiers

GreatPersonIndividualBirthModifiers

In order to correctly generate the modifier attachment, the correct prefix must be used (i.e. BUILDING). Custom mod strings must go after the prefix (i.e. BUILDING_TCS_SALOON).

*/

/* CREATE FRAMEWORK -- DO NOT CHANGE */

--Temporary tables dropped at end

CREATE TABLE ModTempTable

(

ModifierId TEXT NOT NULL,

RunOnce BOOLEAN NOT NULL DEFAULT 0,

Permanent BOOLEAN NOT NULL DEFAULT 0,

OwnerRequirementSetId TEXT,

SubjectRequirementSetId TEXT,

ModifierType TEXT NOT NULL,

Name TEXT,

Value TEXT,

Extra TEXT,

Name2 TEXT,

Value2 TEXT,

Extra2 TEXT,

Name3 TEXT,

Value3 TEXT,

Extra3 TEXT,

Name4 TEXT,

Value4 TEXT,

Extra4 TEXT,

Name5 TEXT,

Value5 TEXT,

Extra5 TEXT,

AttachedTo TEXT

);

CREATE TABLE ReqTempTable

(

RequirementSetId TEXT,

RequirementSetType TEXT,

RequirementId TEXT,

RequirementType TEXT,

Inverse BOOLEAN NOT NULL DEFAULT 0,

Name TEXT,

Value TEXT,

Extra TEXT,

Name2 TEXT,

Value2 TEXT,

Extra2 TEXT

);

/* END CREATE FRAMEWORK */

/* BEGIN MOD INPUTS */

--INPUT MODIFIERS

INSERT INTO ModTempTable (ModifierId, RunOnce, Permanent, OwnerRequirementSetId, SubjectRequirementSetId, ModifierType, Name, Value, Extra, Name2, Value2, Extra2, Name3, Value3, Extra3, Name4, Value4, Extra4, Name5, Value5, Extra5, AttachedTo)

VALUES

--("ModifierId", 0, 0, "OwnerRequirementSetId", "SubjectRequirementSetId", "ModifierType", "Name", "Value", "Extra", "Name2", "Value2", "Extra2", "Name3", "Value3", "Extra3", "Name4", "Value4", "Extra4", "Name5", "Value5", "Extra5", "AttachedTo");

--INPUT REQUIREMENTS

INSERT INTO ReqTempTable (RequirementSetId, RequirementSetType, RequirementId, RequirementType, Inverse, Name, Value, Extra, Name2, Value2, Extra2)

VALUES

--("RequirementSetId", "RequirementSetType …

安裝與使用 安裝:按包內說明操作

  1. 解壓本站下載的壓縮包,先讀包內的 readme / 說明檔案。
  2. 這類遊戲沒有通用的模組管理器:有的模組直接替換遊戲檔案、有的放進遊戲專屬的 Mods 資料夾、有的要先裝遊戲對應的社群載入器或工具,以包內說明為準。
  3. 嚴格按說明放置檔案;標註「前置依賴」的模組需要把依賴一併裝好。
  4. 啟動遊戲確認載入成功;部分遊戲需要在設定或模組選單裡手動啟用。

不同遊戲、不同模組的安裝位置差異很大,包內說明是最可靠的依據。

檔案與校驗

檔案名稱
Modifier_Requirement Auto-Generator
檔案大小
2.0 KiB
SHA-256
48365c06678737e017b4853df26c0dcfe174800f63f381ce9ba1408a8274d5b0
入庫時間
2026-10-08 05:37