• 🏆 Texturing Contest #33 is OPEN! Contestants must re-texture a SD unit model found in-game (Warcraft 3 Classic), recreating the unit into a peaceful NPC version. 🔗Click here to enter!
  • 🏆 Hive's 6th HD Modeling Contest: Mechanical is now open! Design and model a mechanical creature, mechanized animal, a futuristic robotic being, or anything else your imagination can tinker with! 📅 Submissions close on June 30, 2024. Don't miss this opportunity to let your creativity shine! Enter now and show us your mechanical masterpiece! 🔗 Click here to enter!

Custom lumber gatherer

Status
Not open for further replies.
Level 6
Joined
Feb 6, 2008
Messages
166
Trying to squeeze in some map progress on my altered melee before I move back into the dorms. I'm stumped though - I want to make a unit that transforms to gather passively.

Okay, so I'm making a treant. I'm giving it a self-morphing ability (like Bear Form, Stone Form, Destroyer Form, etc.) that turns itself into an immobile treant with the same model. I'm hoping that the immobile version will be able to sit there with a 5 second cooldown autocast ability that, when cast, grants the player X lumber equal to the number of trees within a set range of the casting treant. It's also gotta be MUI for sure, because when a player has 20 or so workers gathering lumber on autocast and there might be several players playing the race, it could easily reach 50-100 treants autocasting the spell.

Somewhere in this mess, I've gotta probably use Floating Text to display the amount of lumber being harvested by each treant above their respective heads just like a wisp does.

Edit: Bah, forgot to point out what my question was.
Any idea what base skill I should use, or what method I would use to go about making this ability? Will using an autocast heal or target self suffice?

Edit 2: I think I've got it solved - I'll edit this post with anything I've thought of, as well as the solution so that anyone else who wants to use this idea has something to guide them.
 
Last edited:
Level 5
Joined
Jan 15, 2009
Messages
80
Hurmm, isn't there a healing ability that you would be able to use, and then for the trigger make a event for when the ability is used and then what you could do though is make it so that when the ability is casted you change units, change it to a identical unit that can't move, you could possible make it invulnerable? Idk.. But anyways after you change the unit you wait 5 seconds and then do the rest, i would give you a example of the full trigger that i would do but i don't have every event/condition/action memorized perfectly and i don't have warcraft 3 atm... but.. damn.. If i get warcraft back anytime soon i'll reply again for the rest, i have actually done this in the map i'm making already except you pick up the item and then there is a text that moves up like when you get gold. Good Luck.. :)

EDIT: Lol, i didn't read you're second edit sorry :p..
 
Level 6
Joined
Feb 6, 2008
Messages
166
@ D4RK_G4ND4LF: The problem with using this method, is that lumber would only come in once every 5-10 seconds. In melee style gameplay, consistently deploying your treants right after the income triggers would set you behind other "luckier" players about 1 income (5-10 lumber) per treant. Now, I'm not skilled at melee games, but assuming you use 20 workers to gather lumber - that sets you back about 150 lumber behind other players. Not really fair, is it? (Especially since 10 lumber difference early game could indirectly delay your production of treant workers, further widening the distance between the players' lumber supply.)

Also, this thread was semi-abandoned. I gave up on trying to solve the whole worker at one time, and figured I'd try and solve the autocast skill first, which I made this thread for:
World Editor Help Zone - Autocast target

So, this thread has lost most of its value. Considering I don't have a solution, still, even my Edit 2 serves no point. The answer to this problem would more likely show up in the other thread I made than this one.

Looking back, I probably should've been more careful in the making of threads so that I wouldn't need to abandon this one so quickly for a new one, but hey, that's a learning process too.
 
Level 19
Joined
Feb 4, 2009
Messages
1,313
@ D4RK_G4ND4LF: The problem with using this method, is that lumber would only come in once every 5-10 seconds. In melee style gameplay, consistently deploying your treants right after the income triggers would set you behind other "luckier" players about 1 income (5-10 lumber) per treant. Now, I'm not skilled at melee games, but assuming you use 20 workers to gather lumber - that sets you back about 150 lumber behind other players. Not really fair, is it? (Especially since 10 lumber difference early game could indirectly delay your production of treant workers, further widening the distance between the players' lumber supply.)

Also, this thread was semi-abandoned. I gave up on trying to solve the whole worker at one time, and figured I'd try and solve the autocast skill first, which I made this thread for:
World Editor Help Zone - Autocast target

So, this thread has lost most of its value. Considering I don't have a solution, still, even my Edit 2 serves no point. The answer to this problem would more likely show up in the other thread I made than this one.

Looking back, I probably should've been more careful in the making of threads so that I wouldn't need to abandon this one so quickly for a new one, but hey, that's a learning process too.

editeditedit*deletingeverythingiwrotebefore*

this works (quite late already so it might bug or things could happen I did not think of but whatever...)
  • Harvest
    • Events
      • Unit - A unit Finishes casting an ability
    • Conditions
      • (Ability being cast) Equal to Harvest
    • Actions
      • Custom script: local real x = GetUnitX(GetTriggerUnit())
      • Custom script: local real y = GetUnitY(GetTriggerUnit())
      • -------- This wait is perfectly fine because "triggering unit" is local and won't be overwritten --------
      • Wait 0.01 game-time seconds
      • -------- Check if unit moved --------
      • Custom script: if x != GetUnitX(GetTriggerUnit()) or y != GetUnitY(GetTriggerUnit()) then
      • -------- If unit moved stop harvesting --------
      • Skip remaining actions
      • Custom script: endif
      • -------- Order triggering unit to harvest --------
      • -------- Change "channel" to something else if you change order id of spell --------
      • Custom script: call IssueImmediateOrder(GetTriggerUnit(), "channel")
      • -------- Make treant play attack animation --------
      • Animation - Play (Triggering unit)'s attack animation
      • -------- Reset tree counter --------
      • Set i = 0
      • Set loc = (Position of (Triggering unit))
      • -------- Create dummy if not done already --------
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • harvester Equal to No unit
        • Then - Actions
          • Unit - Create 1 Peasant for Neutral Passive at loc facing 0.00 degrees
          • Set harvester = (Last created unit)
          • Unit - Hide harvester
          • Unit - Make harvester Invulnerable
        • Else - Actions
      • Destructible - Pick every destructible within 500.00 of loc and do (Actions)
        • Loop - Actions
          • -------- Check if tree is dead --------
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Current life of (Picked destructible)) Greater than 0.00
            • Then - Actions
              • -------- Order dummy to harvest --------
              • Unit - Order harvester to Harvest (Picked destructible)
              • -------- If dummy is able to harvest the target is a tree --------
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • (Current order of harvester) Equal to (Order(harvest))
                • Then - Actions
                  • -------- Count tree --------
                  • Set i = (i + 1)
                  • -------- Make trees tremble --------
                  • Animation - Play (Picked destructible)'s stand hit animation
                • Else - Actions
              • Unit - Order harvester to Stop
            • Else - Actions
      • -------- 10 wood per tree --------
      • Set i = (i x 10)
      • -------- Increase lumber --------
      • Player - Add i to (Owner of (Triggering unit)) Current gold
      • -------- Remove leak --------
      • Custom script: call RemoveLocation(udg_loc)
      • -------- And finally some green text --------
      • Floating Text - Create floating text that reads (String(i)) above (Triggering unit) with Z offset 0.00, using font size 10.00, color (0.00%, 100.00%, 0.00%), and 20.00% transparency
      • -------- Make text go up --------
      • Floating Text - Set the velocity of (Last created floating text) to 60.00 towards 90.00 degrees
      • -------- Make text able to die --------
      • Floating Text - Change (Last created floating text): Disable permanence
      • -------- Make text die after 3 sec --------
      • Floating Text - Change the lifespan of (Last created floating text) to 3.00 seconds
      • -------- Make text fade --------
      • Floating Text - Change the fading age of (Last created floating text) to 2.00 seconds
 

Attachments

  • Harvest.w3x
    15.8 KB · Views: 44
Last edited:
Status
Not open for further replies.
Top