• 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.
  • The Hive's 22nd Icon Contest: Creep Abilities is now concluded, time to vote for your favourite set of icons! Click here to vote!
  • ✅ The POLL for Hive's Texturing Contest #34 is OPEN! Vote for the TOP 3 SKINS! 🔗Click here to cast your vote!
  • ✅ The POLL for Hive's Techtree Contest #20 is OPEN! Vote for the TOP 3 FACTIONS! 🔗Click here to cast your vote!

Trigger

Status
Not open for further replies.
The best way i know how is to set a local unit variable to the unit that enters the region, this does use a small amount of JASS but i will comment it as much as i can.
  • Untitled Trigger 001
    • Events
      • Unit - A unit enters KillRect <gen>
    • Conditions
    • Actions
      • Custom script: local unit EnteredU = GetTriggerUnit()
      • Wait 10.00 seconds
      • Custom script: if RectContainsUnit(gg_rct_KillRect, GetTriggerUnit()) == true then
      • Custom script: call KillUnit(EnteredU)
      • Custom script: endif
      • Custom script : set EnteredU = null
"local unit EnteredU = GetTriggerUnit()" sets a local variable to the entering unit. It must be a local to avoid any overwriting that may occur if this trigger is rerun.

The line " if RectContainsUnit(gg_rct_KillRect, GetTriggerUnit()) == true then" checks if the unit is still within the "kill rect".

And the final lines do the following ;
> Kill the entering unit.
> Ends the "If" condition
> Clears up any potential leaks.

You must edit the line
JASS:
 if RectContainsUnit(gg_rct_KillRect, GetTriggerUnit()) == true then
for your regoin.

You must change "KillRect" to your killing regoin name [it is case sensative].
EG change it to ;

JASS:
if RectContainsUnit(gg_rct_RectThatKills, GetTriggerUnit()) == true then

I hope ive been helpful, if you have any problems just post and il see what i can do.
 
Ok, sorry i couldn't be any help to you.


##edit##
I think there is in fact an easy GUI way, simply because i was being over cautious with the unit being overwritten. However this bug may well be evident as i have not checked over on this trigger.

  • Events
    • Unit - A unit enters Region 000 <gen>
  • Conditions
  • Actions
    • Wait 10.00 seconds
    • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
      • If - Conditions
        • (Region 000 <gen> contains (Entering unit)) Equal to True
      • Then - Actions
        • Unit - Kill (Entering unit)
      • Else - Actions
 
Last edited by a moderator:
Status
Not open for further replies.
Back
Top