Gold isnt give, trigger

1346610

New Member
Reaction score
6
Hey guys i am back and i have a question for you :D

Why in this trigger the gold doesnt work? Everything works properly here but the add gold only doesnt,this trigger allows the hero to not to carry more than 1 item of same item.

Trigger:
  • Item Carry
    • Events
      • Unit - A unit Acquires an item
    • Conditions
    • Actions
      • Set Integer = 0
        • Do Multiple ActionsFor each (Integer A) from 1 to 6, do (Actions)
          • Loop - Actions
            • Multiple FunctionsIf (All Conditions are True) then do (Then Actions) else do (Else Actions)
              • If - Conditions
                • (Item-type of (Item carried by (Triggering unit) in slot (Integer A))) Equal to (==) (Item-type of (Item being manipulated))
              • Then - Actions
                • Set Integer = (Integer + 1)
              • Else - Actions
        • Multiple FunctionsIf (All Conditions are True) then do (Then Actions) else do (Else Actions)
          • If - Conditions
            • Integer Greater than or equal to (>=) 2
          • Then - Actions
            • Hero - Drop (Item being manipulated) from (Triggering unit)
            • Player - Add (Custom value of (Last dropped item)) to (Owner of (Triggering unit)) Current gold
            • Item - Remove (Last dropped item)
            • Game - Display to (All players) for 3.00 seconds the text: You can't buy this ...
          • Else - Actions


Also i tried with item being manipulated but still nothing, i dont get the gold back of the item price :(

Player - Add (Custom value of (Last dropped item)) to (Owner of (Triggering unit)) Current gold
 

Ryushi

"I will stand, or I will fall. I will not sit."
Reaction score
59
The custom value of the item wouldn't be equal to the gold cost of the item unless you are manually setting it to it. If you aren't then you could try setting the item level of every item to its gold cost, and then increasing the gold of the player by the item level of the item.
 

1346610

New Member
Reaction score
6
So i just have to set the value of the item? The trigger works properly?

PS:D But problem is i dont know where to set the value of the item xD

Edit: Ah so i set them with triggers into another trigger,right?Example of the trigger?

Because i can only do this

Trigger:
  • Item - Set the custom value of (Item carried by (Hero manipulating item) of type Tome of Experience) to 1222
 

vypur85

Hibernate
Reaction score
803
There is no way to get the price of items/units/heroes via trigger. You just can't track them readily.

A crude workaround is to remove the item upon purchase.
Create a dummy with inventory at a position of a shop, create the same item for the dummy unit, then order the unit to sell the item to the shop. The dummy unit can have no model and Locust to prevent detection. (Doing this way will give you 50% return of the item, you'd probably have to sell it twice...)

Edit: You might wanna turn off and on the said trigger to prevent crash.
 

1346610

New Member
Reaction score
6
There is no way to get the price of items/units/heroes via trigger. You just can't track them readily.

A crude workaround is to remove the item upon purchase.
Create a dummy with inventory at a position of a shop, create the same item for the dummy unit, then order the unit to sell the item to the shop. The dummy unit can have no model and Locust to prevent detection. (Doing this way will give you 50% return of the item, you'd probably have to sell it twice...)

Edit: You might wanna turn off and on the said trigger to prevent crash.

But if i can order a dummy unit to sell the item why cant i do the same way with the hero? maybe instead of dropping the item and removing it i might order the unit to sell it...Also from the item i can change the value of the sell value i guess.

But how do i ord the unit to sell item?
 

vypur85

Hibernate
Reaction score
803
Something like this:
Code:
Untitled Trigger 001
    Events
        Unit - A unit Acquires an item
    Conditions
    Actions
        Trigger - Turn off (This trigger)
        For each (Integer A) from 1 to 2, do (Actions)
            Loop - Actions
                Unit - Create 1 Footman for (Owner of (Triggering unit)) at (Position of Goblin Merchant 0003 <gen>) facing Default building facing degrees
                Hero - Create (Item-type of (Item being manipulated)) and give it to (Last created unit)
                Unit - Order (Last created unit) to give (Last created item) to Goblin Merchant 0003 <gen>
                Unit - Add a 1.00 second Generic expiration timer to (Last created unit)
        Item - Remove (Item being manipulated)
        Trigger - Turn on (This trigger)

> why cant i do the same way with the hero?
Probably because you'd have to loop twice. Otherwise the item will be sold at 50% price. But you can always try it yourself to see if it works.

> how do i ord the unit to sell item?
Just order the unit to give the item to the shop.
 

merlinds

Member
Reaction score
15
I haved the same issue. somebody tell me the solution!.
In the object editor, you can set the "life of the item". If you set the life of every item to the gold cost of it. Then in the trigger you can use the value of the life of the item to give it as gold to the player. It works like a charm!

Trigger:
Item Carry
Events
Unit - A unit Acquires an item
Conditions
Actions
Set Integer = 0
Do Multiple ActionsFor each (Integer A) from 1 to 6, do (Actions)
Loop - Actions
Multiple FunctionsIf (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
(Item-type of (Item carried by (Triggering unit) in slot (Integer A))) Equal to (==) (Item-type of (Item being manipulated))
Then - Actions
Set Integer = (Integer + 1)
Else - Actions
Multiple FunctionsIf (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
Integer Greater than or equal to (>=) 2
Then - Actions
Hero - Drop (Item being manipulated) from (Triggering unit)
Player - Add ((Integer((Current life of (Item being manipulate))) to (Owner of (Triggering unit)) Current gold
Item - Remove (Last dropped item)
Game - Display to (All players) for 3.00 seconds the text: You can't buy this ...
Else - Actions
 

1346610

New Member
Reaction score
6
I haved the same issue. somebody tell me the solution!.
In the object editor, you can set the "life of the item". If you set the life of every item to the gold cost of it. Then in the trigger you can use the value of the life of the item to give it as gold to the player. It works like a charm!

Trigger:
Item Carry
Events
Unit - A unit Acquires an item
Conditions
Actions
Set Integer = 0
Do Multiple ActionsFor each (Integer A) from 1 to 6, do (Actions)
Loop - Actions
Multiple FunctionsIf (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
(Item-type of (Item carried by (Triggering unit) in slot (Integer A))) Equal to (==) (Item-type of (Item being manipulated))
Then - Actions
Set Integer = (Integer + 1)
Else - Actions
Multiple FunctionsIf (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
Integer Greater than or equal to (>=) 2
Then - Actions
Hero - Drop (Item being manipulated) from (Triggering unit)
Player - Add ((Integer((Current life of (Item being manipulate))) to (Owner of (Triggering unit)) Current gold
Item - Remove (Last dropped item)
Game - Display to (All players) for 3.00 seconds the text: You can't buy this ...
Else - Actions

HeHe yes i know it, i gave you this solution ;)
 
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