Custom Races and Use Limitation

OK so I have a bit of an issue and I can work around it for sure but I would like to know if there is a way to not have to so that things are a little cleaner. I am also worried it might cause additional problems down the road.

My game has removed all the PC races, effectively, and replaced them with new races.

There are 5 different kinds of human (4 are human models, 1 is actually using the Dwarf model) there are half-orcs (renamed Goblinoids), playable Minotaurs and Ogres. There are also 3 types of “fey” who replace the elves using the Elf, Halfling and Gnome bodies.

My issue is when I am setting up Use Limitation for Races on Items.

In my list I see “Fey” but if I pick that none of the Fey can actually use it. However if I pick their display name “Fey (Large)” or “Fey (Meduim)” it seems to work just fine.

Is there a link somewhere that I am missing to get the racial type properly recognized? All 3 of the Fey share the same talk file descriptions with the exception of their name.

This is my racialtypes.2da entry for them I am just not sure what it’s pulling or why. I did give them each a different “Name” so that players could tell what body type they are picking. Is there a 2da that I need to edit for it to recognise the “RACIAL_TYPE_FEY” Constant added?

racial_type.2da example.txt (2.4 KB)

The item property UseLimitationRacial links directly into the rows of racialtypes.2da. So if you have three types of fey (large, medium, small) in racialtypes.2da and all these should be able to use an item you would have to add a UseLimitationRacial property for each type.

I’m not sure but I don’t think this constant RACIAL_TYPE_FEY is used anywhere.

There’s probably a fourth ‘Fey’ in your racialtypes.2da and that’s why you have four Feys in the list. But they are all different racial types - even if they share some tlk entries.

1 Like

RACIAL_TYPE_FEY is a constant and a representation of the integer 17. These are defined in header (#include) files for the toolset script. I don’t think you can change them via 2da or if that would even do anything (it might just be for reader reference). Someone recently told me on the NWNX discord that there was no way to consolidate those three fey races into the one larger fey category for item properties. However the most recent NWNX update has a script function that lets you set the Favored Enemy feat for a racialtype. So now you would at least be able to have one favored enemy feat for those three races plus all other Fey. That’s the only other limitation for custom races that I have thought of. There is a bug where custom races are invisible until reportedly reinstalling the game (though I have never personally gotten the bug between 3 laptops and accounts). I made a ticket for that. You’re not alone in the fight for custom races that’s for sure.

I was worried that might be the case. I was really hoping to avoid using sub-races… it’s too bad that the constant value wasn’t used instead.

I guess I will just have to have 3 different types of Fey. Unfortunately I am going to have 5 different types of humans so it’s really going to be a pain to have clothing styles and equipment race locked.

Anyone know if there’s a way to add a new item property that is the opposite of used by. Meaning instead of being a “you must be this race” make it a “you can’t be this race” sort of thing.

There’s no way to that I know of to make an item property that disables use like that. I’m not an expert in item properties, so don’t quote me on that. Let us know if you find out how!

If the things you want to restrict can be equipped then you can do it with scripts. But, yeah, you can’t make it show red in inventory, I think.

This is not doable perfectly without NWNX as you cannot make the item “red” in vanilla.

You can unequip it after being equipped though which sort of works, but is quite ugly solution imo. But if you want to go this route then, you need to create a copy of the race limitation property on different line and replace all items that exists and remove old race limit property with new one (that can be done via scripting too). Then script the new property in OnEquip event, check if itemproperty is fey and if it is check if player race is any of the feys, if not force unequip, etc.

There are many things you can do with itemproperties when you know how, see: (but this uses NWNX a lot)

That’s what I said, but you used more words :wink:

If you want to make an item not useable by a human char you could add a pseudo race ‘no human’ to racialtypes.2da. Now when a human char acquires the item you add the item property UseLimitationRacial: no human to the item. In the inventory the item becomes red (because of course the human char is not of type ‘No Human’) and in the description it reads ‘Use Limitation: Racial Type: No Human’. Problem is that it requires scripting and it works only for items in the players inventory.

Good thinking, so it can be done without NWNX afterall.

So, to do it:

  1. make vanilla Use Limitation: Race invisible
  2. create a copy of this property that will be visible to player
  3. manually remove vanilla Use Limitation: Race from items in your module and replace it with the new duplicate itemproperty
  4. in OnAcquire event: check if player, fulfills the race limitation, if yes do nothing, if not add a vanilla (invisible) Use Limitation: Race property with value other than player race
  5. in OnUnAcquire event: remove all vanilla Use Limitation: Race properties from item
1 Like

The problem with that approach is what I really want is a weapon say usable by anyone BUT a dwarf or say armor that can be worn by anyone who isn’t a Halfling or Gnome.

Right now if I only wanted elves excluded I would have to add Human, Dwarf, Gnome, Halfing, HalfElf, Halforc, etc to the list of “Allowed” races.

I don’t’ think there’s a clean way to do it without script or NWNX alas

itempropdef.2da. if you set column GameStrRef to **** the item property is not visible to the player, once invisible you use the original race limitation property only as a means to get item useable or not useable and you replace that property on all items in module with new itemproperty which will be a copy of the vanlla one OR brand new property that will work the way you want ie. as I gave example you can name it “Use Limitation, Anybody But: #Race#” which will simply work as a visual notification for players of how the item is limited.

Wow never have I struggled to write a post like this before … Literally been spending almost an hour writing and then re-writing this. Befre I jump in though I want to note I said that it would not be possible without scripting or using NWNX, just wanted to clarify that.

I find the 5 steps mentioned above very confusing and muddled unfortunately. Rather than assess them or try and clarify I have settled on just writing down the process as I understand it. In this example I will be wanting to create an item that can be used by anyone but an elf.

  1. Create an entry in ractialrypes.2da called “No Elf”
  2. Create a new item and add Use Limitation: No Elf to it.
  3. In the OnAcquire check the players race
  4. If they are an Elf leave it alone all alone we are done
  5. If they are a Dwarf then add Use Limitation: Dwarf to the item (they can now use it).
  6. In the OnUnAcquire look at the item properties. If it has a Use Limitation: No anything then go through all the item properties and remove any Use Limitations that do not start with “No” .

I am intrigued by the implied ability to make an Invisible item property though how would one do something like that? I am not seeing anything in the 2DA’s that would indicate they are a visible or invisible item property.


damn I accidentally replaced previous post with new answer…

No worries so the steps I outlined above would work.

What I would want to add to that process is a copy of the Use Limitation property but set its GameStrRef to ****

That way I can add invisible Use Limitation: Human to allow the human to use the item without seeing that. It should also allow for me to keep the original limitations for those cases where I do want just one or two races to be able to use a thing.

I am off to give that a try now. Thanks for the help!

I don’t think you understood me.

Vanilla property functionality cannot be changed. So you need to create a duplicate of this property on new line (and new properties does nothing - you need to script their effects) and use this duplicate property on your items instead of vanilla property.

Then you make vanilla property invisible to player and use it only as a means to make item non-useable, if the player doesn’t fulfill the limitation imposed by your new and duplicate item property.

BTW aren’t you the creator of the random items (and properties) system on vault?

I think I get it now.

I am playing with some options around here to see what will work best for my needs. Thanks for the help.

Also if you are talking about this one then you betcha! :wink: It’s more random gear and treasure spawning than random item properties though.

Wanted to try and avoid scripting this, but for sure I had to. First time playing with Item properties so all good there.

Working like a hot damn though so thanks for the help. I fear I may have unleashed a monster now that I am playing with custom Properties. LOL.