• 🏆 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!

Terrain unit damage

Status
Not open for further replies.
Level 2
Joined
Apr 1, 2010
Messages
11
I am attempting to make a map, in which undead will sustain damage while standing on non-blighted land, similar to the siege of dalaran's shield. Does anyone know of a way to do this?
 
Level 13
Joined
Feb 18, 2009
Messages
1,381
Well, you could use this
  • Event : Time - Every 0.05 seconds of game time
  • Actions :
  • Pick all units in (Some group in which all undead are) and do actions :
    • Set life of picked unit to life of picked unit - x (default 10?)
 
  • Trigger
  • Events
    • Time - Every 1.00 seconds of game-time
  • Conditions
  • Actions
    • Custom script: set bj_wantDestroyGroup = true
    • Unit Group - Pick every unit in (Units in (Playable Map Area)) and do (Actions)
      • Loop - Actions
        • Set Point = (Position of (Picked unit))
        • If (All conditions are true) then do (Actions) else do (Actions)
          • If - Conditions
            • (Point is blighted) Equal to False //Boolean Comparison (Environment - Point is blighted)
            • ((Picked unit) is Undead) Equal to True //Boolean comparison (Unit - Unit classification)
          • Then - Actions
            • Unit - Set life of (Picked unit) to ((Life of (Picked unit)) - 5.00)
          • Else - Actions
        • Custom script: call RemoveLocation (udg_Point)
 
Level 2
Joined
Apr 1, 2010
Messages
11
Final question, how do I set the "if" condition to tell if the land is blighted? Cannot find any environment option. I have the point variable as type point, is this right?
 
Level 2
Joined
Apr 1, 2010
Messages
11
And am i correct in assuming that the variable is of type "point"?

Sorry for the trouble.
 
I already replied

Yes, point variable.

For the environment part, when you add the action "If/Then/Else" and go to a new condition on the "If" branch, go to Boolean comparison and the rest I desribed above. I don't think Environment was patched after some point. In any way, if you have 1.24d, you have that too. I guess you didn't search well.
 
Level 2
Joined
Apr 1, 2010
Messages
11
Woot, thank you, i got it. The Two environment commands were indeed patched in, forgot i hadn't downloaded it for my new comp.
 
Status
Not open for further replies.
Top