Jump to content
Fenris_Wolf

Profession Framework Mod

Recommended Posts

Posted (edited)

Hi. I am a super new to modding PZ and wanted to try to make some custom professions using this framework but for some reason no matter what i do it won't work. I downloaded this framework from the github link unzipped it and put it on my mod folder then I tried make my profession based of the examples in the PFW folder formatted it like a mod and put it in the mod folder. I activated my mod and the PFW mod, but it won't showup in character creation. Can you take a look at my code and tell me what I am doing wrong?

 

addProfession('Hitter', {
    name = "Pinch Hitter",
    description="When the bases are loaded with two outs...",
    icon = "",
    cost = 0,
    xp = {
        [Perks.Fitness] = 1,
        [Perks.Long_blunt] = 2,
        [Perks.Sprinting] = 2,
    },
    
    inventory = {
        ["Base.BaseballBat"] = 1,
        ["Base.Baseball"] = 1,
    },
})
 

leonProfessions.lua

 

 

Edit: Also I am running the newest IWBUMS build on steam.

Edited by leon2356

Share this post


Link to post
Share on other sites
Posted (edited)
On 3/19/2020 at 11:41 AM, Fenris_Wolf said:

None of the functions are global. you need to prefix your function call:
ProfessionFramework.addProfession

 

Sorry, I'm super new to modding when you say "prefix your function call", what do you mean exactly. You mean like this?:

 

ProfessionFramework.addProfession('Hitter', {
    name = "Pinch Hitter",
    description="When the bases are loaded with two outs...",
    icon = "",
    cost = 0,
    xp = {
        [Perks.Fitness] = 1,
        [Perks.Long_blunt] = 2,
        [Perks.Sprinting] = 2,
    },
    
    inventory = {
        ["Base.BaseballBat"] = 1,
        ["Base.Baseball"] = 1,
    },
})

leonProfessions.lua

 

Because it is still not working.

Edited by leon2356

Share this post


Link to post
Share on other sites
Posted (edited)

I tried a few other things like trying to add one of the example changes you provided with the mod:

 

ProfessionFramework.addProfession('carpenter', {
    cost = 4,
    xp = {
        [Perks.Woodwork] = 4,
    },
    inventory = {
        ["Base.Hammer"] = 2,
        ["Base.Saw"] = 1,
        ["Base.Woodglue"] = 3,
        ["Base.NailsBox"] = 3,
    },
    square = {
        ["Base.Plank"] = 10,
    },
})

 

As well as the traited you provided as well:

 

ProfessionFramework.addTrait('Nightmares', {
    name = "UI_trait_nightmares",
    description = "UI_trait_nightmaresdesc",
    exclude = {"Desensitized"},
    cost = -4,
    requiresSleepEnabled = true,
    inventory = {
        ["Base.PillsBeta"] = 1,
        ["Base.PillsSleepingTablets"] = 1,
    },
    OnGameStart = function(trait)
        Events.EveryTenMinutes.Add(function()
            local p = getSpecificPlayer(0)
            if p:isAsleep() and ZombRand(100) < 2 then
                p:forceAwake()
                p:getStats():setPanic(90)
            end
        end)
    end
})

 

And neither work. Is there a special place I have to place the "profession framework mod" in? I put it in: C:\Users\User\Zomboid\mods.

I also tried all this with the steam version and that did not work either.

Edited by leon2356

Share this post


Link to post
Share on other sites

I have the Framework mod in  ...\Zomboid\mods\ProfessionalFramework-master

I have my Profession lua in ...\Zomboid\media\lua\shared\MYPROFESSIONS.lua

 

There is an issue with your example....

Unlike [Perks.SmallBlunt] (no space) Long is just [Perks.Blunt]...  So the script stops at that mistake, and does not apply sprinting, or anything passed that line. Otherwise, I pasted your example in myprofession mod, and it appears in the setup option just fine...

 

ProfessionFramework.addProfession('Hitter', {
    name = "Pinch Hitter",
    description="When the bases are loaded with two outs...",
    icon = "",
    cost = 0,
    xp = {
        [Perks.Fitness] = 1,
        [Perks.Blunt] = 2,  <<<<<<===== FIX THIS SO IT READS AS SUCH
        [Perks.Sprinting] = 2,
    },
    
    inventory = {
        ["Base.BaseballBat"] = 1,
        ["Base.Baseball"] = 1,
    },
})

 

 

Share this post


Link to post
Share on other sites
Posted (edited)
On 3/23/2020 at 5:12 PM, Arsenal26 said:

I have the Framework mod in  ...\Zomboid\mods\ProfessionalFramework-master

I have my Profession lua in ...\Zomboid\media\lua\shared\MYPROFESSIONS.lua

 

There is an issue with your example....

Unlike [Perks.SmallBlunt] (no space) Long is just [Perks.Blunt]...  So the script stops at that mistake, and does not apply sprinting, or anything passed that line. Otherwise, I pasted your example in myprofession mod, and it appears in the setup option just fine...

 

ProfessionFramework.addProfession('Hitter', {
    name = "Pinch Hitter",
    description="When the bases are loaded with two outs...",
    icon = "",
    cost = 0,
    xp = {
        [Perks.Fitness] = 1,
        [Perks.Blunt] = 2,  <<<<<<===== FIX THIS SO IT READS AS SUCH
        [Perks.Sprinting] = 2,
    },
    
    inventory = {
        ["Base.BaseballBat"] = 1,
        ["Base.Baseball"] = 1,
    },
})

 

 

So, the PFM is in the same place as you have it but my profession mod in in: C:\Users\user\Zomboid\mods\leonProfessions\media\lua\shared/leonprofessions.lua

 

When i look in "zomboid" there is no "media" file.

 

I still tried to copy your fixed code into my file but the profession still does not show up in character creator.

 

Edit: also I have been trying this with just my mod and the profession framework mods on and no other mods.

Edited by leon2356

Share this post


Link to post
Share on other sites
3 hours ago, leon2356 said:

C:\Users\user\Zomboid\mods\leonProfessions\media\lua\shared/leonprofessions.lua

 

When i look in "zomboid" there is no "media" file.

Oh Ooops... my bad...  that's correct, should have read :

I have my Profession lua in ...\Zomboid\mods\MyProfessionsMod\media\lua\shared\MYPROFESSIONS.lua

 

Random thoughts...

- Are you testing on a new game ? or old save ? bcuz new mod memory may cause issues

- Right version of game ?

- Try disabling all mods, and re-enable them making sure PFM is activated before your custom professions mod...

- Console.txt throwing any errors ? scrolling all the way up may reveal where its hanging up or unable to find something...

 

Share this post


Link to post
Share on other sites

Ok, so.

- I am on version, 41.33.

- I am testing it on a new save.

- I have all mods off expect profession framework and my professions mod.  In the load order it is "Profession framework" then my mod.

- In Console.txt there is only one error "LOG  : General, 1585159547880> ERROR: Missing translation "UI_Loading_Mods" I'll attach a copy of it to this post. Maybe you will see something I can't.

 

console.txt

Share this post


Link to post
Share on other sites
5 hours ago, leon2356 said:

Ok, so.

- I am on version, 41.33.

- I am testing it on a new save.

- I have all mods off expect profession framework and my professions mod.  In the load order it is "Profession framework" then my mod.

- In Console.txt there is only one error "LOG  : General, 1585159547880> ERROR: Missing translation "UI_Loading_Mods" I'll attach a copy of it to this post. Maybe you will see something I can't.

 

console.txt 94.87 kB · 0 downloads

 

 

Ok, so PFM is loading just fine... but your leonprofessions mod is not getting loaded.... New professions should appear immediately after the console line :

LOG  : General, 1585178807101> ProfessionFramework.INFO: Adding Trait Jogger2

And be at the BOTTOM of the list in game character setup screen...

 

I did notice that there is an issue with examplemod refusing to load...

 

Are you sure you setup your leonProfessions mod correctly ?

ie, mod.info file in your leonProfessions folder...

 

Might wanna look there bcuz its trying to load "examplemod" and failing, and there is no sign of "leonprofessions" trying to load at all...

Share this post


Link to post
Share on other sites
Posted (edited)
21 hours ago, Arsenal26 said:

Are you sure you setup your leonProfessions mod correctly ?

ie, mod.info file in your leonProfessions folder...

OH GOOOOOOOD LOOOOORRRRRD!!!!!

 

That fixed it... I forgot to change the mod id in mod.info because all I did was copy and paste the mod.info from the example mod over. You are my hero!

Just Loaded it up and now I can see the profession.

 

I'm now a modder, YAY!

 

Edit: Is there anywhere I can see where the names of "perks" are so I don't have a repeat of the long blunt fiasco?

Edited by leon2356

Share this post


Link to post
Share on other sites
Posted (edited)

@Fenris_Wolf

 

So now that i got this working I think I found a bug?

When I try to add [perks.Tailoring] to my profession, the profession does not load. but if I remove it it works perfectly. Also I saw that the sewer trait is missing from default_traits.lua.

Edited by leon2356

Share this post


Link to post
Share on other sites
On 3/26/2020 at 12:52 PM, leon2356 said:

So now that i got this working I think I found a bug?

When I try to add [perks.Tailoring] to my profession, the profession does not load. but if I remove it it works perfectly. Also I saw that the sewer trait is missing from default_traits.lua.

PF knows nothing about individual perks. If adding it to your profession causes a error, then its going to be due to a typo on your end (ie: [perks.Tailoring] vs [Perks.Tailoring].

Need to keep your eye on the console.txt, since any errors will show up there, and will often let you know exactly where you've gone wrong.

defaults_traits.lua is just a example file atm and not actually used anyways. Its missing from there since I haven't had time to work on the mod since before tailoring was introduced.

Share this post


Link to post
Share on other sites
Posted (edited)
4 hours ago, Fenris_Wolf said:

PF knows nothing about individual perks. If adding it to your profession causes a error, then its going to be due to a typo on your end (ie: [perks.Tailoring] vs [Perks.Tailoring].

Need to keep your eye on the console.txt, since any errors will show up there, and will often let you know exactly where you've gone wrong.

Yep you were right. I did a copy and paste and it works now mb sorry. Thanks for the help love your mod! I do hope you get the chance to work on it some more and add the other traits it is missing.

Edited by leon2356

Share this post


Link to post
Share on other sites
Posted (edited)

Just released my first full mod!

 

Get a job!

https://steamcommunity.com/sharedfiles/filedetails/?id=2040632854

 

Thanks again for making profession framework. Had a lot of fun making my mod and I made sure to credit you! If you want I can friend you on steam and credit you as a co-creator.

 

Now I just got to learn how to make traits.

Edited by leon2356

Share this post


Link to post
Share on other sites
Posted (edited)

@leon2356Will try it out! I have one small suggestion though, you should add the profession framework as a dependency for your workshop mod, so that if people subscribe to your mod they automatically get PFM.

 

@Fenris_WolfShould I bump the version on the workshop?

Edited by Dr_Cox1911

Share this post


Link to post
Share on other sites
Posted (edited)
9 hours ago, Dr_Cox1911 said:

@leon2356Will try it out! I have one small suggestion though, you should add the profession framework as a dependency for your workshop mod, so that if people subscribe to your mod they automatically get PFM.

 

@Fenris_WolfShould I bump the version on the workshop?

@Dr_Cox1911

I tried my mod with the version on steam and it does not work. You need the github version for it to work. When the version on steam updates i will test it and if it works I'll add it as a dependency.

Edited by leon2356

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...

×
×
  • Create New...