1. Updated Resource Submission Rules: All model & skin resource submissions must now include an in-game screenshot. This is to help speed up the moderation process and to show how the model and/or texture looks like from the in-game camera.
    Dismiss Notice
  2. DID YOU KNOW - That you can unlock new rank icons by posting on the forums or winning contests? Click here to customize your rank or read our User Rank Policy to see a list of ranks that you can unlock. Have you won a contest and still havn't received your rank award? Then please contact the administration.
    Dismiss Notice
  3. Travel to distant realms and encounter scenes unknown to the common folk. The Greatest of Adventures is upon us with the 8th Cinematic Contest. Join in on a fun ride.
    Dismiss Notice
  4. The 18th Icon Contest is ON! Choose any ingame unit and give him/her Hero abilities. Good luck to all.
    Dismiss Notice
  5. The Secrets of Warcraft 3 have revealed interesting works. The RESULTS for Abelhawk's Mini-Mapping Contest #15 have come out!
    Dismiss Notice
  6. Contestants are to create a scene set in the Stone Age. Come and see what you can come up with. We wish you the best of luck!
    Dismiss Notice
  7. Colour outside the lines! Techtree Contest #13 is a go. The contest is optionally paired.
    Dismiss Notice
  8. Night Rider gained several songs for his journey. The poll for the 12th Music Contest has started. Check it out!
    Dismiss Notice
  9. Greetings cerebrates, our Swarm needs new spawners that will have numerous children. Join the HIVE's 31st Modeling Contest - Spawners and Spawned! The contest is optionally paired.
    Dismiss Notice
  10. 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.

Farm/Hunt System

Discussion in 'Requests' started by UmbraUnda, May 30, 2017.

  1. UmbraUnda

    UmbraUnda

    Joined:
    Mar 31, 2016
    Messages:
    605
    Resources:
    1
    Maps:
    1
    Resources:
    1
    I need help writing triggers for a hunting system and a farming system.

    I'm using @ZiBitheWand3r3r 's Harvest Resource System for harvestable resources. It works for lumber as well as custom resources harvested from destructibles.

    Food (gold) is harvested from plants\crops (berry bush, wheat, corn, etc), corpses of animals, and fish (just like in Age of Empires. Crops, corpses and fish are all destructibles and everything except fish and certain plants are spawned via triggers. After an animal finishes death animation and begins decay animation, the unit should turn into a certain sized destructible corpse (bigger animals have bigger corpses and more meat). Crops are the tricky part although I've seen it done before in Dark Deeds and Medieval Villagers. Make a 'Plow Farmland' ability to turn grass terrain into farm terrain (should not work on mountain terrain) + seed items will be used exclusively on farm terrain to spawn crops. Crops grow in stages - first a baby crop, then matures into a full sized crop after a minute. Another feature should also be that mature crops reproduce each minute spawning baby crops nearby only if there is free space (so if there is already a farm full of crops, they wont reproduce because its already crowded).

    Appreciate any help and advice. Also if anybody can rip trigger(s) off Dark Deeds/Medieval Villagers, I can re-implement them to my map - that could get the job done.
     
    Last edited: Jul 28, 2017
  2. UmbraUnda

    UmbraUnda

    Joined:
    Mar 31, 2016
    Messages:
    605
    Resources:
    1
    Maps:
    1
    Resources:
    1
    Here's what I came up with for hunting - however its not working...

    • Corpse Alpha
      • Events
        • Unit - A unit Dies
      • Conditions
        • (Unit-type of (Triggering unit)) Equal to Misha (Level 4)
        • (Unit-type of (Triggering unit)) Equal to Spirit Bear (Level 3)
      • Actions
        • Destructible - Create a Corpse - Alpha at (Position of (Triggering unit)) facing (Random angle) with scale 0.45 and variation 1
     
  3. disruptive_

    disruptive_

    Joined:
    Mar 19, 2017
    Messages:
    149
    Resources:
    0
    Resources:
    0
    Many years ago i made a "harvest from corpse" system, it followed the same concept you are using (using destructibles). Sadly i don't have that system with me (which was written in vJass, but was very simple nonetheless), so i'm just recalling what i did.

    I remember that i had to import a modified model for each carcass, aswell as tracking the death of a huntable animal with a trigger (just like your trigger), removing the dying unit as it "dies", and creating the destructible in that position (the "carcass", also facing the same angle as the unit).
    If i remember correctly, the carcass model was basically the model of the respective animal with just a birth, stand and death animation (a basic model edit).
    The birth animation of such model would be the DEATH animation of the animal, the stand animation would be the carcass itself lying (you can make some cosmetic adjustments, like flies or whatever), and the death animation a standart Wc3 decay animation.
    If you select the correct options, the destructible (the carcass) could also be selectable and have no pathing.

    The trick was that the dying unit should not play its death animation (removing it instantly), and in its place the destructable would play it instead (that's why it should have a birth animation playing the death animation of the animal, i still don't remember if this was the case tho, in which case there is a trigger that allows you to play animations from a destructible directly, resolving this disjunctive).


    I'm not native english speaker, so i apologize for any incommunication.
     
  4. UmbraUnda

    UmbraUnda

    Joined:
    Mar 31, 2016
    Messages:
    605
    Resources:
    1
    Maps:
    1
    Resources:
    1
    Interesting - looks like I may have to add a few more lines to my hunting trigger. Nice, good points mate. I'll take your advice and hopefully I can get it working.
     
  5. UmbraUnda

    UmbraUnda

    Joined:
    Mar 31, 2016
    Messages:
    605
    Resources:
    1
    Maps:
    1
    Resources:
    1
  6. Gumberbunbder

    Gumberbunbder

    Joined:
    Sep 25, 2013
    Messages:
    228
    Resources:
    1
    Maps:
    1
    Resources:
    1
    my map is a bit simpler than what you seem to want to create, but it involves fishing, farming, and hunting. You can take a look and tell me if it might be suitable for you. I am looking for someone to help me make some lords of europe type terrain, I'm absolutely burned out of making terrain and I am stuck.

    EDIT: also, this version of my map is slighty jacked up because its missing a tech building, but it doesn't affect the resource system at all
     

    Attached Files:

  7. UmbraUnda

    UmbraUnda

    Joined:
    Mar 31, 2016
    Messages:
    605
    Resources:
    1
    Maps:
    1
    Resources:
    1
    Interesting map mate. I like some of the systems you have going on but I need to figure out how to adjust them for my map. Gonna tinker with this for a few days and see what I can get done. Also nice market trading triggers too - I can use those as well.
    Terrain is tough - I need to get better myself... GL mate, thanks much appreciated.
     
  8. UmbraUnda

    UmbraUnda

    Joined:
    Mar 31, 2016
    Messages:
    605
    Resources:
    1
    Maps:
    1
    Resources:
    1
    @Gumberbunbder Unfortunately, your systems are too different from what I'm looking for. Nice map btw, digging the music. Thanks for posting that. Perhaps somebody else can alter it a bit to suit my needs later on. I'd do it myself, however its beyond my skillset though...

    also bump - still need help with this!
     
  9. ZiBitheWand3r3r

    ZiBitheWand3r3r

    Joined:
    Nov 21, 2012
    Messages:
    896
    Resources:
    15
    Maps:
    7
    Spells:
    8
    Resources:
    15
    look and tell me if this is what you want, its not well optimized but whould work fine
     

    Attached Files:

  10. UmbraUnda

    UmbraUnda

    Joined:
    Mar 31, 2016
    Messages:
    605
    Resources:
    1
    Maps:
    1
    Resources:
    1
    My goodness - that was fast!! You are next level ZiBi. Gonna test it out now.
     
  11. UmbraUnda

    UmbraUnda

    Joined:
    Mar 31, 2016
    Messages:
    605
    Resources:
    1
    Maps:
    1
    Resources:
    1
    Wow, I'm impressed. This is nearly perfect - exactly what I wanted. Just one problem though - Plow Farmland ability is a little buggy in consistently turning terrain into farmland. Most of the time, it does nothing - unless I'm missing something?

    Also, does this system support multiple types of seeds and crops? And different sizes of meat depending on the animal?
     
  12. ZiBitheWand3r3r

    ZiBitheWand3r3r

    Joined:
    Nov 21, 2012
    Messages:
    896
    Resources:
    15
    Maps:
    7
    Spells:
    8
    Resources:
    15
    meat is trivial:
    • meat
      • Events
        • Unit - A unit Decays
      • Conditions
      • Actions
        • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
          • If - Conditions
            • (Unit-type of (Decaying unit)) Equal to Chicken
          • Then - Actions
            • Destructible - Create a Meat at (Position of (Decaying unit)) facing 0.00 with scale 0.40 and variation 0
          • Else - Actions
            • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
              • If - Conditions
                • (Unit-type of (Decaying unit)) Equal to Stag
              • Then - Actions
                • Destructible - Create a BigMeat at (Position of (Decaying unit)) facing 0.00 with scale 0.40 and variation 0
              • Else - Actions
        • Game - Display to (All players) the text: (decay: + (Name of (Decaying unit)))


    targeted area is divided to 9 128-size squares (its "size 2, shape: square" in terrain palette)
    it checks for terrain type 'Lgrs' Lordaeron summer-grass. Feel free to change it (or add more conditions if you want to convert to farmland more then 1 terrain-type)

    not at its current state, but it can be easily modified to do that. Does all seeds/crops should follow the same pattern (baby/small/big + separate seed-item + spread)?
     
  13. UmbraUnda

    UmbraUnda

    Joined:
    Mar 31, 2016
    Messages:
    605
    Resources:
    1
    Maps:
    1
    Resources:
    1
    Awesome mate. You are the best!

    Good - yes, all seeds and crops should follow the same growth pattern + spread.
     
  14. UmbraUnda

    UmbraUnda

    Joined:
    Mar 31, 2016
    Messages:
    605
    Resources:
    1
    Maps:
    1
    Resources:
    1
    One issue - after wheat is harvested completely and dies, the model remains (although not select-able).
    Not sure if this is related to the destructible lacking a proper animation or the trigger.
     
  15. ZiBitheWand3r3r

    ZiBitheWand3r3r

    Joined:
    Nov 21, 2012
    Messages:
    896
    Resources:
    15
    Maps:
    7
    Spells:
    8
    Resources:
    15
    default wheat war3 model has no death animation, edit this model and/or import something new.

    I decided to bind this new library with Custom Reource, as this new lib uses the same hashtable. Make your settings with caution ;)
     

    Attached Files:

  16. UmbraUnda

    UmbraUnda

    Joined:
    Mar 31, 2016
    Messages:
    605
    Resources:
    1
    Maps:
    1
    Resources:
    1
    Alright - thanks again mate. Really appreciate it! :D
     
  17. UmbraUnda

    UmbraUnda

    Joined:
    Mar 31, 2016
    Messages:
    605
    Resources:
    1
    Maps:
    1
    Resources:
    1
    Question: How do I make the crops spread closer together? I tried changing the offset value and it spread closer however the spread was uneven - a few spread crops were missing in the upper right corner - another value wouldn't spread toward the bottom.
     
  18. ZiBitheWand3r3r

    ZiBitheWand3r3r

    Joined:
    Nov 21, 2012
    Messages:
    896
    Resources:
    15
    Maps:
    7
    Spells:
    8
    Resources:
    15
    try diffrent values in new added
    CROPS_DENSITY
    variable (it was hard coded 164.00 in previous version)
     

    Attached Files:

  19. UmbraUnda

    UmbraUnda

    Joined:
    Mar 31, 2016
    Messages:
    605
    Resources:
    1
    Maps:
    1
    Resources:
    1
    Awesome
     
  20. UmbraUnda

    UmbraUnda

    Joined:
    Mar 31, 2016
    Messages:
    605
    Resources:
    1
    Maps:
    1
    Resources:
    1
    @ZiBitheWand3r3r

    Hey - I tried setting CROP_DENSITY to lower and lower amounts however it had no effect. Am I missing another variable to edit?

    Also, how exactly do I add more terrain types that are plow-able?
    Do i just edit like this?

    globals
    //configurable
    private constant integer TERRAIN_TYPE_GRASS = 'Lgrs' or 'Adrt' or 'Adrg' or 'Agrd'
    private constant integer TERRAIN_TYPE_CROPS = 'Vcrp' //VILLAGE-crops, it is a terrain where seeds can be used
    private constant integer ABI_PLOW_FARMLAND = 'A05J' //ability to change TERRAIN_TYPE_GRASS --> TERRAIN_TYPE_CROPS
     
    Last edited: Aug 3, 2017