Peasants stealing gold

Dodighead147

New Member
Reaction score
0
Hi... Well someone was very nice to help me with this post beofe (rep+) but there is ONE problem with it. This code gives +50 gold when you kill the peasant but I want it to give back the 1/5 of your gold that it takes (in the item). Can you please help me? This is the code:
Code:
Trigger 1
    Events
        Unit - A unit Dies
    Conditions
        (Unit-type of (Triggering unit)) Equal to Jew
    Actions
        Item - Create Gold Coins at (Position of (Triggering unit))
        Item - Set the custom value of (Last created item) to (Custom value of (Triggering unit))
Code:
Trigger 2
    Events
        Unit - A unit Acquires an item
    Conditions
        (Custom value of (Item being manipulated)) Greater than 0
    Actions
        Player - Add (Custom value of (Item being manipulated)) to (Owner of (Hero manipulating item)) Current gold
        Floating Text - Create floating text that reads (String((Custom value of (Item being manipulated)))) at (Position of (Hero manipulating item)) with Z offset 0.00, using font size 10.00, color (100.00%, 100.00%, 0.00%), and 0.00% transparency
        Floating Text - Change (Last created floating text): Disable permanence
        Floating Text - Set the velocity of (Last created floating text) to 64.00 towards 90.00 degrees
        Floating Text - Change the fading age of (Last created floating text) to 4.00 seconds
        Floating Text - Change the lifespan of (Last created floating text) to 5.00 seconds
 
You are creating an item, which probably holds the value of the gold that will be added to the owner of the unit that picks it up. So you'll have to change the value in the Object Editor.
If not, you could add an action to the second trigger which removes X gold from Owner of (Triggering Unit). -That will probably look weird, when playing the game, though.

Your first trigger has a point-leak, and "Jew" probably isn't the best name for a Unit-Type.
 
Hmm... try this trigger

Events
Unit - A unit Dies
Conditions
(Unit-type of (Dying Unit)) Equal to Jew
Actions
Hero - Create Gold Coins and give it to (Triggering Unit)
Item - Set the custom value of (Last created item) to (Custom value of (Triggering unit))

But if you want the gold coins to give +50 gold go to items and edit the gold to +50
 
Hmm... try this trigger

Events
Unit - A unit Dies
Conditions
(Unit-type of (Dying Unit)) Equal to Jew
Actions
Hero - Create Gold Coins and give it to (Triggering Unit)
Item - Set the custom value of (Last created item) to (Custom value of (Triggering unit))

But if you want the gold coins to give +50 gold go to items and edit the gold to +50

You should use CODE-Tags around your trigger codes.

Item - Set the custom value of
Probably won't work, since the item (most likely) will disappear, when a unit acquires it.
 
Do you think this will work?: what if i go back to the original code that doesnt drop and item, and just make it say in text that i got the gold? Should i just do that? Will it look as good?
 
Do you think this will work?: what if i go back to the original code that doesnt drop and item, and just make it say in text that i got the gold? Should i just do that? Will it look as good?

Without the item is better - then no one can come steal the gold from your kill.
 
General chit-chat
Help Users
  • No one is chatting at the moment.
  • The Helper The Helper:
    https://www.thehelper.net/pages/news/ is a link to the old news portal - i will integrate it into the interface somewhere when i figure it out
  • Ghan Ghan:
    Need to try something
  • Ghan Ghan:
    Hopefully this won't cause problems.
  • Ghan Ghan:
    Hmm
  • Ghan Ghan:
    I have converted the Headline News forum to an Article type forum. It will now show the top 20 threads with more detail of each thread.
  • Ghan Ghan:
    See how we like that.
  • The Helper The Helper:
    I do not see a way to go past the 1st page of posts on the forum though
  • The Helper The Helper:
    It is OK though for the main page to open up on the forum in the view it was before. As long as the portal has its own URL so it can be viewed that way I do want to try it as a regular forum view for a while
  • Ghan Ghan:
    Yeah I'm not sure what the deal is with the pagination.
  • Ghan Ghan:
    It SHOULD be there so I think it might just be an artifact of having an older style.
  • Ghan Ghan:
    I switched it to a "Standard" article forum. This will show the thread list like normal, but the threads themselves will have the first post set up above the rest of the "comments"
  • The Helper The Helper:
    I don't really get that article forum but I think it is because I have never really seen it used on a multi post thread
  • Ghan Ghan:
    RpNation makes more use of it right now as an example: https://www.rpnation.com/news/
  • The Helper The Helper:
  • The Helper The Helper:
    What do you think Tom?
  • tom_mai78101 tom_mai78101:
    I will have to get used to this.
  • tom_mai78101 tom_mai78101:
    The latest news feed looks good
  • The Helper The Helper:
    I would like to see it again like Ghan had it the first time with pagination though - without the pagination that view will not work but with pagination it just might...
  • The Helper The Helper:
    This drink recipe I have had more than a few times back in the day! Mind Eraser https://www.thehelper.net/threads/cocktail-mind-eraser.194720/
  • The Helper The Helper:
    Happy Thursday!
  • Ghan Ghan:
    I'm not so sure, there's still a lot of Thursday left for it to become unhappy.
    +3
  • The Helper The Helper:
    still a few hours
  • The Helper The Helper:
    Its Friday!!!!
    +1
  • Ghan Ghan:
    Thursday 7/10 would Thursday again
    +3

      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