Can't use unit variable in "Within Range" event :S ?

kasilopana

New Member
Reaction score
1
Well hello there!

I got a problem!

Code:
Die Potato!
    Events
        Unit - A unit comes within 50.00 of Peasant 0000 <gen>
    Conditions
    Actions
        Unit - Kill PlayerUnit

Code:
start camera
    Events
        Map initialization
    Conditions
    Actions
        Unit Group - Pick every unit in (Units of type Peasant) and do (Set PlayerUnit = (Picked unit))
        Camera - Pan camera for Player 1 (Red) to (Position of PlayerUnit) over 0.00 seconds

How come I can't use any unit variable in the "within range" event? :O

When my peasant dies, I am creating him again 1 second after. Problem is he was initially set to "Peasant 0000", but when he dies the Peasant 0000 is removed, and I can't set it to the variable "PlayerUnit" instead of "Peasant 0000"

Its damn hard to explain :p - If you don't get it, tell me and I will explain furthermore :p

BTW a horde of footmen approaches and your goal is to avoid them and stay alive as long as possible. You got 10 lives in total. When the peasant dies the first time, I can't get him to die again, because of this :S

Excuse my english :D
Code:
 

njb013

New Member
Reaction score
0
The only thing I could think of is that instead of him actually dying, create the death animation (explode, maybe?), and then make him a ghost for 1 second. Then, before removing ghost, move him back to where he started and put his health back up to 100%. I'm no master at this, but an idea is an idea.
 

kasilopana

New Member
Reaction score
1
The only thing I could think of is that instead of him actually dying, create the death animation (explode, maybe?), and then make him a ghost for 1 second. Then, before removing ghost, move him back to where he started and put his health back up to 100%. I'm no master at this, but an idea is an idea.

I'll try that :D I'll get back to you in a sec!
 

Accname

2D-Graphics enthusiast
Reaction score
1,464
Events are constant in wc3, you cannot use variables in events ever.

What you can do however is periodically checking units around the peasant or even better, add permanent immolation as an ability to the peasant and make it deal incredibly much damage.
 

KaerfNomekop

Swim, fishies. Swim through the veil of steel.
Reaction score
613
There's always the Trigger - Add New Event action.
Trigger:
  • Trigger - Add to Die Potato! &lt;gen&gt; the event (Unit - A unit comes within 50.00 of PlayerUnit)

Though you might need to do this with every replacement.
 
General chit-chat
Help Users
  • No one is chatting at the moment.

      The Helper Discord

      Staff online

      Members online

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials

      Network Sponsors

      Apex Steel Pipe - Buys and sells Steel Pipe.
      Top