Increasing unit size

Status
Not open for further replies.
Level 4
Joined
Jul 25, 2007
Messages
71
Hello there. I have a map where a unit is supposed to water a flower. The flower is a unit. It's at 50% health. When the flower is watered, it changes to 100%. But I was also wondering if there was a way to simulate the flower "growing". Like.. Changing its scaling size over 3 seconds.



Oh and it's kindof off-topic. But I ran into another issue. I want a hero only be able to hold 1 of a certain item. So if hero has 1 "Skull fragment", when he picks up another one, it automatically drops it. Here's my trigger so far..

  • onlyOneLurkerSkull
    • Events
      • Unit - A unit Acquires an item
    • Conditions
      • (Item-type of (Item being manipulated)) Equal to |cffEEE8AAFragment of the Lurker's skull|r
    • Actions
      • For each (Integer A) from 1 to 6, do (Actions)
        • Loop - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Owner of (Hero manipulating item)) Equal to (Player((Integer A)))
              • ((Hero manipulating item) has an item of type |cffEEE8AAFragment of the Lurker's skull|r) Equal to False
            • Then - Actions
              • Do nothing
            • Else - Actions
              • Hero - Drop (Item being manipulated) from (Hero manipulating item)
              • Game - Display to (Player group((Player((Integer A))))) the text: |cff696969You may o...
And that's not working. Each time I pick up a skull, it automatically drops it. And there is no check for "If hero has 2 of item type". I have no idea how to do this. Any ideas? :eek:
 
Last edited:
Level 11
Joined
Jun 30, 2008
Messages
580
  • Melee Initialization
    • Events
      • Map initialization
    • Conditions
    • Actions
      • Animation - Change No unit's size to (110.00%, 110.00%, 110.00%) of its original size
      • Wait 0.10 seconds
      • Animation - Change No unit's size to (120.00%, 120.00%, 120.00%) of its original size
      • Wait 0.10 seconds
      • -------- etc... --------
      • -------- Up to 3 seconds, and increase by 10% for a smooth looking growth. --------
Go to Actions
Go to Animation
And Use Change Unit's Size
 
Level 4
Joined
Jul 25, 2007
Messages
71
Ok awesome. That worked perfectly. Thanks a million. But now for my second question.. Any idea?
 
Level 8
Joined
Jun 26, 2010
Messages
530
Dude, why the
  • (Owner of (Hero manipulating item)) Equal to (Player((Integer A)))
on the conditions? Take your time studying the logic of your trigger. You will see the problem.

Use this:

  • Events
    • Unit - a uni aquires an action
  • Conditions
  • Actions
    • For each integer A from 1 to 6 do multiple actions
      • if - conditions
        • Item-type of item on (hero manipulating item) slot [loop integer A] equal to Item-type of (item being manipulated)
      • then - actions
        • Item - drop item being manipulated
      • else - actions
 
Level 4
Joined
Jul 25, 2007
Messages
71
Yeah. Yours works, as well as mine. But.. The trigger runs AFTER the unit has picked up the item. Which means even if the unit didn't have the item before he picked it up, the trigger still sees he has the item, so he's forced to drop it.
 
Status
Not open for further replies.
Top