Aller au contenu

Photo

Item Structs (Materials)


  • Veuillez vous connecter pour répondre
9 réponses à ce sujet

#1
CrawBird

CrawBird
  • Members
  • 9 messages
I would like to find a way to determine which material an item (like weapons and armor) are made out of such as adamantine, darksteel, etc.
There isn't a function made for this already.

According to some document I found somewhere, something called Bioware Aurora Item Format , there a number of item properties defined in a struct such as "AddCost", "BaseItem", "Charges", etc.
Is there any way to access this information from this struct?  If so, I bet "Material" is one of the new ones in NWN2.

#2
MasterChanger

MasterChanger
  • Members
  • 686 messages
I don't know why it doesn't come up in ScriptAssist like SetItemBaseMaterialType does, but GetItemBaseMaterialType is defined.

#3
CrawBird

CrawBird
  • Members
  • 9 messages
Wow, that's great; thanks!

I actually had another question that I thought would be answered by instructions of how to uses item structs: I may want to start making scripts that change an item's appearance and color. Is that best done as a struct thing or should I be relying on "CopyItemAndModify"?

#4
GhostOfGod

GhostOfGod
  • Members
  • 863 messages
I'm honestly not sure if this applies to NWN2 but in NWN1 the vector data type/struct is the only one that you can pull public data from with the "." operator. For the other datatypes you are limited to whatever functions are available, to get the info you need. So yes you will probably be using "CopyItemAndModify" or similar functions.

Modifié par GhostOfGod, 15 juin 2011 - 12:48 .


#5
CID-78

CID-78
  • Members
  • 1 124 messages

CrawBird wrote...

I would like to find a way to determine which material an item (like weapons and armor) are made out of such as adamantine, darksteel, etc.
There isn't a function made for this already.

According to some document I found somewhere, something called Bioware Aurora Item Format , there a number of item properties defined in a struct such as "AddCost", "BaseItem", "Charges", etc.
Is there any way to access this information from this struct?  If so, I bet "Material" is one of the new ones in NWN2.


You already know how to get material.

you can't reach AddCost because it's just one parameter in the item value calculations.

but you can reach BaseItem. GetBaseItemType() and charges can also be reached with a similar function GetItemCharges() or something like that i don't have the toolset nearby, but I know it's there.

#6
The Fred

The Fred
  • Members
  • 2 516 messages
Being able to access the internals of structures like itemproperties and locations would be pretty handy, but I don't think it's possible. I didn't even know GetItemBaseMaterialType existed, though - I was using tags and local ints - so thank for that! ;-)

#7
MasterChanger

MasterChanger
  • Members
  • 686 messages
Yeah, I'm pretty sure this has come up before. I just found a (cached, for now) thread from nwn2forums.bioware.com started by Lance Botelle called "GetItemBaseMaterialType (v1.23 function) - Do I need an include file for this?" He notes that GetItemBaseMaterialType does not come up in ScriptAssist.

Grinning Fool does identify it as working (and I think experience supports this) but confirms that it doesn't appear in Script Assist. In situations like this when I know something should be defined but can't find where, I usually turn to the CSL lookup, as I linked above.

Modifié par MasterChanger, 16 juin 2011 - 10:50 .


#8
The Fred

The Fred
  • Members
  • 2 516 messages
I've just put it in my Rust Monster logic, and it seems to be working just fine - as far as I can tell. It certainly compiles OK, anyway.

#9
Dann-J

Dann-J
  • Members
  • 3 161 messages
Speaking of SetItemCharges (which we weren't) - is there a way to reset per day usage of an item, apart from having the player rest? SetItemCharges only seems to work for items with a fixed number of charges, rather than charges per day. I could destroy the item and recreate it from a blueprint, but that would remove it from its hotbar slot.

#10
The Fred

The Fred
  • Members
  • 2 516 messages
Not that I know of, at least off the top of my head.