HomeUser Control Panel (unavailable in archive)ForumsTutorialsArt GalleryResourcesMaps

Weird Event - Unit cannot afford item?

12-01-2004, 12:10 AM#1
YellowSubmarine
I am wondering if it is at all possible for the game to recognize an event in which a player attempts to buy an item, but cannot afford it. I'm not sure I've seen any such solution in the GUI, but a JASS solution will satisfy me too.

Thanks in advance.
12-01-2004, 12:27 AM#2
Taur
Quote:
Originally Posted by YellowSubmarine
I am wondering if it is at all possible for the game to recognize an event in which a player attempts to buy an item, but cannot afford it. I'm not sure I've seen any such solution in the GUI, but a JASS solution will satisfy me too.

Thanks in advance.
umm not sure, this method though uses WEU (for the item costs)

use the interger comparison, in if/then/ else multiple functions and make it so that it's like this gold cost of item is greater than player's gold

and make another one using wood then use you're actions
12-01-2004, 01:37 AM#3
YellowSubmarine
What you just said gave me some Conditions. I need an Event.
12-01-2004, 01:54 AM#4
a thing
E- A hero manipulates an item

C- Item type==ITEM TYPE
(Owner of (Hero manipulating item)) Current gold >=price of the item type
12-01-2004, 01:59 AM#5
YellowSubmarine
Unfortunately, "Manipulates an Item" is not an Event. Events "Uses an Item," "Acquires an Item," and "Loses an Item" do not apply here. Please have the courtesy to check that your triggers exist before you advise someone to use them.

Help still appreciated; thanks in advance.
12-01-2004, 02:06 AM#6
a thing
>.< Sorry. Try the event "Unit - A unit Sells an item (from shop)".
12-01-2004, 02:12 AM#7
YellowSubmarine
Nope, nothing; no selling actually occurs. Also, sorry if I came off a bit rude in the last post; after all you're only trying to help. ^_^
12-01-2004, 02:24 AM#8
harshateja
Im probably just saying absolutely nothing of value but isn't there an event like a unit is given an order? Otherwise what you might do is set the event to every .o1 seconds and the actions be a if/then/else command.
12-01-2004, 03:26 AM#9
YellowSubmarine
You're the closest to the problem so far, actually; when I tell my unit to buy an item, he is actually issued an order. However, it seems that this only qualifies as an order when the player has enough gold to buy the item; otherwise it's somehow not an order :\ Also, a Periodic Event wouldn't help me, as I need some way of identifying what item the player is attempting to buy.

You guys are trying, at least; I appreciate any help.
12-01-2004, 07:43 AM#10
aaero
If you can't find out how to do this, you could trigger around it. Set all items to 0 gold cost, and then check to see if they have the money through a trigger (now you can use that Unit Sells an Item trigger). You'd have to edit the tooltips to display the gold cost though, and it might look awful. Just a thought for you to work with.
12-01-2004, 12:22 PM#11
Guest
what do you want it to do anyway?maybe there is some outher way without triggers...
12-01-2004, 12:33 PM#12
AntJAB
Hmm, according to my minute knowledge of WC3, there is no way to dedect the failed purchase of an item. And yes, you could set the cost to 0 and trigger it all yourself, but it could get sloppy. For instance the item would have a cooldown if someone tried to purchase too many, even if he never bought one.

Hope you figure something out.
12-01-2004, 08:36 PM#13
YellowSubmarine
The 0 gold cost system is viable; it would just increase the charges each time someone failed to buy it.

It's not a major system that I need, to be honest, but it would be nice. The idea was that a hero might find a charm in the game which would help him when he needed it, so that if he tried to buy something he couldn't afford, the charm would burst into just enough gold to get it.

I mean, I could use that system, but it would be sloppy. Any other suggestions?
12-01-2004, 08:44 PM#14
Ryude
Remove all the conditions and Make a game message show saying "This event works!".

Then just try all the different events you can think of.

Edit: BTW, whenever they attempt to sell an item, it's an ability.

A unit starts the effect of an ability

Ability being cast Equal to Shop Sharing (I think that's the ability)
12-02-2004, 12:38 AM#15
YellowSubmarine
I saw your post, and tried the event with every ability from "Sell Items" to "Shop Sharing" to "Sell Item to Unit" and the game did not seem to recognize any of them. :(