中2全战复杂的互动事件教程 COMPLEX INTERACTIVE EVENTS TUTORIAL
原贴地址:http://www.twcenter.net/forums/showthread.php?t=472792
专贴时请注明原贴地址和翻译作者,谢谢!!!!
COMPLEX INTERACTIVE EVENTS TUTORIAL:
复杂的互动事件教程
Last Updated: 10/12/11
Section One: Basic Setup第一部分基础
Section Two: Trait and Ancillary Trigger Events第二部分 技能和随从事件
Section Three: Events That Unlock Buildings 第三部分 事件解锁建筑
Section Four: Events That Unlock Units第四部分 事件解锁单位
Section Five: Cloned Events第五部分 克隆事件
Section Six: Events That Spawn Armies & Characters第六部分 刷兵
Some people liked the numerous interactive events in my mod, Rule Britannia, and suggested that I put together a tutorial on complex events. Here is my attempt at doing so. The examples given are from my own mod so some of the buildings, traits, ancillaries, and what have you are not common to all but it should be an easy matter to extrapolate from them what you'll need to make similar events to suit your own purposes.
一些人喜欢在我的MOD里找各种互动事件。Rule Britannia建议我做一个互动事件的完整教程。这就是我正在努力做的下面的例子是从我自己的MOD里面找出来的,也许并不常见,但是你可以参考做出类似的达到你自己的目的的事件。
To start, I will assume that you already have a basic proficiency with simple interactive events. If you need to brush-up, Swagger made an excellent tutorial on this subject HERE.首先,我假设你已经有基本的能力做简单的互动事件。如果你需要,这里有关于互动事件的教程。
Section One:
BASIC SETUP
SETTING-UP EVENT COUNTERS: 建立事件计数器
Make a script area where you establish your event counters. This should precede the event scripts so the game has read each of them prior to their being activated. Have a counter for both “accepted” and “declined” responses for yes/no events and a single entry for those events which are simply on or off.
建立一个脚本区用来定义你的事件计数器。这个需要在事件脚本前完成,这样游戏会在他们被激活前读取这些计数器。
接受或拒绝事件都会有个计数器,事件就会被简单的打开或关闭
Code:代码
;###################### Event Counter Setup ######################
monitor_event FactionTurnStart
add_events
event counter event_title1_accepted
event counter event_title1_declined
event counter thing_happened1
date 0
end_add_events
terminate_monitor
end_monitor
STAGGERING EVENTS WITH TIMERS: 强大的事件和计数器
If you have several event types that are similar and you want to be sure they are spaced out from one-another, you may make a special timer that resets itself and only permits certain events at certain points in the cycle. Here is an example of such a timer I use to stagger my council events:
如果你有几种类似的事件,你又需要让他们相互独立。你可以做个特定的计数器。每到一些特定的事件点上就重置计数器。下面有一个这样的计数器的例子,我用来循环我的委员会事件。
;;;;;;;;;; Council Timer ;;;;;;;;;;;
declare_counter counciltimer
monitor_event FactionTurnStart FactionIsLocal
inc_counter counciltimer 1
if I_CompareCounter counciltimer > 19
set_counter counciltimer 0
end_if
end_monitor
You will see in the following events that the Council Timer is used as a condition for the event to happen. This ensures that the player is not offered more than one type of council at a time and that a particular council repeats at regular, set intervals.
你会看到后面的事件,理事会计数器被用作事件发生的条件。这确保了玩家每次只被要求一种理事会,并按照规律循环
CAMPAIGN_SCRIPT TEST EVENT: 测试事件脚本
Typically, when there is an issue with your campaign_script file it will fail when you start a new game and be rendered inactive. This may not be obvious at first so you can add a special historic event to easily test the integrity of this file during the debugging stage. Just add:
通常,当你开始新游戏,如果你的战役脚本有问题,有可能脚本不被激活。这不是显而易见的,所以你需要增加一个特殊的事件用来简单的测试文件的完整性。只需要增加:
historic_event script_test
as the very last item in your campaign_script. Remember that a historic event needs a text entry indata/text "historic_events.txt" to function. You can just put somethin like:
作为你的战役脚本最后一项。记住,一个历史事件需要一个文本data/text 目录下的"historic_events.txt"
你可以写入下面类似的东西
{SCRIPT_TEST_BODY}campaign_script is active
{SCRIPT_TEST_TITLE}Campaign Script Test
This way, if it fires when you start a new game, the entire campaign_script is being read and there should be no major issues. If it fails to fire, then you know instantly that something is wrong and thecampaign_script is being disabled.
通过这个方法。你当你开始一个新游戏的时候,整个战役脚本将会被读取,不会存在重大的错误。如果脚本失败,你马上就会知道有东西错误,战役脚本没被激活。
Section Two:
TRAIT AND ANCILLARY TRIGGER EVENTS
第二部分:事件触发技能和随从
Here we will examine interactive events that result in characters acquiring character traits and ancillaries.
这里我们将揭示交互事件怎么在人物的特性和随从上起作用。
EVENTS THAT EFFECT CHARACTER TRAITS: 作用于人物特性的事件
For events that will affect your character’s traits you need a yes/no event where the event counters are set when the player makes their decision and remain set until the following turn.
事件作用于人物的特性,你需要做个双选的事件。事件的计数器可以被玩家用来决定以后的人物特性。
This is because trait triggers need to be active at the end of the turn. This creates a problem when there is a monetary cost attached to the event as the game will deduct the funds continuously, several times a second, until your next turn starts and put you millions of florins in the hole.
这是因为在回合结束需要机会特性的计数器。这样就产生一个问题,当货币被加入到事件时,游戏将不断的扣除金币,每秒钟几次,知道你下回合开始,你就会失去成百万的金币
There are 2 solutions to this problem:
有两个解决方案可以解决这个问题:
First, you can have a one-time event that makes use of a termination line after the cost is deducted.
第一,你可以做个一次性的事件,并保证金币扣除后中断脚本。
Second, you can have the money deducted on the following turn just before the event counter is reset. This method is required if the event is to be repeatable, that is an event which will happen multiple times during the game.
第二,你可以再事件计数器重置前扣钱。这个方法需要事件是可以在游戏中多次重复的。
To start, we will examine two events of the later variety.
首先,我们解释下两个事件之后的种类。
The first is a council where your generals get together and discuss your faction’s military situation. Here is the event text:
首先,是一个委员会,你的将领聚集子一起讨论你的势力的军事形势的。这里有个事件文本。
{WAR_COUNCIL_BODY}Sire, A council of war could be held at your capital, it may give you and your generals the opportunity to exchange valuable information and insight into things like strategy, battlefield tactics, and logistics.
It will cost 5000 Florins, to be deducted from next season's treasury. Do you wish to hold this council?
GAMEPLAY NOTE: Only characters in settlements who take no other action this turn are eligible to attend.
(文本本身就不翻译了)
Note that I mention in the text that payment will be made on the following turn (season here as I use a 4 turns per year script) so that the player doesn’t become alarmed when the money is not deducted right away and so they can plan ahead what they are spending. Since the triggers used will require characters to end their turn in a settlement with 100% movement points (they spend that turn going to, attending, and returning from the event, I also include the GAMEPLAY NOTE so the player can plan their turn accordingly.
注意,我提到的文本时被做在了下面(我使用的一年四回合脚本),所以玩家不会马上警觉到钱没通过正常方式被口了,玩家还能计划他们的支出。因为触发器启用需要角色在城市里面满行动力结束回合。玩家相应的可以计划他们的回合。
Code:代码示例
;--- War Council
monitor_event FactionTurnStart FactionIsLocal
and Treasury > 20000
and FactionBuildingExists >= council_chambers
and I_CompareCounter counciltimer = 8
historic_event war_council true
end_monitor
monitor_conditions I_EventCounter war_council_declined = 1
set_event_counter war_council_declined = 0
end_monitor
monitor_event FactionTurnStart FactionIsLocal
and I_EventCounter war_council_accepted = 1
console_command add_money -5000
set_event_counter war_council_accepted = 0
end_monitor
These are the trait triggers used for the event in export_descr_character_traits:
这里是在export_descr_character_traits文件里通过事件触发的技能触发器:
Code:代码示例
;------------------------------------------Trigger war_council_results
WhenToTest CharacterTurnEnd
Condition CharacterIsLocal
and IsGeneral
and I_EventCounter war_council_accepted > 0
Affects StrategicSkill1Chance50
Affects TacticalSkill1Chance50
Affects LogisticalSkill1Chance50
Affects GoodInfantryGeneral1Chance10
Affects GoodCavalryGeneral1Chance10
;------------------------------------------
Here is another such event, this one affects not generals but agents; spies and assassins in this case:
这是个这样的事件,不仅作用于将领,还作用于事务官,例子里有间谍和刺客
{DOCUMENTS_BODY}Sire, news from the Thieves Guild. A foreign traitor has offered to sell us a number of documents stolen from an enemy court archive. He is asking for 3,000 florins, to be paid upon delivery next season. Expensive, but they could provide valuable information for our own agents. Shall I authorize the funds?
Code:
;--- Stolen Documents
monitor_event FactionTurnStart FactionIsLocal
and Treasury > 20000
and FactionBuildingExists = rb_thiefs_guild
and RandomPercent < 15
historic_event documents true
end_monitor
monitor_conditions I_EventCounter documents_declined = 1
set_event_counter documents_declined = 0
end_monitor
monitor_event FactionTurnStart FactionIsLocal
and I_EventCounter documents_accepted = 1
console_command add_money -3000
set_event_counter documents_accepted = 0
end_monitor
And the triggers from export_descr_character_traits:
Code:代码示例
;---------------------------------------Trigger stolen_documents_results
WhenToTest CharacterTurnEnd
Condition CharacterIsLocal
and I_EventCounter documents_accepted > 0
Affects GoodSpy1Chance50
Affects GoodAssassin1Chance50
Affects GoodConspirator1Chance50
The condition CharacterIsLocal ensures that only your generals will receive the benefits of this event and that it will not affect characters from other factions.
条件CharacterIsLocal确保只有你的将领能收到这个事件的好处,从而对其他势力的将领不起作用。
Note that in these examples, if the event is declined the counters war_council_declined and documents_declinedare reset at once. This is because declining these events has no affect on traits. The event did not happen and so nothing happens as a result.
注意,在这些例子里,如果事件被拒绝,计数器 war_council_declined 和documents_declined 就会被马上重置。这是因为拒绝这些事件对技能不起作用。事件没发生,结果什么事情都不会发生。
However, you may want events to have consequences if the event is declined. This is an example of such an event:
然而,你可能希望一些事件被拒绝后有结果。这里是个这样的例子:
{SPY_COUNCIL_BODY}Sire, your spy master feels that our internal security is a bit too lax. He requests that you host a special council where the threat of foreign spies and assassins can be addressed. It should cost about 3,000 florins to put this together, to be deducted from next season's treasury. Shall we proceed?
GAMEPLAY NOTE: Only characters in settlements who take no other action this turn are eligible to attend.
Code:
;--- Spy Council
monitor_event FactionTurnStart FactionIsLocal
and Treasury > 20000
and FactionBuildingExists >= council_chambers
and I_CompareCounter counciltimer = 12
historic_event spy_council true
end_monitor
monitor_event FactionTurnStart FactionIsLocal
and I_EventCounter spy_council_accepted = 1
console_command add_money -3000
set_event_counter spy_council_accepted = 0
end_monitor
monitor_event FactionTurnStart FactionIsLocal
and I_EventCounter spy_council_declined = 1
set_event_counter spy_council_declined = 0
end_monitor
In this event, declining can give your generals the idea that you do not take this problem seriously and it can have a negative effect upon them. So we have both theaccept and decline counters reset on the following turn to allow the trait triggers for each to affect the faction’s generals.
在这个例子里面,你的将领拒绝了事件,没产生严重的问题,因为事件有负面的影响。我们有接受和拒绝两种计数器都重置,在下面的技能触发器中,都对示例将领的技能起作用了。
Here are the triggers from export_descr_character_traits:
下面是export_descr_character_traits文件中的技能触发器。
Code:
;---------------------------------------Trigger spy_council_accepted
WhenToTest CharacterTurnEnd
Condition CharacterIsLocal
and IsGeneral
and RemainingMPPercentage = 100
and I_EventCounter spy_council_accepted > 0
Affects CounterSpy2Chance33
Affects AssassinCatcher2Chance33
Affects HighPersonalSecurity1Chance50
;---------------------------------------Trigger spy_council_declined
WhenToTest CharacterTurnEnd
Condition CharacterIsLocal
and IsGeneral
and EndedInSettlement
and RemainingMPPercentage = 100
and I_EventCounter spy_council_declined > 0
Affects LaxPersonalSecurity1Chance33
Affects Paranoia1Chance10
ONE-TIME TRAIT EVENTS: 一次性技能事件
If you want to make events like these that only happen once each, then the set-up a little different. Let us take theWar Council example from above and make it a one-time event:
如果你想做像这样的只发生一次的事件,然后设置的有点不一样。让我们用上面的War Council 例子做个一次性事件。
Code:
;--- War Council
monitor_event FactionTurnStart FactionIsLocal
and I_EventCounter held_war_council = 0
and Treasury > 20000
and FactionBuildingExists >= council_chambers
and I_CompareCounter counciltimer = 8
historic_event war_council true
monitor_conditions I_EventCounter war_council_accepted = 1
console_command add_money -5000
terminate_monitor
end_monitor
monitor_conditions
I_EventCounter war_council_declined = 1
set_event_counter war_council_declined = 0
end_monitor
monitor_event FactionTurnStart FactionIsLocal
and I_EventCounter war_council_accepted = 1
set_event_counter war_council_accepted = 0
set_event_counter held_war_council = 1
end_monitor
As you can see, the differences are:
正如你看到的,不同的地方在于
a) An additional counter held_war_council has been added which is now a condition of the event and is never reset once it is triggered. This ensures that the event may only take place if it has never been accepted and will not happen again once it has.
a)增加了另外一个计数器held_war_council ,现在是这个事件的条件,并且不会被重置。这将保证如果事件从来没发生,那么事件可能会发生,一旦发生了,就不会再发生。
and
b) You can have the money deducted right-away because the following terminate_monitor command does the job of ending the payment as soon as it is deducted the first time.
b)你可能马上被扣钱,已为下面terminate_monitor 这行命令,它终止了脚本的工作,所以会被立刻扣钱。
EVENTS THAT TRIGGER ANCILLARIES: 关于随从的事件触发器
Events that trigger ancillaries, as opposed to character traits, are essentially identical except for where the triggers themselves are placed. Here is an example of an event that triggers an ancillary:
关于随从宝物的事件触发器本质上是和将领技能一样的。下面是个这样的事件的示例:
{SWORD_BODY}Sire, we have been contacted by the Swordsmith’s Guild. One of their craftsmen has produced a truly beautiful weapon that they are willing to sell for a mere 2,000 Florins, payable upon delivery next season. Would you like to purchase it?
Code:代码
;--- Fine Sword
monitor_event FactionTurnStart FactionIsLocal
and Treasury > 20000
and FactionBuildingExists = rb_swordsmiths_guild
and RandomPercent < 10
historic_event sword true
end_monitor
monitor_conditions I_EventCounter sword_declined = 1
set_event_counter sword_declined = 0
end_monitor
monitor_event FactionTurnStart FactionIsLocal
and I_EventCounter sword_accepted = 1
console_command add_money -2000
set_event_counter sword_accepted = 0
end_monitor
And here is the trigger from export_dscr_ancillaries:
Code:
;------------------------------------------Trigger sword_accepted_leader
WhenToTest CharacterTurnEnd
Condition IsGeneral
and IsFactionLeader
and I_EventCounter sword_accepted > 0
AcquireAncillary fine_sword chance100
;------------------------------------------
Section Three:
EVENTS THAT UNLOCK BUILDINGS
第三部分:事件解锁建筑
Here we will make some events that permit the player to unlock new buildings that are restricted at the start of the game. For this example I will use an event that allows factions to begin utilizing the Printing Press tree.
这里我们将制作一些事件,允许玩家解锁在游戏开局限制的新建筑。在这个例子里面,我使用一个事件,来允许玩家开始建造印刷树
{PRINTING_BODY}Sire, your chief librarian has heard of a wondrous new invention from the continent, the printing press. Apparently, it allows books and documents to be reproduced at amazing speed. While your scribes may be unhappy about it, the value of such technology cannot be denied. I have made inquiries and can have an expert here by next season to begin construction for 10,000 florins. Do I have your permission to begin?
Code:代码
;--- Printing Press Event
monitor_event FactionTurnStart FactionIsLocal
and I_EventCounter printing_accepted = 0
and Treasury > 40000
and FactionBuildingExists >= great_library
and RandomPercent < 25
historic_event printing true
end_monitor
monitor_conditions I_EventCounter printing_accepted = 1
console_command add_money -10000
terminate_monitor
end_monitor
monitor_conditions I_EventCounter printing_declined = 1
set_event_counter printing_declined = 0
end_monitor
To make this event function, a requirement must be added to the building tree’s entry in export_dscr_buildings as follows (You'll need to scroll to the right a bit):
为了完成事件功能,需要在export_dscr_buildings 文件中增加建筑树(你需要将鼠标滚动到正确的地方查看)
============以下是脚本=======================
Code:
building paper
{
levels printing_press printing_house
{
printing_press city requires factions { northern_european, hre, poland, }and building_present_min_leveleducation_libraries great_libraryand event_counter printing_accepted 1or event_counter i_robot 1
{
capability
{ happiness_bonus bonus 1 requires event_counter i_robot 0
trade_base_income_bonus bonus 2 requires event_counter i_robot 0
happiness_bonus bonus 2 requires event_counter i_robot 1
trade_base_income_bonus bonus 3 requires event_counter i_robot 1
}
material wooden
construction5
cost4800
settlement_min large_city
upgrades
{
printing_house
}
}
printing_house city requires factions { northern_european, hre, poland, }and building_present_min_level education_libraries great_libraryand event_counter printing_accepted 1or event_counter i_robot 1
{
capability
{
happiness_bonus bonus 2 requires event_counter i_robot 0
trade_base_income_bonus bonus 4 requires event_counter i_robot 0
happiness_bonus bonus 3 requires event_counter i_robot 1
trade_base_income_bonus bonus 5 requires event_counter i_robot 1
}
material wooden
construction7
cost9600
settlement_min huge_city
upgrades
{
}
}
}
plugins
{
}
}
============以上是脚本==============
You will note that in addition to the event counter requirement, there is an alternate “or” counter that will also allow the building to be made. This is a special script designed to allow the game to distinguish between the human player and an AI controlled faction.
你会注意到除了这个事件计数器外,还需要一个备用的计数器。这是个特殊的脚本设计,用来让玩家和AI控制的势力建造不同的建筑。
Not only can it be used to bypass the event requirement for the building to be constructed, it can be used to grant different effects for the local and AI factions. This is highly useful since the AI needs all the help it can get in the game and simply pouring money into its king’s purse can unbalance the game by crippling the player through attrition if the AI factions are given too much extra cash.
它不仅可以用来通过事件要求建造不同的建筑,他还可以用来让玩家和AI势力授予不同的效果。这是个非常有用的的东西,因为AI需要帮助,AI能简单的在国王的钱包里增加收入。但是如果AI给予了太多额外的资金,对玩家就不平衡了。
This is my version of such a script:
下面是我的一个这样的脚本。
============以下是脚本==============
Code:
;######################AI Assist Script########################
declare_counter i_robot
monitor_event FactionTurnEnd FactionIsLocal
set_event_counter i_robot 1
end_monitor
monitor_event FactionTurnEnd FactionType slave
set_event_counter i_robot 0
end_monitor
============以上是脚本==============
As you can see: i_robot 1 means the faction is AI controlled, i_robot 0 indicates the human player.
正如你看到的 i_robot 1意味着势力是AI控制, i_robot 0代表是人类玩家
IMPORTANT NOTE: 重要提示
DO NOT use these requirements for recruitment lines as this will reset the unit pools to 0 at the start of every turn. Thanks to Gigantus for figuring that out. Big G, as you all know, rocks the casaba.
不要用这些用来招募的建筑,在每回合开始,招募池的数量会清零。
感谢Gigantus 指出这个问题。
Section Four:
EVENTS THAT UNLOCK UNITS
第四部分:事件解锁单位
These events are very similar to those used for buildings and affect the same files. Here is an example from my mod where Sir William Wallace asks his king to fund war gear for his rebels, resulting in the creation of two new units for Scotland:Chosen Swordsmen and Chosen Spearmen.
这些事件与用作解锁建筑的事件非常类似。这里有个我的MOD里面的例子。威廉·华莱士爵士向他的国王要讨伐叛军的军费。结果导致苏格兰创建了2个信的单位选择剑士或者选择长枪兵
{SIR_WILLIAM_BODY}Your Seneschal escorts in Sir William Wallace who bows gravely before you. "Sire, I am grateful you would see me. I know you have pressing business at hand."\n\nYou look him over with bemusement. It is hard to believe this quiet, self-deprecating man is the blue-faced demon you have heard such wild tales of. You then notice his infamous belt, supposedly made from the hide of an English tax collector, and cannot help but swallow.
"As you know my men have had great success in battle and it is on their behalf that I presume to come here and ask your favor. They are fine lads all, and mighty fighters that all Scotland can be proud of, but they are the sons of farmers and sheep herders who can't afford proper war-gear. I have equipped them myself so far as my family's limited resources allow, but it just isn't enough. If you would grant me 15,000 florins I would put together for you a truly might force that will drive terror into the heart's of our enemies."
Do you agree to give Sir William the funds? He is a proud man and surely will not ask you a second time.
===========以下是脚本=========
Code:
;--- Sir William's Chosen Men
monitor_event FactionTurnStart FactionType scotlandand
FactionBuildingExists >= drill_square
and I_CharacterExists wallace1
and I_EventCounter sir_william_accepted = 0
and I_EventCounter sir_william_declined = 0
and Treasury > 35000
historic_event sir_william true factions { scotland, }
;if AI random chance to accept
if I_IsFactionAIControlled scotland
generate_random_counter br_random_accept 0 2
if I_EventCounter br_random_accept < 2
set_event_counter sir_william_accepted 1
end_if
end_if
terminate_monitor
end_monitor
monitor_conditions I_EventCounter sir_william_accepted = 1
console_command add_money -15000
terminate_monitor
end_monitor
=======以上是脚本=====
The units are then added to the export_dscr_building file in the recruitment lines for all relevant buildings as follows (you'll need to scroll down a bit):
然后单位被添加到文件 export_dscr_building 里的招募行内,如下面的脚本所示:
=====以下是脚本=====
Code:
drill_square city requires factions { northern_european, middle_eastern, eastern_european, greek, southern_european, }
{ ;convert_to 1
capability
{ recruit_pool "Billmen"1 0.5 40requires factions { england, }
recruit_pool "Billmen"1 0.5 40requires factions { barons_alliance, }
recruit_pool "Highland Pikemen"1 0.5 40requires factions { scotland, }
recruit_pool "Norse Swordsmen"1 0.5 40requires factions { norway, denmark, }
recruit_pool "Ulster Swordsmen"1 0.4 30requires factions { Ireland, }
recruit_pool "Gwent Raiders"1 0.4 30requires factions { Wales, }
recruit_pool "Gwent Raiders"1 0.34 20requires factions { ireland, }and event_counter ireland_union 1 recruit_pool "Muire"1 0.2 20requires factions { Ireland, }
recruit_pool "Morgannwg Swordsmen"1 0.2 20requires factions { Wales, }and event_counter wales_union 1 recruit_pool "Morgannwg Spearmen"1 0.2 20requires factions { Wales, }
recruit_pool "Dismounted Huscarls"1 0.5 40requires factions { norway, denmark, }
recruit_pool "Levy Spearmen"1 0.7 60requires factions { england, }
recruit_pool "Levy Spearmen"1 0.7 60requires factions { barons_alliance, }
recruit_pool "Highlanders"1 0.7 60requires factions { scotland, } recruit_pool "Highlanders"1 0.5 40requires factions { norway, }and event_counter norway_union 1 recruit_pool "Highlander Swordsmen"1 0.7 60requires factions { scotland, }
recruit_pool "Highlander Swordsmen"1 0.5 40requires factions { norway, }and event_counter norway_union 1
recruit_pool "Gaelic Clan Swordsmen"1 0.4 30requires factions { ireland, }
recruit_pool "Gaelic Clan Swordsmen"1 0.34 20requires factions { wales, }and event_counter wales_union 1 recruit_pool "Viking Raiders"1 0.7 60requires factions { norway, denmark, }
recruit_pool "Viking Raiders"1 0.4 30requires factions { scotland, }and event_counter scotland_union 1 recruit_pool "Ostmen"1 0.7 60requires factions { Ireland, }
recruit_pool "Peasants"1 0.7 60requires factions { england, }
recruit_pool "Peasants"1 0.7 60requires factions { barons_alliance, }
recruit_pool "Highland Rabble"1 0.7 60requires factions { scotland, }
recruit_pool "Peasants"1 0.7 60requires factions { norway, denmark, }
recruit_pool "Clan Militia"0 0.7 60requires factions { Ireland, }
recruit_pool "Peasants"1 0.7 60requires factions { Wales, }
recruit_pool "Armored Swordsmen"1 0.4 30requires factions { england, }
recruit_pool "Armored Swordsmen"1 0.4 30requires factions { barons_alliance, }
recruit_pool "Highland Nobles"1 0.4 30requires factions { scotland, }
recruit_pool "Chosen Spearmen"1 0.2 20requires factions { scotland, }and hidden_resource scotlandand event_counter sir_william_accepted 1
recruit_pool "Chosen Swordsmen"1 0.2 20requires factions { scotland, }and hidden_resource scotlandand event_counter sir_william_accepted 1
recruit_pool "Sami Axemen"1 0.4 30requires factions { norway, }
recruit_pool "Gae Bolga"1 0.25 30requires factions { ireland, }
recruit_pool "Fianna Eireann"1 0.2 10requires factions { Ireland, }and hidden_resource ireland
;and building_present_min_level temple_nemed nemed_altar
recruit_pool "Highland Javelins"1 0.25 20requires factions { scotland, }
}
material wooden
construction6
cost2400
settlement_min large_town
upgrades
{
barracks
}
}
==========以上是脚本=========
NOTE: These sorts of counters are fine for recruitment lines because once they are set they remain set. It is only re-setting counters that cannot be used in conjunction with unit recruitment.
注意:这些计数器的种类对招募树来说是好的,因为他们一旦被设置好或,他们将一直被成这样。只是重新设置计数器,而不能用来结合招募建筑
Section Five:
CLONED EVENTS
第五部分:克隆事件
Few choices in life are either/or, but since there are only two options available for an event in M2TW, we must find another route to achieve them. Cloned events are multiple versions of a single event that are presented in identical fashion to the player but have differing outcomes. This way the player can never be sure which event it really is or what will come of either accepting or declining it.
生活中的选择非此即彼,但是由于中2里一个事件只有2个选择,我们必须通过其他的方法找到路径去实现他们。克隆事件将一个单独的事件做出多个版本,这样玩家就有多个不同的选择。通过这个方法,玩家将不能确定事件真正应该是接受或者拒绝。
For this example I will use my Privateers event:
我将用我的私掠船事件做例子。
{PRIVATEERS1_BODY}Sire, we have been approached by a group of privateers who say they will grant us a generous return if we support their cruise off enemy shores. They are asking for 5,000 florins, shall we make the funds available?
There are four variations on this event:
这里有这个事件的四个版本的变化
======以下是脚本===========
Code:
;--- Privateers1
monitor_event FactionTurnStart FactionIsLocal
and I_EventCounter privateers1_accepted = 0
and Treasury > 40000
and RandomPercent < 5
and FactionBuildingExists >= port
and I_TurnNumber > 10
historic_event privateers1 true
end_monitor
monitor_conditions I_EventCounter privateers1_declined = 1
set_event_counter privateers1_declined = 0
end_monitor
monitor_conditions I_EventCounter privateers1_accepted = 1
console_command add_money -5000
terminate_monitor
end_monitor
monitor_event FactionTurnStart FactionIsLocal
and I_EventCounter privateers1_accepted = 1
console_command add_money 15000
historic_event privateers_victory
terminate_monitor
end_monitor
{PRIVATEERS_VICTORY_BODY}Sire, excellent news! The privateers you hired have meet with great success, they have just returned to port and you have tripled your investment, wise king.
{PRIVATEERS_VICTORY_TITLE}Success!
Code:
;--- Privateers2
monitor_event FactionTurnStart FactionIsLocal
and I_EventCounter privateers2_accepted = 0
and Treasury > 40000
and RandomPercent < 5
and FactionBuildingExists >= port
and I_TurnNumber > 15
historic_event privateers2 true
end_monitor
monitor_conditions I_EventCounter privateers2_declined = 1
set_event_counter privateers2_declined = 0
end_monitor
monitor_conditions I_EventCounter privateers2_accepted = 1
console_command add_money -5000 t
erminate_monitor
end_monitor
monitor_event FactionTurnStart FactionIsLocal
and I_EventCounter privateers2_accepted = 1
console_command add_money 5000
historic_event privateers_neutral
terminate_monitor
end_monitor
{PRIVATEERS_NEUTRAL_BODY}Sire, the privateers you hired have just returned to port. Sadly, they have met with little success. They have returned your investment but we have made no profit off this venture.
{PRIVATEERS_NEUTRAL_TITLE}Privateers return
Code:
;--- Privateers3
monitor_event FactionTurnStart FactionIsLocal
and Treasury > 40000
and RandomPercent < 4
and FactionBuildingExists >= port
and I_TurnNumber > 35
historic_event privateers3 true
end_monitor
monitor_conditions I_EventCounter privateers3_accepted = 1
console_command add_money -5000
terminate_monitor
end_monitor
monitor_event FactionTurnStart FactionIsLocal
and I_EventCounter privateers3_accepted = 1
historic_event privateers_fail
terminate_monitor
end_monitor
monitor_event FactionTurnStart FactionIsLocal
and I_EventCounter privateers3_declined = 1
console_command add_money -25000
historic_event privateers_turn
terminate_monitor
end_monitor
{PRIVATEERS_FAIL_BODY}Sire, bad news. The privateers you hired have meet with a gruesome end. They were captured by our enemies and your investment is lost.
{PRIVATEERS_FAIL_TITLE}Failure
{PRIVATEERS_TURN_BODY}Sire, terrible news! The privateers you declined to hire have turned to our enemies. They have conducted raids on our shipping and siezed some 25,000 florins of gold and goods.
{PRIVATEERS_TURN_TITLE}Treachery!
Code:
;--- Privateers4
monitor_event FactionTurnStart FactionIsLocal
and Treasury > 40000
and RandomPercent < 4
and FactionBuildingExists >= port
and I_TurnNumber > 45
historic_event privateers4 true
end_monitor
monitor_conditions I_EventCounter privateers4_accepted = 1
console_command add_money -5000
terminate_monitor
end_monitor
monitor_event FactionTurnStart FactionIsLocal
and I_EventCounter privateers4_accepted = 1
historic_event privateers_betray
terminate_monitor
end_monitor
monitor_event FactionTurnStart FactionIsLocal
and I_EventCounter privateers4_declined = 1
console_command add_money 5000
historic_event privateers_captured
terminate_monitor
end_monitor
{PRIVATEERS_BETRAY_BODY}Sire, unpleasant news, the privateers we hired have betrayed us. It would seem one of our enemies outbid us for their services and they have made off with the money we fronted them.
{PRIVATEERS_BETRAY_TITLE}Betrayed!
{PRIVATEERS_CAPTURED_BODY}Sire, you were right not to trust those privateers. It turns out they were in league with our enemies and meant to make off with your gold. Fortunately one of our spies discovered the plot and we were able to capture the dogs. We have seized 5,000 florins from their ships so the adventure has a happy ending at least.
{PRIVATEERS_CAPTURED_TITLE}The Fools!
======以上下是脚本===========
Note that these are non-repeating events. In my mod I have four versions of each of these four variations (Privateers1, Privateers1A, Privateers1B, Privateers1C, etc) for a total of 16 separate events.
注意:这些都是无重复的事件。在我的MOD里面,我对这4个变化各有有4个版本,即共有16个不同的事件。
First we will look at an event which spawns an army. In this event a crusading noble is returning home with a large force in tow and offers his services to the king. If the event is accepted, the faction gains a new named character and army—if it is declined, the character and army appear anyway but are a rebel force that the player must then deal with.
很不错 好帖就是要顶 顶顶多好 说的非常好 不错不错
页:
[1]