I want to, through scripting, close a store once a PC has selected 1 item from the store...
Can someone help with this?
How To: Close Store
Débuté par
_Guile
, avril 18 2012 01:06
#1
Posté 18 avril 2012 - 01:06
#2
Posté 18 avril 2012 - 04:12
Does the store only sell one item?
#3
Posté 18 avril 2012 - 04:24
Leurnid wrote...
Does the store only sell one item?
No, it sells multiple items, but only 1 item is allowed to be taken out of it, and the other store allows 2 items to be taken out of it, I'll use a variable to check the # of items taken, I just need to know which function to use to make the PC close the store...
Anyone?
#4
Posté 18 avril 2012 - 06:01
There is not one. The store the closing of the store is handled by the client. I guess you could try clear all actions or have the PC do some other action. You will also need to use the On item Aquired module event to capture the item being sold.
I am not at home right now so I can not test any of that out.
I am not at home right now so I can not test any of that out.
#5
Posté 18 avril 2012 - 06:24
I appreciate that you'd like to do this with a store, but this may be better handled by a dynamic conversation that provides a menu of items to select from.
#6
Posté 20 avril 2012 - 07:22
maybe get the gold from the merchant and if it drops close the store.not sure if thats possible unless maybe you link the store to the npc somehow.
#7
Posté 20 avril 2012 - 09:54
I just had an idea. If nothing else works try opening a fake store (a store with no inventory, gold, or ability to identify items). This should close the current store and make it look like all the items disappeared after the player selected one.
#8
Posté 20 avril 2012 - 01:48
How about using the Store OnOpen event to set a variable on the PC that the store is open? Then have the module OnAcquire check if that that variable is set on the PC and, do a ClearAllActions() to close the store. I'm not 100% sure if ClearActions will close the store though, but there's other things you could try in the OnAcquire script at that point though too - like opening the blank store or quickly starting and ending a blank conversation or something. I'm sure there are plenty of actions that would result in force closing the store.
Oh - and the store OnClosed event would need to contain a script that removes the variable set on the PC in the store OnOpened event.
Oh - and the store OnClosed event would need to contain a script that removes the variable set on the PC in the store OnOpened event.
Modifié par Thayan, 20 avril 2012 - 01:49 .
#9
Posté 20 avril 2012 - 02:04
Whizard, thats a good idea. It gives the player the right feedback.
#10
Posté 22 avril 2012 - 06:22
ya i guess you could do a count on the container or something like that.check to see if somethings taken out....
rusty
rusty
#11
Posté 22 avril 2012 - 04:37
ClearAllActions() does NOT work, unfortunately.... (I've tried it 2 ways)
The Items are scripted so that when the PC acquires the item it will ClearAllActions() on the PC..
So, what I'm going to do is just remove the inventory from the store once the PC has obtained the one item they chose...
I'll have to use a fake store, or an empty one that is, and fill the empty store with the real store's goods...
Thanks for the help guys...
The Items are scripted so that when the PC acquires the item it will ClearAllActions() on the PC..
So, what I'm going to do is just remove the inventory from the store once the PC has obtained the one item they chose...
I'll have to use a fake store, or an empty one that is, and fill the empty store with the real store's goods...
Thanks for the help guys...
Modifié par _Guile, 22 avril 2012 - 04:38 .
#12
Posté 28 avril 2012 - 03:40
As the player buys the item, cutscene_seize him and walk him away in any direction.
Move him to a distance any greater than 2 meters from where he was standing in the moment that the store opened. The store will self-close gracefully.
-fox
Move him to a distance any greater than 2 meters from where he was standing in the moment that the store opened. The store will self-close gracefully.
-fox
#13
Posté 28 avril 2012 - 07:11
the.gray.fox wrote...
As the player buys the item, cutscene_seize him and walk him away in any direction.
Move him to a distance any greater than 2 meters from where he was standing in the moment that the store opened. The store will self-close gracefully.
-fox
Say that's a pretty sharp idea!
Why didn't anyone else think of this?
Modifié par _Guile, 28 avril 2012 - 07:12 .





Retour en haut







