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

03-30-2004, 06:28 AM
A cookie for anyone who can figure this out. (And yes, I know 0x0040 means 'requires a lightsaber'.)

03-30-2004, 09:23 AM
can i say "it tells you what items you require for the *spell*" and get the cookie ? :D

03-30-2004, 01:14 PM
No, you get a piece of melba toast for being a smart monkey.

03-30-2004, 07:48 PM
whats melba toast???

03-30-2004, 08:11 PM
Originally posted by lowiej
whats melba toast???
It's this (http://magasin.iga.net/common/img/product/big/5695142060.jpg) :D

Sorry for being off-topic. Not knowing the answer that's the only thing i could do.

03-31-2004, 06:35 AM
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 =
((forbiditemmask AND baseitem) == 0) AND ((requireitemmask AND baseitem) = requireitemmask)

03-31-2004, 08:24 AM
Originally posted by Darth333
It's this (http://magasin.iga.net/common/img/product/big/5695142060.jpg) :D

Sorry for being off-topic. Not knowing the answer that's the only thing i could do.

hmm i think ill pass on the melba toast thing

04-02-2004, 02:42 AM
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

04-02-2004, 02:54 AM
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...]

04-02-2004, 04:22 AM
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.

04-02-2004, 05:33 AM
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.