• 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.

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:

x3m

x3m

Level 3
Joined
Apr 11, 2008
Messages
51
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 [ ]
 
Level 4
Joined
Jun 30, 2008
Messages
92
  • 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)
 
Level 40
Joined
Dec 14, 2005
Messages
10,532
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.
 
Level 4
Joined
Jun 30, 2008
Messages
92
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.
 
Level 40
Joined
Dec 14, 2005
Messages
10,532
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.
 
Level 4
Joined
Jun 30, 2008
Messages
92
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.
 
Level 17
Joined
May 6, 2008
Messages
1,598
  • 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.
 
Level 4
Joined
Jun 30, 2008
Messages
92
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.
Top