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 The Helper:
    I think I need to split the Sci/Tech news forum into 2 one for Science and one for Tech but I am hating all the moving of posts I would have to do
  • The Helper The Helper:
    What is up Old Mountain Shadow?
  • The Helper The Helper:
    Happy Thursday!
    +1
  • Varine Varine:
    Crazy how much 3d printing has come in the last few years. Sad that it's not as easily modifiable though
  • Varine Varine:
    I bought an Ender 3 during the pandemic and tinkered with it all the time. Just bought a Sovol, not as easy. I'm trying to make it use a different nozzle because I have a fuck ton of Volcanos, and they use what is basically a modified volcano that is just a smidge longer, and almost every part on this thing needs to be redone to make it work
  • Varine Varine:
    Luckily I have a 3d printer for that, I guess. But it's ridiculous. The regular volcanos are 21mm, these Sovol versions are about 23.5mm
  • Varine Varine:
    So, 2.5mm longer. But the thing that measures the bed is about 1.5mm above the nozzle, so if I swap it with a volcano then I'm 1mm behind it. So cool, new bracket to swap that, but THEN the fan shroud to direct air at the part is ALSO going to be .5mm to low, and so I need to redo that, but by doing that it is a little bit off where it should be blowing and it's throwing it at the heating block instead of the part, and fuck man
  • Varine Varine:
    I didn't realize they designed this entire thing to NOT be modded. I would have just got a fucking Bambu if I knew that, the whole point was I could fuck with this. And no one else makes shit for Sovol so I have to go through them, and they have... interesting pricing models. So I have a new extruder altogether that I'm taking apart and going to just design a whole new one to use my nozzles. Dumb design.
  • Varine Varine:
    Can't just buy a new heatblock, you need to get a whole hotend - so block, heater cartridge, thermistor, heatbreak, and nozzle. And they put this fucking paste in there so I can't take the thermistor or cartridge out with any ease, that's 30 dollars. Or you can get the whole extrudor with the direct driver AND that heatblock for like 50, but you still can't get any of it to come apart
  • Varine Varine:
    Partsbuilt has individual parts I found but they're expensive. I think I can get bits swapped around and make this work with generic shit though
  • Ghan Ghan:
    Heard Houston got hit pretty bad by storms last night. Hope all is well with TH.
  • The Helper The Helper:
    Power back on finally - all is good here no damage
    +2
  • V-SNES V-SNES:
    Happy Friday!
    +1
  • The Helper The Helper:
    New recipe is another summer dessert Berry and Peach Cheesecake - https://www.thehelper.net/threads/recipe-berry-and-peach-cheesecake.194169/
  • The Helper The Helper:
    I think we need to add something to the bottom of the front page that shows the Headline News forum that has a link to go to the News Forum Index so people can see there is more news. Do you guys see what I am saying, lets say you read all the articles on the front page and you get to the end and it just ends, no kind of link for MOAR!
  • The Helper The Helper:
    Happy Wednesday!
    +1
  • V-SNES V-SNES:
    Happy Friday!
    +1
  • The Helper The Helper:
    Sticking with the desserts for now the latest recipe is Fried Apple Pies - https://www.thehelper.net/threads/recipe-fried-apple-pies.194297/
  • The Helper The Helper:
    Finally finding about some of the bots that are flooding the users online - bytespider apparently is a huge offender here - ignores robots.txt and comes in from a ton of different IPs

      The Helper Discord

      Staff online

      Members online

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials

      Network Sponsors

      Apex Steel Pipe - Buys and sells Steel Pipe.
      Top