Originally Posted by Dak Drexl
Thanks a lot for this tut, but I just want to point out that in the script there is a problem:
// ST: st_startstore.nss
object oStore = GetObjectByTag("TAG_OF_STORE_HERE");
object oSpeaker = GetPCSpeaker();
oStore = CreateObject(OBJECT_TYPE_STORE, "RESREF_OF_STORE_HERE", GetLocation(OBJECT_SELF));
DelayCommand(0.5, OpenStore(oStore, oSpeaker));
That exclamation point needs to come out if you want the script to work. It will still compile with it in, but it won't work unless you take it out; just a future warning to anyone!
But thanks again for this
Uh, no. The exclamation point is a negation operator. It makes the script create the store object if it does not already exist
. If you remove the negation operator you'll spawn a new instance of the store object every time you talk to the merchant, instead of using the one that you already spawned the first time you talked to them. You'd flood the samegame with store object instances if it's a frequently visited merchant.
If you remove the negation operator you'd spawn the store object when an object with that tag already exists. So if your variant "works" it would mean that you've specified the tag of another non-store object within that area that already exists (and your store likely has the same tag as such an object). Change the tag of your store to something unique and it should work.