• 🏆 Texturing Contest #33 is OPEN! Contestants must re-texture a SD unit model found in-game (Warcraft 3 Classic), recreating the unit into a peaceful NPC version. 🔗Click here to enter!
  • 🏆 Hive's 6th HD Modeling Contest: Mechanical is now open! Design and model a mechanical creature, mechanized animal, a futuristic robotic being, or anything else your imagination can tinker with! 📅 Submissions close on June 30, 2024. Don't miss this opportunity to let your creativity shine! Enter now and show us your mechanical masterpiece! 🔗 Click here to enter!

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