Jump to content
Banjo

How do I "duplicate" an existing trait to make a profession-exclusive version?

Recommended Posts

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

Share this post


Link to post
Share on other sites

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.

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...