• 🏆 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!
  • It's time for the first HD Modeling Contest of 2024. Join the theme discussion for Hive's HD Modeling Contest #6! Click here to post your idea!

"Must Target a Tree" {skill based off Slow can't target trees}

Status
Not open for further replies.
Level 12
Joined
Mar 10, 2008
Messages
869
Hi,

I made a skill based off "Slow" and turned it into "Gather some Wood". This skill is trigger-based. The triggers aren't the problem. I have selected allowed targets as the same on Harvest (Gold and Lumber). Tree, Alive, Dead. Whenever I click a tree, or ANYTHING, it says: Must Target a Tree

How can I make it properly be only allowed to target a tree?

Thanks in advanced.
 
Level 15
Joined
Aug 11, 2009
Messages
1,606
Hi,

I made a skill based off "Slow" and turned it into "Gather some Wood". This skill is trigger-based. The triggers aren't the problem. I have selected allowed targets as the same on Harvest (Gold and Lumber). Tree, Alive, Dead. Whenever I click a tree, or ANYTHING, it says: Must Target a Tree

How can I make it properly be only allowed to target a tree?

Thanks in advanced.

You probably based your trigger on something wrong,could you also post your code?
 
Level 7
Joined
Jun 16, 2008
Messages
327
In my opinion, Thunder_Eye has just got the answer you need. Slow is a spell that was specifically made as a unit-orientated ability, not for trees (Using channel as a template won't work either, interestingly.) If desired, just make a trigger to almost "adjust" the ability to the effects you want it to have.
 
Level 12
Joined
Mar 10, 2008
Messages
869
Yea... I used eat trees before, but it doesn't work with my triggers. Eat trees pauses the unit until the target tree is destroyed. When someone harvests a log successfully, the tree loses -10 hp, like so:
  • Basic WoodChopping
    • Events
      • Unit - A unit Begins casting an ability
    • Conditions
      • (Ability being cast) Equal to Gather Some Wood
    • Actions
      • Set ActionPlayer = (Player number of (Owner of (Triggering unit)))
      • Set ActionUnit[ActionPlayer] = (Triggering unit)
      • Set ActionDestructable[ActionPlayer] = (Target destructible of ability being cast)
      • Unit - Pause ActionUnit[ActionPlayer]
      • Wait 0.30 seconds
      • Animation - Play ActionUnit[ActionPlayer]'s Attack animation
      • Wait 0.05 seconds
      • Animation - Play ActionDestructable[ActionPlayer]'s stand hit animation
      • Wait 1.05 seconds
      • Animation - Play ActionUnit[ActionPlayer]'s Attack animation
      • Wait 0.05 seconds
      • Animation - Play ActionDestructable[ActionPlayer]'s stand hit animation
      • Wait 1.05 seconds
      • Animation - Play ActionUnit[ActionPlayer]'s Attack animation
      • Wait 0.05 seconds
      • Animation - Play ActionDestructable[ActionPlayer]'s stand hit animation
      • Wait 1.05 seconds
      • Animation - Play ActionUnit[ActionPlayer]'s Attack animation
      • Wait 0.05 seconds
      • Animation - Play ActionDestructable[ActionPlayer]'s stand hit animation
      • Wait 0.30 seconds
      • Set Chances = ((Real(WoodChoppingLVL[(Player number of (Owner of (Triggering unit)))])) / 2.00)
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Destructible-type of ActionDestructable[ActionPlayer]) Equal to Village Tree Wall
        • Then - Actions
          • Set TreeLVL = 1
        • Else - Actions
      • Set FinalChance = (Random real number between 0.00 and (Real(TreeLVL)))
      • Unit - Unpause ActionUnit[ActionPlayer]
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • FinalChance Less than or equal to Chances
        • Then - Actions
          • Custom script: call DisplayTextToPlayer((GetOwningPlayer(GetTriggerUnit())), 0, 0, "You have successfully harvested a log!")
          • Destructible - Set life of ActionDestructable[ActionPlayer] to ((Current life of ActionDestructable[ActionPlayer]) - 10.00)
        • Else - Actions
          • Custom script: call DisplayTextToPlayer((GetOwningPlayer(GetTriggerUnit())), 0, 0, "You have failed to harvest a log.")
It keeps looping until the tree is dead - because of "Eat Tree" wanting the tree to die before the unit is unpaused.
 
Status
Not open for further replies.
Top