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

Unit of type...

Status
Not open for further replies.
Level 12
Joined
Mar 24, 2011
Messages
1,082
In the event part there is only Unit - Specific unit event, Unit - A unit owned by... and Unit - Generic unit event. I need something which triggers when a unit of type dies, or atacks a unit.
I have too much units in my map and I can't have a trigger running every time when a unit dies or atacks (It just makes too much delay) so can you tell me some way of a Unit of type... in the event part (Unit group would work too)
 
Level 19
Joined
Aug 8, 2007
Messages
2,765
that wont lag at all... i dont think you understand how the wc3 engine functions
 
Level 17
Joined
Nov 13, 2006
Messages
1,814
Unit type condition wont do because the trigger runs whenever a unit dies.

I don't get it.
Is this a custom script ?
And what's the 3 for ?

Temp_Unit_3 just a unit variable name, u can use any unit variable and its regular trigger action, but anyway u can use condition without problem, i am sure if somewhere have problem then mainly not coz of this :p
 
Level 17
Joined
Nov 13, 2006
Messages
1,814
if u ask me then its useless to do what u want but u can do something like this
  • Map init
    • Events
      • Map initialization
    • Conditions
    • Actions
      • Set UnitGroupVar = (Units of type Footman)
      • Unit Group - Pick every unit in UnitGroupVar and do (Actions)
        • Loop - Actions
          • Trigger - Add to Respawn trigger <gen> the event (Unit - (Picked unit) Dies)
      • Custom script: call DestroyGroup(udg_UnitGroupVar)
  • Respawn trigger
    • Events
    • Conditions
    • Actions
      • Wait 2.00 seconds
      • Set PointVar = (Position of (Triggering unit))
      • Unit - Create 1 (Unit-type of (Triggering unit)) for (Triggering player) at PointVar facing Default building facing degrees
      • Custom script: call RemoveLocation(udg_PointVar)
      • Trigger - Add to (This trigger) the event (Unit - (Last created unit) Dies)
useless because u lose more speed with useing few gui function instead native, wrong organized triggers, too much animated thing on map or with leaks
 
  • Event
    • Unit - A unit dies
  • Conditions
    • Or - multiple conditions
      • Put here which unit types you want
  • Actions
    • Put actions here
And it won't hardly cause any lag or whatsoever you know...

Plus this is actually more efficient than adding specific events to a trigger since this only has one event... while if you do it via adding specific death events, you will create lots of events which you cannot remove and so will result to event leaks...
 
Status
Not open for further replies.
Top