汉魂王爵会员站

标题: Yes/No 选择性脚本教程 [打印本页]

作者: 汉魂管理    时间: 2015-3-1 00:43
标题: Yes/No 选择性脚本教程
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的工作

作者: qq232698727    时间: 2022-4-24 19:40
好东西,实用技术贴
作者: pangl    时间: 2023-7-19 02:35
标题: 管理员同志你好能否进来看一看抖音搜索百度胖老师救救上海宝钢集团上钢一厂胖老师
管理员同志你好能否进来看一看抖音搜索百度胖老师救救上海宝钢集团上钢一厂下岗工人胖老师
百度360搜狗图片视频搜索上海胖老师或者百度胖老师吧
管理员同志你好能否进来看一看抖音搜索百度胖老师或者上海胖老师,好人是否应该守望相助。请求贵网站能够与抖音一样勇敢的挺身而出救救上海胖老师给一个话语权
抖音用户搜索百度胖老师,就可以看见许许多多中央新闻媒体与全国主流新闻媒体采访报道上海宝钢集团上钢一厂下岗工人胖老师是全国拥军楷模热心社 会公益事业先进事迹也可以看见胖老师遭到上海宝钢集团上钢一厂的迫害家破人亡的事实,
上海胖老师已经被抓到上海精神病医院五次不会是最后一次。上海宝钢集团上钢一厂是要对胖老师杀人灭口斩草除根所以很快就会第六次。如果胖老师第六次被抓到上海精神病医院恐怕一辈子也出不来了。
管理员同志你好,能否得到你的帮助救救上海宝钢集团上钢一厂下岗工人全国拥军楷模热心社 会公益事业先进标兵胖老师给一个话语权,众人拾柴火焰高,谢谢期盼
敬爱的论坛管理员同志众人拾柴火焰高上海宝钢集团下岗职工胖老师的求救帖子请求手下留情不要删除请求你相互转告
管理员同志你好,我是上海宝钢集团下岗工人胖老师,能否得到你的帮助不要删除,你一辈子就帮助我一次一个话语权,我一辈子感谢你,


百度胖老师吧警示上海宝钢集团雇佣的删 帖公司职业手收费删贴等诈 骗行为公告
很快就会有上海宝钢集团出钱雇佣的删 帖公司要求贵网站管理员同志删除我的救命帖子和视频
百度胖老师吧敬爱的论坛视频管理员同志,拿人钱财替 人消灾,有人从上海宝钢集团收受大量钱财坐在电脑旁边不停的发邮件以胖老师的求救求助救命的视频帖子与贵网站无关,制造各种借口花言巧语就是为了删除上海宝钢集团下岗职工胖老师的求救求助救命的视频帖子彻底封杀上海宝钢集团下岗职工网络求助的唯一目的。







欢迎光临 汉魂王爵会员站 (http://www.hanhuns.com/) Powered by Discuz! X3.4