马上注册,结交更多好友,享用更多功能,让你轻松玩转汉魂游戏工坊!
您需要 登录 才可以下载或查看,没有帐号?注册账号
x
i haven't seen any tutorial on this so after some study and testing, i managed to get a simple, yet complete way to script Yes/No events
我一直没找到类似的教程。在经过了学习和测试后,我学会了如果用一个简单的方法来实现YES/NO两种选择的事件。
first of all let me credit Boicote for his efforts on simplifying the Yes/No scripts
首先让我来简化 Yes/No 脚本
i greatly recomend you to take a look at the CA's Docudemon files, for making your own script events, conditions and effects
我极力推荐你看看CA的文档,制作自己的脚本事件,相应的条件和作用。
im now showing you how to make a simple yes-no event
现在我来展示如果做一个简单的双选的事件
it's turn 1, and you recieve a message asking if you want to accept some blood money
首先你收到一个消息,问你是否接受一些血汗钱
you either can accept it, or not
你可以选择接受或者拒绝
accepting it will grant you extra 5000 denaries, if you don't, you lose 5000 denaries from your treasury (it's just a small example of course)
如果接受,会给你额外的5000金币,如果拒绝,你会在财政上失去5000金币(当然这只是个小例子)
to create one open the campaign_script.txt file inside data/world/maps/campaign/imperial_campaign/, you're also required a notepad/.txt editor
创建一个campaign_script.txt 文本在data/world/maps/campaign/imperial_campaign/目录里。你同样需要一个文本编辑器。
here's the base script:
这里是基本的脚本
;Money Extra Yes/No
declare_counter extra_money_offered
monitor_event FactionTurnStart FactionType egypt
and I_LocalFaction egypt
and I_TurnNumber = 1
and I_CompareCounter extra_money_offered = 0
add_events
event counter extra_money_accepted
event counter extra_money_declined
end_add_events
historic_event extra_money true factions { england, } ;makes event message appear 事件消息出现
set_counter extra_money_offered 1
terminate_monitor
end_monitor
;;;;;;;;;;;;;;;;;;;;;;;;; accepts blood money ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
monitor_conditions I_EventCounter extra_money_accepted = 1
add_money England 5000 ;the effect is adding 5000 denaries
historic_event extra_money_accepted factions { england, } ;message appears saying it was accepted 消息显示接受
terminate_monitor
end_monitor
;;;;;;;;;;;;;;;;;;;;;;;;; doesn't accepts blood money ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
declare_counter extra_money_rejected
monitor_conditions I_EventCounter extra_money_rejected = 1
increment_kings_purse egypt -5000
set_counter extra_money_rejected 1
terminate_monitor
end_monitor
be sure to rename all the counters with the same name
请确定所有计数器在同一个游戏里不相同
so if you rename the:
如果你定义以下的计数器
;;;;;;;;;;;;;;;;;;;;;;;;; doesn't accepts blood money ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
declare_counter extra_money_rejected
be sure to also edit all the counter who have
请确定所有有以下类似计数器都有完全相同的名字:
something_counter x_y_rejected
with the exact same name
and so on..
等等
as for the messages it will show, just open historic_events.txt placed in data/text folder
消息将显示的内容在data/text 文件夹下的historic_events.txt 里面
and edit accordingly to all the
可以编辑所有内容
historic_events BLABLA
in my case:
在我的例子里面
{EXTRA_MONEY_BODY} My Lord, we've been asked if we shall accept blood money, press "Accept" to get the money, press "Decline" to refuse the offer
{EXTRA_MONEY_TITLE} Accept Blood Money?
{EXTRA_MONEY_ACCEPTED_BODY} My Lord, we have accepted the money offer, the 5000k denaries have been increased in your royal treasury
{EXTRA_MONEY ACCEPTED_TITLE} Money Accepted
{EXTRA_MONEY_DECLINED_BODY} My Lord, we have refused the money offer, our royal treasury is now shorter by 5000k denaries
{EXTRA_MONEY_DECLINED_TITLE} Money Refused
this is a very simple Yes/No script, you can then add your own commands, conditions and events, and basicly, you can do nearly anything with this
这是一个非常简单的双选的脚本。你可以加入自己的命令,条件,事件。基本上你可以通过这个做任何事情。
Personally i love this to add a great RPG style to the mods, as it can simulate a Kingdom Management system, where the player decisions have impact on the kingdom, and sometimes, the world itself
就我个人而言,我喜欢创建一个RPG风格的MOD,因为他可以模拟一个王国的管理系统。玩家可以通过决定来影响整个世界。
Again, credits should be given to Boicote, for his work
再次感谢Boicote的工作
|