SetName(oItem, sName) is not always working?
#1
Posté 14 décembre 2009 - 02:46
I've noticed that it happens on specific objects like the large wooden shield and the chainmail boots. It's very, very strange.
Does anyone have any idea why this is? The documentation for this function makes it seem like whatever string you set via it should always take precidence.
Thanks
#2
Posté 15 décembre 2009 - 10:37
This is a real big problem for me. I can't reliably change the names on items at runtime even though the documentation says that I can. Any help is desperately needed (even a, "Sorry it's bugged right now" would be great...)
Edit:
This is very bizzare, but it appears that if I call GetName(oItem) after I call SetName(oItem, sName), then the name that I set will show up in the game. If I don't do this, then it appears that the names show up about half the time.
What the heck?
Modifié par JJM152, 15 décembre 2009 - 10:56 .
#3
Posté 15 décembre 2009 - 08:11
#4
Posté 15 décembre 2009 - 09:39
JJM152 wrote...
This is very bizzare, but it appears that if I call GetName(oItem) after I call SetName(oItem, sName), then the name that I set will show up in the game. If I don't do this, then it appears that the names show up about half the time.
What the heck?
Simple. The names set by SetName() don't stick. After a travel to another zone, or a save/load cycle (basically : whenever the items are recreated from their resource) the names are reverted to the one set in the resource. which makes sense, somehow, since the name is a property of the object and not one of the variables serialized with the object. (this is but my understanding, don't quote me on this ^^)
As for a solution, well, me I just push the names into the module vars somehow, and forcefully rename the items once more upon the game load and area transitions. <_<
Modifié par Phaenan, 15 décembre 2009 - 09:40 .
#5
Posté 15 décembre 2009 - 10:53
#6
Posté 15 décembre 2009 - 11:29
Craig Graff wrote...
I seem to recall that SetName does persist through area transitions, just not through save/load. Party members are the only exception to this, as far as I'm aware.
Can you elaborate a little bit on this Craig?
Does SetName() persist if the item is in the party inventory, is that what you mean - or do you mean using SetName() on the party members themselves?
What about local variables set on objects? Do they persist?
If I have to write some sort of hack to store items on the module, then I guess I will... but this is kind of dissapointing
#7
Posté 16 décembre 2009 - 04:13
You're probably right. That was more like a guess on my part than anything else. ^^Craig Graff wrote...
I seem to recall that SetName does persist through area transitions, just not through save/load.
Yeah. But adding a new local var on var_items would mean every items in every area would have to store a new var. I'm not sure whether such a thing could have performance impact or not, tho.What about local variables set on objects? Do they persist?
Modifié par Phaenan, 16 décembre 2009 - 04:14 .





Retour en haut






