Jump to content

Home

Challenge: How does requireitemmask field work in spells.2da?


tk102

Recommended Posts

Okay no one gets the cookie.

 

Here's the answer:

 

Both the forbiditemmask and the requireitemmask use the same bits to describe which baseitems have permissions to work for a spell. Those bits are defined as follows:

 

0x0001 - Armor_Class_4

0x0002 - Armor_Class_5

0x0004 - Armor_Class_6

0x0008 - Armor_Class_7

0x0010 - Armor_Class_8

0x0020 - Armor_Class_9

0x0040 - Lightsabers

 

It does not appear that there are any other baseitems defined with a bitmask.

 

To determine if a spell can be used, swkotor performs the following logic:

Permission = 
(([i]forbiditemmask[/i] AND [i]baseitem[/i]) == 0) AND (([i]requireitemmask[/i] AND [i]baseitem[/i]) = [i]requireitemmask[/i])

Link to comment
Share on other sites

so if 0x0040 includes all lightsabers, even player made ones that use a different row in baseitems.2da? i mean, logically acording to what you said it would check requireitemmask and see 0x0040 and then check baseitems and look for 8, 9, or 10 which are the three kinds of lightsabers. but would it also know to look in row 92 for a player made lightsaber?

 

the problem here is twofold. if there were a way to limit it to just useing the row for the player made items, that would effect everything that used 0x0040 (i.e. throw lightsaber could only throw that lightsaber) if you edited it to just include that lightsaber with the other ones then all lightsabers would be able to cast that spell, not the one specific one. perhaps some kind of script could be made?

 

btw, since i dont know how to do scripts, "scripts" has become the answer to any question i dont understand.

 

and melba toast looks... mundane to say the least. not good, not bad... just kinda meh. like real toast's unhappy older brother that still lives at home

Link to comment
Share on other sites

I don't know where the reference is that defines the mask for each item. I had to figure it out by trial and error. I hope it's not hardcoded. I expected to find some 2da that had the cross-reference between baseitems and itemmasks -- either that or an entry in baseitems.2da itself. But alas, it is missing.

 

Simple test though -- can you throw your special "Ice" lightsaber that you made? That saber used a custom made baseitem, didn't it? If you can, then some column in baseitems.2da crossreferences itemmask (perhaps itemtype?). If not, then the row entries themselves are crossreferenced to the itemmask.

 

[unwraps another cookie...]

Link to comment
Share on other sites

I have made a couple of new baseitems in the past and found that If say you copyed the lightsaber row and pasted it as row 92 the lightsaber would not function like a lightsaber(I couldn't get force jump to work). It was also stated in another post about makeing a lightsaber a new baseitem that it would not use dex as the modifier, instead the new saber used strength.

 

Sometimes I fell like I am only seeing 75% of the game mechanics.

Link to comment
Share on other sites

well some how i can throw the custom lightsaber, which just makes me more confused. i have no idea how the game new it was a lightsaber, there must be something else at work... i couldnt tell you what it is tho.

 

also t7, i was going thru kashyyyk with my gaurdian to test something for another mod and using my saber (just cause i think its pretty) and i did a force jump using my saber, which i made by copying the lightsaber row into row 92.

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...