• Listen to a special audio message from Bill Roper to the Hive Workshop community (Bill is a former Vice President of Blizzard Entertainment, Producer, Designer, Musician, Voice Actor) 🔗Click here to hear his message!
  • Read Evilhog's interview with Gregory Alper, the original composer of the music for WarCraft: Orcs & Humans 🔗Click here to read the full interview.

Immunity to Environment for Creeps

Status
Not open for further replies.
Level 3
Joined
Oct 7, 2009
Messages
28
+++++++++++++++++++
C
H C
+++++++++++++++++++

+ = Walls
H = Player Hero
C = Creep

Now what I have in mind is to have the area between the walls cause constant damage to everything with in that area. What I want is for my creeps to be immune to this damage but still vulnerable to everything else ie. Hero

I've come up with a few ways to do this but I thought I'd ask around for a cleaner more elegant solution.
 
Level 3
Joined
Oct 7, 2009
Messages
28
Let me make sure I got this right

Sorry still a bit of a trigger newbie so I just want to make sure I have this right

Untitled Trigger 001

  • Events
  • Time - Every 2.00 seconds of game time
  • Conditions
    • Actions
This part explains itself


  • Custom script: set bj_wantDestroyGroup = true
Ok why use this?

  • Unit Group - Pick every unit in (Units in (AREA) matching ((Owner of
  • (Matching unit)) Not equal to Neutral Hostile)) and do (Actions)
So this would select all the units in stated AREA who belong to the LISTED PLAYER and that is not a Neutral?

Would I need to create a line for each player in the game that I want affected?

If not how do I have it deal damage only to players 1-11

  • Unit - Set life of (Picked unit) to ((Life of (Picked unit)) - 50.00)
Sets the selected units life to Current HP - 50?
 
Level 3
Joined
Oct 7, 2009
Messages
28
On a side note with a map that is going to be running for 2+ hours most times will the fact that it processes every 2 seconds cause issues. Wouldn't it be better to only activate the script when there is actually a damagable unit in the region?
 

Dr Super Good

Spell Reviewer
Level 64
Joined
Jan 18, 2005
Messages
27,259
On a side note with a map that is going to be running for 2+ hours most times will the fact that it processes every 2 seconds cause issues. Wouldn't it be better to only activate the script when there is actually a damagable unit in the region?
Yes, you should only ever run code when it is needed. Especially with JASS code as it is interpreted very slowly.

So this would select all the units in stated AREA who belong to the LISTED PLAYER and that is not a Neutral?

Would I need to create a line for each player in the game that I want affected?

If not how do I have it deal damage only to players 1-11
You could test if the player is in a force. That force would be made up of only players it is to effect for example but you could set it to any players. A force is called "Player Group" in GUI for some reason. This force could probably be used in other triggers as well for improved efficiency. Making the force in an initialization trigger will sadly require hard coding but that can be simplified if your players are in a range (eg 0 to 11 inclusive) where loops could be used.
 
Level 3
Joined
Oct 7, 2009
Messages
28
Thanks for the help so far

I'll play around with the trigger to see what i can do about selecting only players 1-11.

Derp I'm not following how what I said is different to yours on #4
Current Max
123 / 150

What I said

Unit has 123/150 HP
trigger activates
Unit now has 73/150

You said
Uh... no. It sets the life of the unit to the life of the unit minus a value.

ITs been a bad tiring day I may just be too dull to get it
 
Status
Not open for further replies.
Top