Project Zomboid

Project Zomboid

FBI Agent (Profession) v0.4c
 此主题已被置顶,因此可能具有重要性
swefpifh  [开发者] 2023 年 4 月 20 日 上午 4:17
Report a problem
Notify your problem by adding as many details as possible. Sharing log details can also help.

To deal with the problem properly, I need to know some information : - The log after the crash - The exact manipulations done before the crash - The list of mods used
< >
正在显示第 1 - 9 条,共 9 条留言
M.S.Referee 2023 年 4 月 20 日 上午 4:50 
There are 2 key codes need to fixed in "FBIagentProfession.lua", otherwise, serious problems result.

1. require "MainCreationMethods"

should be

require('NPCs/MainCreationMethods');


2. Events.OnGameBoot.Add(BaseGameCharacterDetails.DoProfessions);

should be

Events.OnGameBoot.Add(FBIagentProfession.DoProfessions);


Existing codes causes other 'Profession' mods can't to read 'name' translations from "UI_XX.txt". It just make these two codes changes and everything will work fine.



It is also recommended to make the 'function names' they use in the code a bit more unique to avoid conflicts with other similar mods. Using names like this will help now and later if you want to add more Professions without worrying about conflicts with other mods. Because there are many mods of the same type now because of overlapping 'function names', causing some unnecessary problems.

For example, put the 'FBIAP' to the last of them.

local FBIagentProfession = ProfessionFactory.addProfession("FBIagentProfessionFBIAP", getText("UI_prof_fbiAgentFBIAP"), "prof_fbiAgentFBIAP", -2, getText("UI_profdesc_fbiAgentFBIAP"));

prof_fbiAgentFBIAP.png

UI_EN = {
UI_prof_fbiAgentFBIAP = "",
UI_profdesc_fbiAgentFBIAP = "",
}


And thank you for the good 'Profession' mod. And here is the "CH" and "CN" translation.

UI_CH = {
UI_prof_fbiAgent = "FBI特工",
UI_profdesc_fbiAgent = "特工們用他她們的技能、同情心和正直來 <LINE> 抵禦威脅、維護法律、捍衛公民權利、保護無辜者。 <LINE> 他她們尋找網路犯罪、滲透有組織的犯罪集團並調查恐怖分子以維護國家安全。",
}

UI_CN = {
UI_prof_fbiAgent = "FBI特工",
UI_profdesc_fbiAgent = "特工们用他她们的技能、同情心和正直来 <LINE> 抵御威胁、维护法律、捍卫公民权利、保护无辜者。 <LINE> 他她们寻找网络犯罪、渗透有组织的犯罪集团并调查恐怖分子以维护国家安全。",
}
最后由 M.S.Referee 编辑于; 2023 年 4 月 20 日 上午 5:03
swefpifh  [开发者] 2023 年 4 月 20 日 上午 5:06 
引用自 M.S.Referee
There are 2 key codes need to fixed in "FBIagentProfession.lua", otherwise, serious problems result...
Thanks to you. I'm not a programmer, I'll look into it :)
M.S.Referee 2023 年 4 月 20 日 上午 6:23 
Thanks for the update and happy can help.

There is another 'little situation', you updated the wrong for Traditional Chinese.

Actually, my mother language is Traditional Chinese, so you just need to 'copy' and 'paste' these two version of Chinese I posted into "UI_CH.txt" and "UI_CN.txt", that's all will be fine. 😄


Tips: It need to keep " <LINE> ", because if don't use " <LINE> ", it can't break sentences in the game.


---------------> Traditional Chinese is :

UI_CH = {
UI_prof_fbiAgent = "FBI特工",
UI_profdesc_fbiAgent = "特工們用他她們的技能、同情心和正直來 <LINE> 抵禦威脅、維護法律、捍衛公民權利、保護無辜者。 <LINE> 他她們尋找網路犯罪、滲透有組織的犯罪集團並調查恐怖分子以維護國家安全。",
}


---------------> Simplified Chinese is :

UI_CN = {
UI_prof_fbiAgent = "FBI特工",
UI_profdesc_fbiAgent = "特工们用他她们的技能、同情心和正直来 <LINE> 抵御威胁、维护法律、捍卫公民权利、保护无辜者。 <LINE> 他她们寻找网络犯罪、渗透有组织的犯罪集团并调查恐怖分子以维护国家安全。",
}
最后由 M.S.Referee 编辑于; 2023 年 4 月 20 日 上午 6:25
swefpifh  [开发者] 2023 年 4 月 20 日 上午 7:07 
引用自 M.S.Referee
Thanks for the update and happy can help.

There is another 'little situation', you updated the wrong for Traditional Chinese.

Actually, my mother language is Traditional Chinese, so you just need to 'copy' and 'paste' these two version of Chinese I posted into "UI_CH.txt" and "UI_CN.txt", that's all will be fine. 😄
Thanks again for your assistance :) I will update the Chinese translation for the next update ;)
M.S.Referee 2023 年 4 月 22 日 上午 4:58 
Thank you and now both are right.
M.S.Referee 2023 年 4 月 22 日 上午 6:31 
Well......
It's me again 😄. I found description doesn't working. And fixed it and send to you. All name need to use the same "fbiAgent" and the description will work.
(It doesn't need this statement "require "NPCs/MainCreationMethods"" which will increase the loading speed.)




FBIagentProfession = {};
FBIagentProfession.DoProfessions = function()

local fbiAgent = ProfessionFactory.addProfession("fbiAgent", getText("UI_prof_fbiAgent"), "prof_fbiAgent", -2, getText("UI_profdesc_fbiAgent"));

fbiAgent:addXPBoost(Perks.Fitness, 1);
fbiAgent:addXPBoost(Perks.Sprinting, 4);
fbiAgent:addXPBoost(Perks.Aiming, 5);
fbiAgent:addXPBoost(Perks.Sneak, 2);
fbiAgent:addFreeTrait("Marksman");

local profList = ProfessionFactory.getProfessions()
for i = 1, profList:size() do
local profession = profList:get(i - 1);
BaseGameCharacterDetails.SetProfessionDescription(profession);
end
end

Events.OnGameBoot.Add(FBIagentProfession.DoProfessions);
Events.OnCreateLivingCharacter.Add(FBIagentProfession.DoProfessions);
swefpifh  [开发者] 2023 年 4 月 22 日 上午 10:14 
引用自 M.S.Referee
Well......
It's me again 😄. I found description doesn't working. And fixed it and send to you. All name need to use the same "fbiAgent" and the description will work.
(It doesn't need this statement "require "NPCs/MainCreationMethods"" which will increase the loading speed.)




FBIagentProfession = {};
FBIagentProfession.DoProfessions = function()

local fbiAgent = ProfessionFactory.addProfession("fbiAgent", getText("UI_prof_fbiAgent"), "prof_fbiAgent", -2, getText("UI_profdesc_fbiAgent"));

fbiAgent:addXPBoost(Perks.Fitness, 1);
fbiAgent:addXPBoost(Perks.Sprinting, 4);
fbiAgent:addXPBoost(Perks.Aiming, 5);
fbiAgent:addXPBoost(Perks.Sneak, 2);
fbiAgent:addFreeTrait("Marksman");

local profList = ProfessionFactory.getProfessions()
for i = 1, profList:size() do
local profession = profList:get(i - 1);
BaseGameCharacterDetails.SetProfessionDescription(profession);
end
end

Events.OnGameBoot.Add(FBIagentProfession.DoProfessions);
Events.OnCreateLivingCharacter.Add(FBIagentProfession.DoProfessions);

Indeed, I'll have to give you a little kiss for helping me :D
M.S.Referee 2023 年 5 月 7 日 上午 7:43 
OK, third visit. The "Clothing Selection" not working after change the name, and it just because forgot to change the relevant function call name... So just do like that and all will work fine again.

It need change in "fbiAgentSpawnItems.lua" to

--------> if prof == "fbiAgent" then


It need change in "fbiAgentClothingSelection.lua" to

--------> ClothingSelectionDefinitions.fbiAgent = {
最后由 M.S.Referee 编辑于; 2023 年 5 月 7 日 上午 7:44
swefpifh  [开发者] 2023 年 5 月 7 日 上午 8:19 
引用自 M.S.Referee
OK, third visit. The "Clothing Selection" not working after change the name, and it just because forgot to change the relevant function call name... So just do like that and all will work fine again.
Thx again ^^ I had not seen that this had created a problem.
< >
正在显示第 1 - 9 条,共 9 条留言
每页显示数: 1530 50