1. Head to the 33rd Modeling Contest Poll and drink to your heart's desire.
    Dismiss Notice
  2. Choose your means of doom in the 17th Mini Mapping Contest Poll.
    Dismiss Notice
  3. A slave to two rhythms, the 22nd Terraining Contest is here.
    Dismiss Notice
  4. The heavens smile on the old faithful. The 16th Techtree Contest has begun.
    Dismiss Notice
  5. The die is cast - the 6th Melee Mapping Contest results have been announced. Onward to the Hive Cup!
    Dismiss Notice
  6. The glory of the 20th Icon Contest is yours for the taking!
    Dismiss Notice
  7. Check out the Staff job openings thread.
    Dismiss Notice
Dismiss Notice
60,000 passwords have been reset on July 8, 2019. If you cannot login, read this.

[Solved] Stone Gathering Fix

Discussion in 'Triggers & Scripts' started by UmbraUnda, Feb 20, 2017.

  1. UmbraUnda

    UmbraUnda

    Joined:
    Mar 31, 2016
    Messages:
    658
    Resources:
    1
    Maps:
    1
    Resources:
    1
    So, @Bitchmoon made me this awesome stone gathering trigger using triggers and hashtables. Problem is he's been MIA for a couple months and I've been try to get his help to no avail.

    It's just that I need to modify the trigger so that it's upgrade-able just like how wood harvesting has upgrade-able carry amounts. I also want to link the trigger to the "return resources" ability so that it works for stone as well as wood. Currently, stone can only be returned automatically by reaching max carry limit (10). Maybe it's easier to separate each resource with their own return ___ ability ( just throwing out an idea).

    FYI this is for my project which will eventually use more custom resources, so I will use this trigger as a basis for implementing the additional resources such as ore, clay, gold, etc.

    Appreciate any help - sorry my experience in triggering is severely lacking or I'd have tried to do it myself. Also if you know a better way to implement a bunch of custom resources, send me a tutorial or help me out if you can.

    Appreciate any help.


    Here's some screenshots of the trigger.

    [​IMG]
     
    Last edited: Feb 20, 2017
  2. MyPad

    MyPad

    Spell Reviewer

    Joined:
    May 9, 2014
    Messages:
    1,534
    Resources:
    9
    Models:
    1
    Icons:
    2
    Maps:
    2
    Spells:
    3
    JASS:
    1
    Resources:
    9
    Hello @UmbraUnda. You can post the text using the trigger tags, like this
    [trigger][/trigger]..

    Perhaps we can help you with your script after readability has (been)
    been is optional in this case
    improved.
     
  3. UmbraUnda

    UmbraUnda

    Joined:
    Mar 31, 2016
    Messages:
    658
    Resources:
    1
    Maps:
    1
    Resources:
    1
    What? Why? Huh? Really? Screenshots aren't readable?.... Uh ok..... Sure mate...
     
  4. Assassins-Creed

    Assassins-Creed

    Joined:
    Aug 6, 2009
    Messages:
    663
    Resources:
    1
    Maps:
    1
    Resources:
    1
    • Untitled Trigger 001
      • Events
        • Unit - A unit Finishes research
      • Conditions
        • (Researched tech-type) Equal to Iron Forged Swords
      • Actions
        • Set TempInt = (Player number of (Owner of (Triggering unit)))
        • Set playerStoneHaul[TempInt] = ((Current research level of Iron Forged Swords for (Player(TempInt))) x 5)


    In the CheckRockDropOff trigger change the 10 to playerStoneHaul[(Player number of (Picked player))]
    AnImage.png
     
  5. UmbraUnda

    UmbraUnda

    Joined:
    Mar 31, 2016
    Messages:
    658
    Resources:
    1
    Maps:
    1
    Resources:
    1
    Hey thanks for the help.

    I'm stuck on the 2nd action - I don't know what to choose for (Player(TempInt))) x5)
     
  6. Jampion

    Jampion

    JASS Reviewer

    Joined:
    Mar 25, 2016
    Messages:
    1,287
    Resources:
    0
    Resources:
    0
    Should be:
    arithmetic

    -> player research level of iron forged sword
    -> convert player index to player
    -> TempInt

    *

    5
     
  7. UmbraUnda

    UmbraUnda

    Joined:
    Mar 31, 2016
    Messages:
    658
    Resources:
    1
    Maps:
    1
    Resources:
    1

    I don't see arithmetic... Wait, is that Jass or Triggers?

    Or are you correcting Assassin's trigger?

    Could you post an example trigger or screenshot?
     
  8. Jampion

    Jampion

    JASS Reviewer

    Joined:
    Mar 25, 2016
    Messages:
    1,287
    Resources:
    0
    Resources:
    0
    No, I was just trying to help you with this line.

    It's GUI. Arithmetic is the function to do something like 3*4.
    • Set Integer = (3 x 4)
     
  9. Assassins-Creed

    Assassins-Creed

    Joined:
    Aug 6, 2009
    Messages:
    663
    Resources:
    1
    Maps:
    1
    Resources:
    1
    Arithmetic is all the way at the top, below loading hashtables.
     
  10. UmbraUnda

    UmbraUnda

    Joined:
    Mar 31, 2016
    Messages:
    658
    Resources:
    1
    Maps:
    1
    Resources:
    1
    Ok, found arithmatic - it uses two numbers and a math function. Wait why is it just x5? So do I do variable x5 or 1x5? Btw, I just want to add 5 to the carry amount with the upgrade. The upgrade has 3 tiers too, so it should go from 10 - (upgrade) - 15 (1), 20 (2), 25 (3).

    This probably isn't right but here's my attempt. Once again @Assassins-Creed , I don't know what function you used for the 2nd line in Action to get (Player(TempInt) x 5 )))

    [​IMG]
     
    Last edited: Feb 21, 2017
  11. UmbraUnda

    UmbraUnda

    Joined:
    Mar 31, 2016
    Messages:
    658
    Resources:
    1
    Maps:
    1
    Resources:
    1
    Would it just be easier if I send my map and you guys can quickly and purposefully implement the upgrade portion of the trigger?

    Also I want to link the return resources ability that peasants use to work for stone as well as wood.
     
  12. Assassins-Creed

    Assassins-Creed

    Joined:
    Aug 6, 2009
    Messages:
    663
    Resources:
    1
    Maps:
    1
    Resources:
    1
    Try this.
     

    Attached Files:

  13. UmbraUnda

    UmbraUnda

    Joined:
    Mar 31, 2016
    Messages:
    658
    Resources:
    1
    Maps:
    1
    Resources:
    1

    WOOT! Works perfectly. Thanks so much.

    Now I just have to link the RETURN RESOURCES ability to work for stone harvesting in addition to wood harvesting.

    I'm guessing it should be an edit to CheckRockDropoff. Adding a few lines to force stone drop off when RETURN RESOURCES is used (Or maybe I should make another ability specific to stone) should do the trick or maybe making a new trigger based off of CheckRockDropoff.
     
    Last edited: Feb 21, 2017
  14. UmbraUnda

    UmbraUnda

    Joined:
    Mar 31, 2016
    Messages:
    658
    Resources:
    1
    Maps:
    1
    Resources:
    1
    BUMP!

    I still need to link gather and return resources abilities for stone harvesting.

    Anybody have any suggestions?
     
  15. Jampion

    Jampion

    JASS Reviewer

    Joined:
    Mar 25, 2016
    Messages:
    1,287
    Resources:
    0
    Resources:
    0
    Can you upload the map? It's quite a big system, so making assumptions on how to do it is very hard.
     
  16. UmbraUnda

    UmbraUnda

    Joined:
    Mar 31, 2016
    Messages:
    658
    Resources:
    1
    Maps:
    1
    Resources:
    1
  17. UmbraUnda

    UmbraUnda

    Joined:
    Mar 31, 2016
    Messages:
    658
    Resources:
    1
    Maps:
    1
    Resources:
    1
  18. Jampion

    Jampion

    JASS Reviewer

    Joined:
    Mar 25, 2016
    Messages:
    1,287
    Resources:
    0
    Resources:
    0
    Could you give a short summary on what exactly is working at the moment and what needs to be done? Would speed up my work a lot.
     
  19. UmbraUnda

    UmbraUnda

    Joined:
    Mar 31, 2016
    Messages:
    658
    Resources:
    1
    Maps:
    1
    Resources:
    1
    Oh hey I thought you reached a dead end or something.

    Sure. Thanks for following through!

    Link gather and return resources abilities for stone harvesting so that it works for stone harvesting as well as lumber harvesting.

    There is also a glitch where if a worker harvests stone without a drop-off building the integers go over 10 (worker keeps harvesting past 10) and then that worker is glitched and is unable to drop off even after a drop-off building is built.
     
  20. Jampion

    Jampion

    JASS Reviewer

    Joined:
    Mar 25, 2016
    Messages:
    1,287
    Resources:
    0
    Resources:
    0
    The problem was, that when I tested it, the worker did not stop harvesting stones.
    Maybe that's the reason for it, but shouldn't the main building be a drop-off building?
    I am not sure if this is possible, because return ressources is kind of a special ability. It requires you to have ressources you can return, which you do not have, if you only harvest stones.