Banjo Posted April 6, 2020 Share Posted April 6, 2020 I want to make a profession that adds two existing traits to the player. Easy! Except, if they already exist as "normal" traits, they can be removed without changing the profession, resulting in glitches to the points system. Yup, I remember that issue from years ago! So the obvious fix is to make a *duplicate* of the trait (say, "Inconspicuous2") that cannot be removed (and otherwise doesn't show up in the trait list) and have *that* be the trait that gets added by the custom profession. This is how the Chef and Burger Flipper seem to do it (with "Cook2" as an unremovable duplicate of "Cook"). Solved! Except every time I try that I get an error and the profession description glitches. I've double-checked that the icon is correct (it shows up) and the description pointers are correct (custom Translate\EN.txt). I suspect the issue is that these traits are hardcoded when they effect zombie detection, panic, etc. perhaps? Or maybe I've just missed something obvious? The issue is clearly with that trait since when the profession is included, *all* custom professions have no description in-game... when the problematic one is removed, the ones after it have descriptions again! Attached is my code for profession, trait and description if that helps! ProfessionOfficeWorker.lua TraitInconspicuous2.lua UI_EN.txt Link to comment Share on other sites More sharing options...
ohgodspidersno Posted May 14, 2020 Share Posted May 14, 2020 Check out FMJ's lockpick mod (not mine, it has to be FMJ's) and poke around. He adds a few traits, two of which are nearly identical except one is automatically given to burglars for free and the other can be selected for a few points. Essentially there is a bit of code that creates the trail, and then another bit that actually puts it on the list. There's also an optional third bit that gives it automatically to certain professions. Link to comment Share on other sites More sharing options...
ohgodspidersno Posted May 14, 2020 Share Posted May 14, 2020 I didn't fully read your post before commenting, so apologies if my response doesn't help at all. I'll leave it up in case it does. Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now