안녕하세요 여러분, 오늘은 3종류 코스입니다. 첫번째로, 함포를 배치하라에 배치될 새로운 제독 트레잇과 더불어, 새로운 모딩 툴과 더불어 여기에서 더 깊게 들어가는 모딩 도구들에 대한 설명입니다. 입 맛에 맞았으면 좋겠군요. (모딩에 대해선 번역 안합니다.)
제독 트레잇
호랑이 깨우기를 이은 함포를 배치하라에서 우리는 함대전에 더욱 중점을 두고 있으며, 우리는 우리가 제독들에게 더 많은 발전과 더불어 새로운 스킬처럼 트레잇을 추가하길 원했습니다. 모든 트레잇을 가져오면 앞으로 나올 것에 대해 스포일러가 되기 때문에 약간의 양해 말씀을 드립니다.
여튼 우리는 하나의 스킬 레벨을 호랑이 깨우기와 비슷한 형식으로 나누었고, 그렇게 해서 그들의 4가지 스킬과 성격을 잘보여주는 트레잇을 보여주게 되었습니다 : 공격, 방어, 기동 및 협동 말이죠. 공격과 방어는 매우 솔직하고, 기동은 함대의 현 위치와 기동에 관련된 중요한 전술적 스킬입니다. 그리고 협동은 함대 조직에 대한 기술이며, 전투 바깥의 기타 등등을 다룹니다. 우리는 이것들을 나중에 함대와 태스크 포스 그리고 전투에 들어가게 될때 이것들을 다룰 것입니다.
이제 제독들은 성격적인 트레잇과 더불어 더많은 트레잇에 접근할수 있습니다. 몇몇 트레잇은 일반적으로 아래의 전문 장교들, 즉 지휘 장교같이 새로 생기는 장교들까지 이어집니다. 여러분들은 트레잇을 언락하고, 또한 여러분의 제독에 이 트레잇을 배정할 수 있습니다. 마지막으로, 여러 다른 해역 지형이 생겨서 이런 지형 트레잇을 얻거나 혹은 도움을 받을수 있습니다. 제독들은 그들의 레벨에서 3포인트를 얻으면 더 강하게 레벨 업이 가능해집니다. 레벨링중 두번째 레벨은 육군 장군들에게 벌어지는 것처럼 트레잇 슬롯을 개방합니다. 이 트레잇과 관련된 항목들은 호랑이 깨우기의 트레잇처럼 무료로 제공됩니다.
여기 전체 트레잇 트리가 있네요:
육군 트레잇과 같이 먼저 선 트레잇을 얻어야 다음 트레잇을 얻을수 있습니다.
여러분이 주력함에 몰빵하고 싶다면, 용맹스러움 을 찍고, 봉쇄 도주 같은 항모의 항공 능력을 찍거나, 혹은 레이더를 할시 은닉 전문가나 사일런트 헌터같은 트레잇이 있습니다., 또한 여기에는 비주력함을 위한 파리채와 함대 보호자 같은 트레잇도 있습니다. 비주력함들은 여러분의 함대와 더불어 해상 작전에서 매우 많이 필요하게 될것이기 때문에 중요합니다.
Modding!
Hello everyone! @shultays
here. I am a programmer in HoI4 team and I have exciting updates for
all our modders and for the players that enjoy their mods! In this dev
diary I will introduce a couple new scripting features that will be
especially appealing for our modders. It is a bit early for such tech
dev diary but we wanted some feedback on those features, and also have
enough time to iterate on such feedback.
I will give short descriptions and small examples here, more in-depth stuff can be found in my other post that I made in modding forums.
Arrays
The people with programming experience are already familiar with the
concept of arrays. For those who are not, arrays are basically
containers of data. In HoI4, they are containers of variables (and
things that can be stored as variables, such as states and countries).
Array support is an extension on the existing variable system. You can
store arrays anywhere you can store variables (countries, states, unit
leaders or globally). You can access individual array elements using
existing effects & triggers that changes or compares variables (the
syntax for accessing an element is array_name^index) or you can use them
in the effects/triggers that accepts variables. And there are many
additional effects and triggers to interact with arrays, like effects
that can add/remove elements or triggers that can check for every or any
elements.
Let's give an examp
Code:
#create an example array with 3 countries, named "array_example"
add_to_array = { array_example = GER }
add_to_array = { array_example = ITA }
add_to_array = { array_example = TUR }
# calculate total pp of these 3 countries
set_temp_variable = { sum_pp = 0 }
for_each_scope_loop = {
array = array_example
add_to_temp_variable = { sum_pp = political_power }
}
if = {
# do they have more than 100 pp?
limit = { check_variable = { sum_pp > 100 } }
# remove 33 pp
for_each_scope_loop = {
array = array_example
add_political_power = -33
}
#pp spent, now do business
}
Here I assumed Germany, Italy and Turkey made some kind of pact
and I want to run an effect if they have more than 100 pp in total. This
effects builds an array of 3 countries using add_to_array effect,
calculates the sum of their pp by iterating on this array using
for_each_scope_loop effect and removes 33pp from each if the sum is >
0 again using for_each_scope_loop.
This is just one example to usage of arrays. There are many more ways to
interact with arrays, which can be found in my other post.
In addition to arrays that you can create or change, the game will also
support "game variable arrays". Similar to "game variables", in various
scopes you will be able to access such constant arrays which are built
using in game data. For example accessing "enemies" array in country
scope will let you access enemies of a country. If you loop through
enemies, you will loop every for every enemy of that country. Current
list of game variables and arrays can be found in my other post, please
check it if you are interested and feel free to post your suggestions.
Meta-Effects and Meta-Triggers
This is something we borrowed from EU4, but the implementation and the
usage is different. Meta-effects and meta-triggers will let modders to
use non-dynamic effects/triggers (the ones that do not accept modifiers
and can only use static tokens or constant values) as if they were
accepting variables. It is hard to explain and so let's give an example!
Consider following code
Code:
add_equipment_to_stockpile = {
type = infantry_equipment_2
amount = eq_amount
}
In this effect, amount is dynamic and can be set using a variable
(here it is being set to eq_amount variable). However this effect does
not let scripters to use a variable as equipment type. You can not store
infantry_equipment_2 in a variable and use it here.
But with meta-effects anything is possible! Meta-effects will let
scripters to use variables & scripted localization within their
effect to build effects as if they were texts and run them. Now let's
make previous effect accept equipment type and equipment level as
variables stored in eq_type and eq_level.
Code:
set_temp_variable = { eq_type = 1 }
set_temp_variable = { eq_amount = 10 }
set_temp_variable = { eq_level = 2 }
meta_effect = {
text = {
add_equipment_to_stockpile = {
type = [EQ_TYPE]_[EQ_LEVEL]
amount = eq_amount
}
}
EQ_LEVEL = "[?eq_level|.0]"
EQ_TYPE = "[This.GetEquipmentName]"
}
# scripted localization
defined_text = {
name = GetEquipmentName
text = {
trigger = {
check_variable = { eq_type = 0 }
}
localization_key = "infantry_equipment"
}
text = {
trigger = {
check_variable = { eq_type = 1 }
}
localization_key = "artillery_equipment"
}
# give all equipment an index here
}
Here we created a meta_effect that takes two arguments. These
arguments will be used replacing the parameters ([EQ_TYPE] and
[EQ_LEVEL]) inside the meta effect. EQ_LEVEL will be replaced by
[?eq_level|.0] which is the integer value of eq_level (in this case
2.000 becomes 2). EQ_TYPE is a bit more complicated, it is being
replaced by a scripted localization. This scripted localization will
check eq_type variable and depending on its value it will return the key
token for the equipment. If it is 0, it will return infantry_equipment.
If two, it will return artillery_equipment.
So the final result is [EQ_TYPE] is being replaced by
"artillery_equipment" and [EQ_LEVEL] is being replaced by "2" and in the
end our effect will be built as:
Code:
add_equipment_to_stockpile = {
type = artillery_equipment_2
amount = eq_amount
}
which will give you 10 artillery_equipment_2! Now you might think
that this is extremely convoluted way of giving 10
artillery_equipment_2. But it will be possible to use and replace
meta_effects in the scripted_effects or scripted_triggers, so this
convoluted parts will be only written once.
Dynamic Modifiers
Currently our modifiers can only contain static values and you can't use
variables in them. With dynamic modifiers, it will be possible add such
modifiers to country and states. To keep things simple, we limited
adding and removing dynamic modifiers only through effects, although
some QoL improvements may be added in future.
Their declaration is similar to static modifiers, except that they will accept variables as modifier values.
Code:
dynamic_modifier_example = {
political_power_factor = pp_factor_variable
}
And after declaring a dynamic modifier like that, you can run following effect to add this modifier to current scope.
Code:
set_variable = { pp_factor_variable = 0.15 }
add_dynamic_modifier = { modifier = dynamic_modifier_example }
This example will add "dynamic_modifier_example" dynamic modifier
to the country of the scope. This modifier will give country pp gain
factor equal to "pp_factor_variable" stored that in country. In this
example we stored, 0.15 so the country will get 15% more pp gain. When
you change the value of pp_factor_variable later through another effect,
the bonus the country gets will also be updated.
Additionally you can define a scope while adding dynamic modifiers. In
that case the modifier will fetch the variables from the scope that you
specified. This will also let scripters to add multiple instances of
same dynamic modifier that is targeting different countries (or states)
so you can use them as if they were relationship modifier.
While adding modifiers, you can specify a duration as well, which makes
them automatically removed after certain number of days. And it is
possible to define a trigger, which will also remove the modifier when
the trigger is false.
It will be possible to give dynamic modifiers icons. In that case they
will show up in GUI. For example dynamic modifiers that are added
country will show up if they were "national spirits" if an icon is
defined.
In this example Turkey has two dynamic modifiers in it. And we defined
an icon here so it shows up in national spirits list. Both of these
dynamic modifiers are same but one is targeted at Italy and the other
one is target at France and value of "Fuel Capacity" is being read from
those scopes (and root is Turkey, you can use targeted variables if you
want). Also the effect that added those modifiers defined a duration,
and these modifiers will be removed in two days because of that.
More Scripted-GUI features
Modders are being extremely creative with this feature and I am
delighted to see all those new cool mods that is being developed or in
the workshop. Other than fixing some unfortunate bugs and insights in
the live version, we are also adding "dynamic lists" support for
scripted GUIs.
Dynamic lists will let modders to create their own lists and fill those
lists using an array they specify. In previous on of the older dev
diaries, I showed this sneak peak.
This one is actually implemented using arrays. Each cell here is
dynamically created using an array of 64 elements and value of each
element represents the cell state. Each cell element is being built
using the scope and the value of the the array element.
Another, more down to earth, example:
Bottom list is populated using allies of the country (using “allies”
game array in country scope). For Germany, this array has two elements,
Italy and Turkey and thus it creates two entries in the bottom list.
While building the elements of the bottom list, it changes scope to each
entry in the element (if the element is not scopable, there are ways to
access the value & index of the element, which are also being shown
in the example)
Top list is built using an array that is stored in country scope and
initially it is empty. Pressing “Add Item” button at top calls an effect
that adds random country to that array, which also updates the list
itself.
The medium flags that are being shown as a grid is also another dynamic
list. This example is given to show that the lists inside lists also
possible.
And that is all from me for now. If you are interested more on those
topics, check the in-depth topic on modder's forum and please give
feedback.
첫댓글 지뢰찾기 뭐옄ㅋㅋㅋㅋㅋㅋ
유튜브 플레이어 모드 보고 감명받았나...
드디어 동적 모디파이어가 지원되는군요. 갠적으로 이게 제일 반갑습니다. 다른 작품들에도 빨리 추가되었으면 하네요.
그게 뭔가요?
@마스터치프 쉽게 말해 이제 모딩에서 명령어의 인풋으로 상수 뿐만 아니라 변수도 사용할 수 있게 되었다는 야그입니다. 모딩 안하는 사람에겐 아무래도 상관없는 일이긴 한데 모딩하는 사람에겐 그간 저게 지원 안되서 꽤 빡치는 부분이 많았죠.
@252335 수포자 문과라 잘 모르겠네요..변수면 랜덤??...아무튼 모딩이 더 나아진다니 다행이네요! 혹시 다른부분에서 나아지길 희망하는부분이 있으신가요?
@마스터치프 랜덤이라기보다는 예를 들어 y=3x라는 식에서 x가 바로 변수입니다. 이전까지의 패러독스 게임 모딩에서는 이러한 식을 쓰는게 불가능하여 필요할 때마다 일일히 y의 값을 새로 써줘야만 했습니다. 그런데 이제는 y=3x라는 관계를 선언한 뒤 x만 그때그때 바꿔서 y의 값을 교체할 수 있게 된거죠.
이번 개발자노트를 읽어보니 아직 관련 기능이 완전하게 지원되는게 아니라 앞으로도 갈 길이 꽤 있어보이지만, 그것만 이뤄져도 모딩이 훨씬 개선되리라 생각합니다.
@252335 오~ 이제 대략 감이 오군요. 훨씬 더 쉬워지겠네요!!. 다른 역설게임에도 추가됬으면 하네요
전 동적 모디파이어는 크게 아쉽지 않습니다. 그동안 이진법의 특징을 이용해서 변수값을 모디파이어 값으로 잘 1:1 대응시켜오고 있었어서, 어느정도 대체가 가능은 했거든요. 가장 아쉽고 부러운건 역시 array네요.
@메가스콤네노스 그 방식도 인풋으로 들어가는 값의 범위가 넓으면 한계가 있지 않나요? 예전에 보유한 총 자원량에 따라 효과가 달라지는 모디파이어를 만들려다 질려서 포기한 적이 있어서요.
어레이 추가도 매우 흥미로운 부분 같습니다. 빨리 스텔라리스에도 적용이 되어야할텐데 말이지요.
@252335 POP_SetMod = {
if = {
limit = {
check_variable = {
which = $varname$
value = $value$
}
}
subtract_variable = {
which = $varname$
value = $value$
}
if = {
limit = {
NOT = {
has_$type$_modifier = $modname$_$value$
}
}
add_$type$_modifier = {
name = $modname$_$value$
duration = -1
hidden = yes
}
}
}
else_if = {
limit = {
has_$type$_modifier = $modname$_$value$
}
remove_$type$_modifier = $modname$_$value$
}
}
@메가스콤네노스 저희는 이 metascript effect를 그냥 도배해서 사용해왔어서 큰 어려움이나 한계는 못 느꼈습니다.
@메가스콤네노스 오, 소스코드 감사합니다. 한 번 써봐야겠군요.
아앗...지뢰찾기;
제독 트레잇은 있어야할게 이제서야 추가된듯한 느낌이 드네요
그나저나 하위 지휘관이 생겼으면 함대결전간에 죽을수도 있어야 하지 않나 싶네요
근데 다음패치때 자원저장한다니까 이제 더이상 독일로 잠수함 수백대못뽑는건가...