Ivanovich wrote...
Thank you for your help. After removing the "heaps" of unnecessary functions, it worked. I apologize if my code offended you. I am still learning.
As for the "bizarre and unnecessary" combination of the player and area tag in addition to the word "jewel", this seemed sensible given that there would be multiple star jewels all over the place from multiple players, and the only way to successfully call the right location to the right jewel would be to assign some sort of unique ID to it. Again, if I am wrong, I apologize. I'm trying to learn this stuff.
Offended?
'> Not at all. Hopefully that didn't sound too harsh. It was actually some combination of bizarre, unnecessary, or nonfunctional. The problem there is that, especially with only 3 letters, neither the player nor the area portion of that combined identifier will be guaranteed unique. Characters can have similar names (think Fred, Frederick, Fren, Frenetic Joe, etc), as well as identical names, and area tags can also be similar and identical. Either you NEED that portion of the tag as a unique identifier, or you don't. If you need it to be unique, what you have there will break quickly as more players use it - hence, nonfunctional. If you don't, it's deadweight code - hence, unnecessary. Either way, it's a bizarre thing to do.
The fix is to remove it if you don't need it, or to use truly unique identifiers if you do. I would go with the area resref
and a 16-character chunk of the playername (NOT character name, which is what you are using). Having not used the bioware database in the last 5 or 6 years, I can't attest to this myself, but a poster above noted a
32-character limit for the vanilla database, or I'd be suggesting full playername (resrefs are 16 characters max).
So, DO you need it? As written, I'm not sure. I do know that all the information you're storing on that will be available
when the gem is used as well, if the gem is undroppable, making it unnecessary if it's written a certain way. I don't see you setting the Cursed flag on it though. Such campaign variables can be keyed to a particular player anyway, in the optional parameter, though, for some reason, you chose to specify the jewel.
My suggestion to you as someone who's learning scripting nwscript would be to experiment enough to understand how all the parameters of the functions that you're using work. I remember being confused not just by campaign variables once, but by plain old local variables. I also remember, however, disliking how much time every little thing took to get working, since there was so much to learn. If you don't want to invest the full amount of learning time up front, but go at it gradually, I get that too.
Lastly, a warning. When you add areas to your module, I believe your stored campaign locations will subject to breakage. It might be more advisable to use a string to store the data, combining the x, y, and z coordiates with the area resref (at minimum). If you're curious about how to do that, I'll be happy to explain.
Of course, most of this is moot anyway past the learning experience, since, as other posters have noted, setting the local on the item will store it on the character's bic as soon as the character is Exported, either via the Export functions or by exiting the server.
Funky
Modifié par FunkySwerve, 08 juin 2011 - 04:29 .