share gold

Po0gles

New Member
Reaction score
0
hi in my map i want the heroes to share their money , means if you kill a unit , lets say it gives 80 gold . there are 4 heroes and i want everyone to get 20 . how do i do that ?
 
Something like this should work:
Trigger:
  • Shared gold
    • Events
    • Unit - A unit Dies
    • Conditions
    • (Owner of (Triggering unit)) Equal to Neutral Hostile
    • Actions
    • Set Point = (Position of (Dying unit))
    • Set ugTemp = (Units within 1000.00 of Point matching (((Owner of (Matching unit)) is an enemy of (Owner of (Dying unit))) Equal to True))
    • Unit Group - Pick every unit in ugTemp and do (Actions)
    • Loop - Actions
    • Player Group - Add (Owner of (Picked unit)) to pgTemp
    • Player Group - Pick every player in pgTemp and do (Actions)
    • Loop - Actions
    • Player - Add ((Level of (Dying unit)) / (Number of players in pgTemp)) to (Picked player) Current gold
    • Custom script: call RemoveLocation(udg_Point)
    • Custom script: call DestroyGroup(udg_ugTemp)
    • Custom script: call DestroyForce(udg_pgTemp)
It's not able to directly reference the bounty of the unit, so you'll have to find something else to control the gold given. In the example I used the unit's level, but you can also use food used by/provided, point value, custom value, or level of ability for unit. Also if you want to only give to players that have heroes in the area you'd need to put that in the unit group picking.

EDIT: Doing some actually maptesting, and it's being finicky. For one, the DestroyForce(udg_pgTemp) is just supposed to clean up leaks but is somehow making it only work once.
 
thanks for the effort , does that mean i mustnt use DestroyForce(udg_pgTemp) ? and can i somehow copy the trigger in my world editor? sorry i am not good at making maps i dont know how you created the udg_temp variable :(
 
EDIT: Doing some actually maptesting, and it's being finicky. For one, the DestroyForce(udg_pgTemp) is just supposed to clean up leaks but is somehow making it only work once.
I have no idea why that happens either. I use a TempUnitGroup global for almost everything but I tried it with a different one once and nope. Please let me know if you find out what's up with that
 
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

      Staff online

      Members online

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials

      Network Sponsors

      Apex Steel Pipe - Buys and sells Steel Pipe.
      Top