• 🏆 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!

[Trigger] Passive Skills Enhanced by Triggers

Status
Not open for further replies.
Level 3
Joined
Jun 25, 2006
Messages
32
How do you make a passive skill with triggers which, for example Shadow Strike attackers of the Hero with the said passive skill?
 
Level 40
Joined
Dec 14, 2005
Messages
10,532
Well, this was is a little flawed, but it's easy to do for a GUIer, so here you go

(Note: if someone spams Attack-Stop, it will still go off)

You need a variable called TempPoint, of type Point, an ability called Shadow Strike Antiorb, which is your passive, an ability called Shadow Strike Dummy, which is your actual Shadow Strike, and a unit called Dummy, which has the ability Locust, no model, no shadow, 1 movement, move type flying, no attack, and no minimap display.

  • Shadow Strike Antiorb
    • Events
      • A Unit Is Attacked
    • Conditions
      • (Level of Shadow Strike Antiorb for (Triggering Unit)) Greater than 0
    • Actions
      • Set TempPoint = (Position of (Triggering Unit))
      • Unit - Create 1 Dummy for (Owner of (Triggering Unit)) at TempPoint facing 0 degrees
      • Unit - Add Shadow Strike Dummy to (Last Created Unit)
      • Unit - Order (Last Created Unit) to Night Elf Warden - Shadow Strike (Attacking Unit)
      • Unit - Add a 1.00 second Generic Expiration Timer to (Last Created Unit)
      • Custom script: call RemoveLocation( udg_TempPoint )
 

Dr Super Good

Spell Reviewer
Level 64
Joined
Jan 18, 2005
Messages
27,217
LOL, dude you dont need the TempPoint variable or the custom Scrift just use position of triggering unit in the create.
Please be constructive, trying to ruin peoples triggers is not nice, purple had all the reason to use that cause he KNOWS triggers unlike you and thus is caring about leaks. YES you do need that point, not using it will result in your map leaking and slowing down if played for a long time. All triggers should be leak free, GUI or jass. So please stop denying leaks exist, since they do
 
Level 40
Joined
Dec 14, 2005
Messages
10,532
you guys don't have to defend me :p

Anyways, yeah, Kraken --

Whenever you create a Location (or a billion other things, but lets stick with locations), Warcraft III allocates memory space for it. If you don't store it in a variable, you'll have no references to it + that allocated memory stays forever. IF you store it in a variable, that allocated memory still stays forever. However, if you run RemoveLocation every time you're done with a location dumped into that variable, it frees the allocated memory space, thus saving processor speed and preventing lag buildup.

Some other things that will hog allocated memory space (and that can be accessed in GUI)
-Unit Groups (aka 'group', destroy them with DestroyGroup) Note: placing "set bj_wantDestroyGroup = true" in front of a Pick Every Unit In (Group) has the same effect.
-Player Groups (aka 'force', destroy them with DestroyForce) Note: (All Players) does not leak, and destroying it can cause problems.
-Special Effects (aka 'effect', destroy them with DestroyEffect, or Destroy (someEffect) in GUI) Note: when an effect is destroyed, it plays the death animation. Thus, if you only want the death animation, just run Create Some Effect, then instantly afterwards run Destroy (Last Created Special Effect)
-Triggers (aka 'trigger', destroy them with DestroyTrigger) Note: Triggers leak on so many levels that it's a better idea not even to touch them with GUI.
-Units (dummies, for example) (aka 'unit', destroy them with KillUnit (Kill (Unit) in GUI), RemoveUnit (Remove (Unit) in GUI), KillUnit + SetUnitExploded, UnitApplyTimedLife (Add Expiration Timer to (Unit) in GUI), ExplodeUnitBJ (Explode (Unit) in GUI), or UnitApplyTimedLife + SetUnitExploded)
-Weather Effects (aka 'weathereffect', I think the destroy function is DestroyWeatherEffect, but I can't remember)
-Etc (I don't have the WE open right now)

Note: Location is synonymous with 'Point' in GUI
 
Level 7
Joined
Dec 26, 2006
Messages
303
I agreed with Kraken, I also use triggers from the first time I begin editing (5 months ago) and found no leaks ( even there's one no 1 will know if it there if they play a game not seek for bug)

@PurplePoot, Mini_Me and Dr Super Good
Three of you has been say to me if there's a lot of leak if we not use tempPoint variable, GUI or anything else... But I think it's not that big leaks, people will not find it only we that make maps will fell it.. Really..
 
Level 40
Joined
Dec 14, 2005
Messages
10,532
  • Leaks Proof
  • Events
  • Every .01 Seconds of Game Time
  • Conditions
  • Actions
  • Custom Script: call Location( 0, 0 )
Try it. Let it run for 5 minutes. Check how many gazillions of memory you've eaten up (the difference in the memory usage of wc3 from the start to the end)

(by the way, call Location( 0, 0 ) will create a new Point ('location') at the center of the map (sort've like using Position of Unit, but at the center of the map instead of at a unit's position))

Also, you know the black screen of death, and when some games build up insane delay/lag? That's also leaks.

And also, here's an example. Get on an older computer, and play a game like Escape Maker (that old maze maker game). The lag builds up quickly, and after about 3-4 seconds you're getting really choppy gameplay, up to even freezing.

Just because newer computers last longer to leaks, having more RAM and all, doesn't mean they aren't there and doesn't mean they're not a problem.
 

Dr Super Good

Spell Reviewer
Level 64
Joined
Jan 18, 2005
Messages
27,217
Purple, RAM is NOT the problem, 100000s of leaks take up only a few MB (1-2). The problem with leaks is it increases the CPU demand to preform actions that create/use a handle. So with a lot of leaks even issueing the order to make a location can cause a 8 second delay on a fast comp. Also if WC3 runs out of handle numbers the game CRASHES, which is not very good. . .
 
Status
Not open for further replies.
Top