Jump to content


Photo

Registering an item's sale to a store


  • Please log in to reply
7 replies to this topic

#1 temnix

temnix
  • Member
  • 983 posts

Posted 26 March 2017 - 01:04 AM

Any way to check if a store has just bought a particular item? Like a fake jewel. You sell fakes, you increment globals, you get trouble coming. Any way to do that?



#2 -kjeron-

-kjeron-
  • Guest

Posted 26 March 2017 - 07:12 AM

Create an undroppable container(bag of holding) matching the filename of each store, give it to it's shop-keep.

Assign/append a common script to all shop-keeps using the HasItem("resres",Myself) trigger for each item.

Add a safeguard so it only triggers once per item.

Easiest would be to just destroy the item, DestroyItem("resref"), but you could not detect quantity with it.

If you want to check quantity of each item, you would need to use RemoveStoreItem().

Obviously, don't check for items the shop-keep normally sells.

 

IF

HasItem("fake01",Myself)

THEN

RESPONSE #100

DestroyItem("fake01")

IncrementGlobal("con_artist","GLOBAL",1)

END

 

or 

 

IF

HasItem("fake01",Myself)

THEN

RESPONSE #100

RemoveStoreItem("storeres","resref",1)

IncrementGlobal("con_artist","GLOBAL",1)

END



#3 temnix

temnix
  • Member
  • 983 posts

Posted 26 March 2017 - 09:44 AM

So they do get added to the shopkeepers' inventory, only don't drop on death. That's what I wanted to know. The scripts are still only going to run afterwards, right? I mean, after the store window is closed. So you could sell a lot of fakes wholesale, and only then face the consequences. Well, it's probably even better this way. More space for cunning.



#4 Sam.

Sam.
  • Administrator
  • 1294 posts

Posted 26 March 2017 - 09:58 AM

So they do get added to the shopkeepers' inventory,
If and ONLY if you:
Create an undroppable container(bag of holding) matching the filename of each store, give it to it's shop-keep.
and even then only technically.

"Ok, I've just about had my FILL of riddle asking, quest assigning, insult throwing, pun hurling, hostage taking, iron mongering, smart-arsed fools, freaks, and felons that continually test my will, mettle, strength, intelligence, and most of all, patience! If you've got a straight answer ANYWHERE in that bent little head of yours, I want to hear it pretty damn quick or I'm going to take a large blunt object roughly the size of Elminster AND his hat, and stuff it lengthwise into a crevice of your being so seldom seen that even the denizens of the nine hells themselves wouldn't touch it with a twenty-foot rusty halberd! Have I MADE myself perfectly CLEAR?!"

--<CHARNAME> to Portalbendarwinden

--------------------

post-10485-0-15080600-1348188745.jpg
___________Old pen and paper modules of the 70s and 80s.___________

CA Forums CA Homepage


#5 Sam.

Sam.
  • Administrator
  • 1294 posts

Posted 26 March 2017 - 09:59 AM

.

Edited by Sam., 26 March 2017 - 10:00 AM.

"Ok, I've just about had my FILL of riddle asking, quest assigning, insult throwing, pun hurling, hostage taking, iron mongering, smart-arsed fools, freaks, and felons that continually test my will, mettle, strength, intelligence, and most of all, patience! If you've got a straight answer ANYWHERE in that bent little head of yours, I want to hear it pretty damn quick or I'm going to take a large blunt object roughly the size of Elminster AND his hat, and stuff it lengthwise into a crevice of your being so seldom seen that even the denizens of the nine hells themselves wouldn't touch it with a twenty-foot rusty halberd! Have I MADE myself perfectly CLEAR?!"

--<CHARNAME> to Portalbendarwinden

--------------------

post-10485-0-15080600-1348188745.jpg
___________Old pen and paper modules of the 70s and 80s.___________

CA Forums CA Homepage


#6 temnix

temnix
  • Member
  • 983 posts

Posted 27 March 2017 - 06:42 AM

Edit: Never mind. What kjeron said really seems the only way to do it. Thanks.

 

Oh, and if some other modder has already done this trick and given all shopkeepers these bags - a good idea for a general-use mod, by the way - and if I copy mine over and replace them, that won't ruin anything for the other mod, will it? The bags can't have any special properties besides being undroppable, right?

 

Also what would be the Weidu command for adding an item and making it undroppable? With COPY_EXISTING, I presume?


Edited by temnix, 27 March 2017 - 10:54 AM.


#7 The Imp

The Imp

    Not good, see EVIL is better. You'll LIVE.

  • Member
  • 5150 posts

Posted 28 March 2017 - 05:38 AM

...
Also what would be the Weidu command for adding an item and making it undroppable? With COPY_EXISTING, I presume?
Yes...
COPY_EXISTING <storekeeperfile>.cre
ADD_CRE_ITEM ~<itemname>.itm~ #0 #0 #0 ~undroppable~ ~inv1~
It would help to give ACTUAL file names, so people don't need to replace them with "stick this up your %&¤#" !

Yep, Jarno Mikkola. my Mega Mod FAQ. Use of the BWS, and how to use it(scroll down that post a bit). 
OK, desert dweller, welcome to the sanity, you are free to search for the limit, it's out there, we drew it in the sand. Ouh, actually it was still snow then.. but anyways.


#8 temnix

temnix
  • Member
  • 983 posts

Posted 28 March 2017 - 10:57 AM

Thanks for the code. The bag needs to be called the same as the store, so that's the file name for you. There are dozens of stores in BG:EE alone.