• 🏆 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] Facing Degree Help

Status
Not open for further replies.
Level 4
Joined
Nov 11, 2004
Messages
50
Hi, Im currently working a spell where a unit casts on another unit which summons up a dummy unit to do a shockwave. The problem is I cant get the facing degree right, I want the dummy unit to cast the shockwave where ever the caster is facing. Can anyone help me?
 
Level 7
Joined
Dec 26, 2006
Messages
303
Don't really get it, is this what you want??

E-
A unit cast a skill
C-
Skill casted equal to Dummy Shockwave
A-
Set [Casting Unit] = siA
Set [Targeted Unit of Ability being Cast] = siB
Create 1 Dummy at position of siA using facing of siA
Issue [last created unit] to Shockwave position of siB
Remove [last created unit]

or this one??

E-
A unit cast a skill
C-
Skill casted equal to Dummy Shockwave
A-
Set [Casting Unit] = siA
Set [Targeted Unit of Ability being Cast] = siB
Create 1 Dummy at position of siB using facing of siA
Issue [last created unit] to Shockwave position of siB offset by 200 from facing of siA
Remove [last created unit]


which mean casted to range of 200 from your hero facing
 
I could be wrong here, but if you use triggering unit and stuff like that and no variables you WONT get leaks?

And cool your ability will make the targeted unit shockwave the casting unit.
Do this instead
E-Unit begins the effect of an ability (begins casting can be maninupalted if you know how)
C-Ability Being cast equal to Shockwave [dummy]
A-
Unit - Create 1 Dummy Caster for (owner of casting unit) at postion of (casting unit
Unit - Add Shockwave [dmg] to (last created unit)
Unit - Order (last created unit) to do (Tauren Chieftan - Shockwave [could be dread lord - carrion swarm though]) to (postition of targeted unit)
Unit - Add a 1 second generic expiration timer to (last created unit)
 
Level 7
Joined
Dec 26, 2006
Messages
303
Say it multiple times to you Purple, I just beginner in WE and don't know anything about programming.. I just always test any trigger that I want to so I have some intelligent about it but terribly sorry I still can't fix leaks...

I recommended myself to begin fixing, learn GUI than learn JASS but I can't... My body too lazy for it
 
Level 40
Joined
Dec 14, 2005
Messages
10,532
Here we go, leak fixing isn't all that hard.

Instead of just using a trigger such as

  • Don't Fix Leaks
    • Events
      • Unit - A Unit Dies
    • Conditions
    • Actions
      • Unit - Create 1 Footman for (Owner of (Triggering Unit)) at (Position of (Triggering Unit)) Facing 0.00 degrees
do the following (where loc is a global Point variable)

  • Fix Leaks
    • Events
      • Unit - A Unit Dies
    • Conditions
    • Actions
      • Set loc = (Position of (Triggering Unit))
      • Unit - Create 1 Footman for (Owner of (Triggering Unit)) at loc Facing 0.00 degrees
      • Custom script: call RemoveLocation( udg_loc )
 
Last edited by a moderator:
Level 7
Joined
Dec 26, 2006
Messages
303
Here we go, leak fixing isn't all that hard.

Instead of just using a trigger such as

  • Don't Fix Leaks
  • Events
  • Unit - A Unit Dies
  • Conditions
  • Actions
  • Unit - Create 1 Footman for (Owner of (Triggering Unit)) at (Position of (Triggering Unit)) Facing 0.00 degrees
do the following (where loc is a global Point variable)

  • Fix Leaks
  • Events
  • Unit - A Unit Dies
  • Conditions
  • Actions
  • Set loc = (Position of (Triggering Unit))
  • Unit - Create 1 Footman for (Owner of (Triggering Unit)) at loc Facing 0.00 degrees
  • Custom script: call RemoveLocation( udg_loc )

Purple I do the thing you write down if that's the mean of fixing leaks but I didn't write the >>
Custom script: call RemoveLocation( udg_loc )

What does it use to be??
 
Level 7
Joined
Dec 26, 2006
Messages
303
so all I must do from now is make an Custom Script trigger and write call RemoveLocation( udg_loc )??

If I only forgot these at all my trigger than I can fix all leaks from now on
 
Level 8
Joined
Mar 23, 2007
Messages
302
Here we go, leak fixing isn't all that hard.

Instead of just using a trigger such as

  • Don't Fix Leaks
  • Events
  • Unit - A Unit Dies
  • Conditions
  • Actions
  • Unit - Create 1 Footman for (Owner of (Triggering Unit)) at (Position of (Triggering Unit)) Facing 0.00 degrees
do the following (where loc is a global Point variable)

  • Fix Leaks
  • Events
  • Unit - A Unit Dies
  • Conditions
  • Actions
  • Set loc = (Position of (Triggering Unit))
  • Unit - Create 1 Footman for (Owner of (Triggering Unit)) at loc Facing 0.00 degrees
  • Custom script: call RemoveLocation( udg_loc )

PurplePoot can you explain me this? i dont get it why a shorter function that
doesnt use variables nor a costomscript cause more leaks than a 3 line function that needs a
variable and a script?
 
Level 40
Joined
Dec 14, 2005
Messages
10,532
When a Point (location) is created in Warcraft III, it allocates memory space for it. (among with many other types)

Whenever you need to access that Point, it searches for it, then returns what you need.

However, it will remember that point forever unless you manually delete it, thus sucking up CPU speed.

Eventually, these Points build up and cause lag.

RemoveLocation essentially tells wc3 to free up that point's memory from the memory space, so it can be used for other things, and not uselessly suck up CPU speed.
 
Level 8
Joined
Mar 23, 2007
Messages
302
so to fix this, no matter of unit , player groups etc just remove or destroy it
to prevent leak...
btw if i add life time to a unit does the unit will be removed or still "stay in
memory"...
 
Status
Not open for further replies.
Top