群星
ParaWikis
Notice
: Undefined index: HTTP_ACCEPT_LANGUAGE in
/data/wwwroot/www.parawikis.com/skins/Liberty/LibertyTemplate.php
on line
185
最新百科
都市天际线2百科
英雄无敌3百科
维多利亚3百科
奇妙探险队2百科
罪恶帝国百科
英白拉多:罗马百科
热门百科
群星百科
欧陆风云4百科
十字军之王2百科
十字军之王3百科
钢铁雄心4百科
维多利亚2百科
ParaWikis
申请建站
ParaWikis
ParaCommons
最近更改
随机页面
加入QQ群
工具
链入页面
相关更改
特殊页面
页面信息
页面值
阅读
编辑
编辑源代码
查看历史
讨论
编辑“
模组创作教程
”(章节)
警告:
您没有登录。如果您做出任意编辑,您的IP地址将会公开可见。如果您
登录
或
创建
一个账户,您的编辑将归属于您的用户名,且将享受其他好处。
反垃圾检查。
不要
加入这个!
== Testing a mod == Any trigger, effect or event can be tested from the console while in game. Console will accept any valid script input, as long as it is proceeded by the declaration of what it is (trigger, effect or event). Console executes script on a scope which is currently selected (planet, fleet). To select empire scope open government menu. Scoping to unclickable objects might require additional scope operators in script. We can check if an empire has a '''tutmod_civic''' by clicking on the empire flag and executing the following trigger script: <pre>trigger OR = { has_civic = tutmod_civic has_valid_civic = tutmod_civic }</pre> * '''has_civic''' checks if the current country has the specified civic, * '''has_valid_civic''' checks if the current country has a certain civic and if its validated (performs additional check if country fulfils criteria of a given civic). In practice we check only against one of the above triggers as '''has_civic''' makes '''has_valid_civic''' redundant when used. [[File:Tutmod civic trigger test.png|750x700px|thumb|center|Triggers are not always localised or reuse localisation keys. In the above example both '''tutmod_civic''' and '''has_valid_civic''' triggers use the same localisation key which can be confusing at first. This is a rare occurrence but is something to be mindful of.]] We can also execute effects in the same way. Let us count ships of an empire and store value in a selected object, ie. planet. Click on a '''homeworld planet''' and execute the following: <code>effect owner = { every_owned_ship = { prevprev = { change_variable = { which = tutmod_var_num_ships value = 1 } } }</code> where: * '''<code>owner = {}</code>''' – scope operator, jumps from selected scope to the owner of selected scope (in the example from planet to a planet owner), * '''<code>every_owned_ship = {}</code>''' – iterates through each ship in the fleet or owned by the country and executes effects. We have omitted limit triggers because we want to iterate through all, * '''<code>prevprev = {}</code>''' – scope operator, while executed inside '''<code>every_owned_ship</code>''' effects it will jump back (prev) two times (prevprev), from '''<code>every_owned_ship</code>''' to '''<code>owner</code>''' and from '''<code>owner</code>''' to a scoped '''homeworld planet''' where effect was executed on. * '''<code>change_variable</code>''' – change the named variable by a given amount in a given scope. To view a value we can either open up a save or use '''<code>debugtooltip</code>''' command and hover over an object to display flags and variables stored in it. [[File:Tutmod effect debugtooltip test.png|frame|center|Starbases, mining stations and civilian ships count as ships. If we wanted to count all military ships we would iterate through '''every_owned_fleet''' which '''is_ship_class = shipclass_military''' and count '''every_owned_ship''' inside those fleets.]] Note: Console accepts pasted in input, even if it contains multiple lines. It does not show it properly but it does execute it.
摘要:
请注意您对群星百科的所有贡献都被认为是在知识共享署名-非商业性使用-相同方式共享下发布,请查看在
群星百科:版权
的细节。如果您不希望您的文字被任意修改和再散布,请不要提交。
您同时也要向我们保证您所提交的内容是您自己所作,或得自一个不受版权保护或相似自由的来源。
未经许可,请勿提交受版权保护的作品!
为防止机器编辑,请完成下方验证
取消
编辑帮助
(在新窗口中打开)
该页面属于1个隐藏分类:
Category:含有受损文件链接的页面
×
登录
密码
记住登录
加入群星百科
忘记密码?
其他方式登录