• Check out the results of the Techtree Contest #19!
  • 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.
  • Create a void inspired texture for Warcraft 3 and enter Hive's 34th Texturing Contest: Void! Click here to enter!
  • The Hive's 22nd Icon Contest: Creep Abilities is now concluded, time to vote for your favourite set of icons! Click here to vote!

Trigger for blight detection

Status
Not open for further replies.
Level 4
Joined
Jun 30, 2008
Messages
92
Hello guys.

I'm creating a map where zombies are invading a normally peaceful area. I want blight to be a spawn zone for zombies, and I want there to be more zombies if there is more blight. My idea is to spawn a dummy every 2 seconds at a random point, then have the trigger check to see if that point contains blight. If it does, it'll create a zombie at that point, if it doesn't it won't do anything. Either way, the dummy would then be removed from the game.

I could probably do this without the dummy (just realized), but what I need help with is detecting the blight.

If anyone knows how to do this, please explain.

(If some one could tell me exactly how I can paste my trigger here, (as I've seen other people do), I'll show what I currently have.
 
Last edited:
In the trigger editor. Use copy as text on the trigger. In here, when you post. Use
[trig.ger]
Paste your trigger here.
[/trig.ger]
Just romove the dots from the trigger [ ]
 
  • Zombie Spawn
    • Events
      • Time - Every 5.00 seconds of game time
    • Conditions
    • Actions
      • Set Zombiespawn = (Random point in (Playable map area))
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
        • Then - Actions
          • Unit - Create 1 Zombie for Player 12 (Brown) at Zombcreate facing (Random angle) degrees
          • Custom script: call RemoveLocation(udg_Zombiespawn)
        • Else - Actions
          • Custom script: call RemoveLocation(udg_Zombiespawn)
 
I don't know if there is a way to do this in GUI, but the Jass is IsPointBlighted(x,y)

Therefore, for your if-then, you would have:

  • XXX
    • Actions
      • Custom script: if IsPointBlighted(GetRectCenterX(bj_mapInitialPlayableArea),GetRectCenterX(bj_mapInitialPlayableArea)) then
      • -------- your Then actions here --------
      • -------- Skip to endif if you don't need Else actions --------
      • Custom script: else
      • -------- your Else actions here --------
      • Custom script: endif
PS to Jassers: Yes, GetRectCenterX/Y are BJs, but the native way would be too unintelligible for an example, and heck, it's GUI.
 
Thank you PurplePoot, if possible, could you give me a custom script I can drop into my conditions. I hope to learn Jass at some point, but right now I don't trust myself with it.
 
You can't possibly put Custom Script in your conditions in GUI.

You could just wrap your entire Actions block in that if-then though.

In all honesty, though, it's ideal if you don't know much GUI to convert to Jass now if you feel you ever will want to. Using GUI brings a lot of bad habits you end up having to unlearn.
 
Ok here it is, basically, blight is a dummy who has 1 hp and -1000 hp regen only while on blight.

The trigger checks if the unit is still alive after .25 seconds, if it is, then it removes the unit and does nothing

  • Zombie Kill
    • Events
    • Conditions
    • Actions
      • Unit - Create 1 blight for Player 12 (Brown) at somewhere facing Default building facing degrees
      • Wait 0.25 seconds
      • Set blightlife = (Number of units in (Units owned by Player 12 (Brown) of type blight))
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • blightlife Equal to 1
        • Then - Actions
          • Do your stuff
        • Else - Actions
          • Unit - Remove (Last created unit) from the game
      • Custom script: call RemoveLocation(udg_"Your location")
I think this should work.
 
  • Zombie
    • Events
      • Time - Every 1.00 seconds of game time
    • Conditions
    • Actions
      • Set Blight = (Terrain type at (Center of (Playable map area)))
      • Set TempLoc = (Random point in (Playable map area))
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Terrain type at TempLoc) Equal to Blight
        • Then - Actions
          • Unit - Create 1 Zombie for Player 1 (Red) at TempLoc facing (Random angle) degrees
          • Animation - Play (Last created unit)'s birth animation
        • Else - Actions
This leaks. Make sure the middle point of the map is blight or create a zone in the corner with blight and assign a variable there.
 
I can't find a way to with editing...

Hopefully a mod will come by and fix it :(



EDIT: btw, Huurka's idea works perfectly. I made a small section in the corner of the map sealed off (boundary and sight blockers) I stuck a chunk of blighted land there and dropped a region there to reference. 3 of my 6 zombie's triggers are now active thanks to you. +Rep like wow.
 
Last edited:
Status
Not open for further replies.
Back
Top