Item Refund on purchase problem

Glorn2

Slap n' Tickle
Reaction score
4
Code:
Items From Shop
    Events
        Unit - A unit Sells an item (from shop)
    Conditions
    Actions
        Set Item_Value = (Integer((Current life of (Sold Item))))
        If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            If - Conditions
                (Level of Player_Hero[(Player number of (Owner of (Buying unit)))]) Less than (Item level of (Sold Item))
            Then - Actions
                Player - Add Item_Value to (Owner of (Buying unit)) Current gold
                Game - Display to (Player group((Owner of (Buying unit)))) the text: (You must be level  + (Colors_Players[1] + (((String((Item level of (Sold Item)))) + Colors_Endtag) + ( or higher to use this  + (Name of (Sold Item))))))
                Hero - Drop (Sold Item) from (Buying unit)
                Item - Remove (Sold Item)
            Else - Actions

So, I made that up; and it isnt working. Well, everything is working except for the refund part. It will tell me all of the correct text, and it will drop the item and remove it from the game.

What it doesnt do though; is provide me with the gold. This seems to be exactly what all of the 400 posts on this topic suggest that I do. Either this or using units or item level (Which I cant use, because it decided if my hero is a high enough level to buy the item).

I am using an item that is used on pick up. Based on a tome; that way I can buy the item with a full inventory. Either way; I have the gold cost and life of the item set to the same values.

Is it impossible to do it this way? >< Am I gonna have to switch to using units to make my recipes?
 

tommerbob

Minecraft. :D
Reaction score
110
Display a debug message displaying what value Item_Value is. I'm guessing that's your problem.
 

canons200

New Member
Reaction score
50
I believe the Item_Value is an variable. Thus you have to set the value of variable. Or use Hit Point of the item.
 

HydraRancher

Truth begins in lies
Reaction score
197
I believe the Item_Value is an variable. Thus you have to set the value of variable. Or use Hit Point of the item.

Have you even read the trigger?


Most likely an item has no HP when it is sold. Use a debug message like tommerbob suggested.

I suggest you use item level instead for values. Hold shift + double click to go over level 8.
 

Glorn2

Slap n' Tickle
Reaction score
4
I switched to using the "unit recipe" way of doing this. I use the life of the item to determine how much gold would be refunded, and the level of the item to determine if my hero met the requirements for use.

I bug checked, and it was the definitely the HP of the item that couldnt be found. Most likely because it was a tome-type item; that is, a use on pick up item. I'm not sure; but the unit-system seem to work fine and is only a minor inconvienience. When something about lemons happens; squeeze them!
 
General chit-chat
Help Users
  • No one is chatting at the moment.

      The Helper Discord

      Members online

      No members online now.

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials

      Network Sponsors

      Apex Steel Pipe - Buys and sells Steel Pipe.
      Top