Project Zomboid

Project Zomboid

FBI Agent (Profession) v0.4c
 This topic has been pinned, so it's probably important
swefpifh  [developer] 20 Apr, 2023 @ 4:17am
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
< >
Showing 1-9 of 9 comments
M.S.Referee 20 Apr, 2023 @ 4:50am 
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> 他她们寻找网络犯罪、渗透有组织的犯罪集团并调查恐怖分子以维护国家安全。",
}
Last edited by M.S.Referee; 20 Apr, 2023 @ 5:03am
swefpifh  [developer] 20 Apr, 2023 @ 5:06am 
Originally posted by 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 20 Apr, 2023 @ 6:23am 
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> 他她们寻找网络犯罪、渗透有组织的犯罪集团并调查恐怖分子以维护国家安全。",
}
Last edited by M.S.Referee; 20 Apr, 2023 @ 6:25am
swefpifh  [developer] 20 Apr, 2023 @ 7:07am 
Originally posted by 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 22 Apr, 2023 @ 4:58am 
Thank you and now both are right.
M.S.Referee 22 Apr, 2023 @ 6:31am 
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  [developer] 22 Apr, 2023 @ 10:14am 
Originally posted by 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 7 May, 2023 @ 7:43am 
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 = {
Last edited by M.S.Referee; 7 May, 2023 @ 7:44am
swefpifh  [developer] 7 May, 2023 @ 8:19am 
Originally posted by 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.
< >
Showing 1-9 of 9 comments
Per page: 1530 50