• 🏆 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!
  • It's time for the first HD Modeling Contest of 2024. Join the theme discussion for Hive's HD Modeling Contest #6! Click here to post your idea!

Need more help for Trigger Enhanced Spells

Status
Not open for further replies.
Level 3
Joined
Jul 2, 2006
Messages
35
Lesser Holy Light
  • Events
    • Unit - A unit Starts the effect of an ability
  • Conditions
    • (Ability being cast) Equal to Lesser Holy Light
  • Actions
    • Unit - Add a 1.50 second Generic expiration timer to (Last created unit)
    • Unit - Create 1 Dummy Unit for (Owner of (Triggering unit)) at (Position of (Triggering unit)) facing 0.00 degrees
    • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
      • If - Conditions
        • ((Target unit of ability being cast) is Undead) Equal to False
      • Then - Actions
        • Unit - Add Heal (Lesser Holy Light) to (Last created unit)
        • Unit - Order (Last created unit) to Human Priest - Heal (Target unit of ability being cast)
      • Else - Actions
    • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
      • If - Conditions
        • ((Target unit of ability being cast) is Undead) Equal to True
      • Then - Actions
        • Unit - Cause (Last created unit) to damage (Target unit of ability being cast), dealing 50.00 damage of attack type Spells and damage type Normal
      • Else - Actions
The problem I have is: Unit - order (last created unit) to human Priest - Heal (Target unit of ability being cast)

Why can't I find my own spell in the list of presets, also I'm running out of presets!
 
Last edited:
Level 24
Joined
Jun 26, 2006
Messages
3,406
To turn it into a trigger, put [trigger] at the front of it and [/trigger] at the end of it. Example: [trigger]Events
Conditions
Actions[/trigger] becomes
  • Events
  • Conditions
  • Actions

There's a problem in the ordering of your trigger. You add the 1.50 second expiration timer to "last created unit" before you create the unit that you actually want to add the timer to. Also, I think that will leak.

If you order it to use the heal that the priest has, it should go ahead and use its custom heal (if the custom heal is based off of the priest's heal).
 
Level 3
Joined
Jul 2, 2006
Messages
35
Can you tell me what a memory leak is? Everyone constantly mentions it, but no one explains it!

Thanks for pointing out the create unit part
 
Level 4
Joined
Apr 2, 2006
Messages
32
>Can you tell me what a memory leak is?

A mem. leak is a piece of information that is stored into your comp's RAM.
The more you get, the more lag you'll get.

They are caused when part of an action is not referenced properly.

Mem. leaks commonly include:
-Points
-Floating Text
-Special Effects
-Unit Groups
-Player Groups
-Units

...with Points being the biggest threat of them all.

In your case, "(Position of (Triggering unit))" leaks, as it is referencing a point the wrong way;
Store it into a Point variable, reference the unit's point via that variable and then remove it after use.

For ex:
  • Set TempPoint = (Position of (Triggering unit))
  • Unit - Create 1 Dummy Unit for (Owner of (Triggering unit)) at TempPoint facing 0.00 degrees
  • ...
  • Custom script: call RemoveLocation(udg_TempPoint)
 
Level 6
Joined
Aug 24, 2007
Messages
173
there should be a selection in the drop-down menu at the top for "custom"
It should be in there, unless you just modified a normal spell.
 
Level 3
Joined
Jul 2, 2006
Messages
35
  • Set TempPoint = (Position of (Triggering unit))
    • Unit - Create 1 Dummy Unit for (Owner of (Triggering unit)) at TempPoint facing 0.00 degrees
    • ...
    • Custom script: call RemoveLocation(udg_TempPoint)
I don't do jass!

  • Events
  • Unit - A unit Starts the effect of an ability
  • Conditions
  • (Ability being cast) Equal to Lesser Holy Light
  • Actions
  • Unit - Add a 1.50 second Generic expiration timer to (Last created unit)
  • Unit - Create 1 Dummy Unit for (Owner of (Triggering unit)) at (Position of (Triggering unit)) facing 0.00 degrees
  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
  • If - Conditions
  • ((Target unit of ability being cast) is Undead) Equal to False
  • Then - Actions
  • Unit - Add Heal (Lesser Holy Light) to (Last created unit)
  • Unit - Order (Last created unit) to Human Priest - Heal (Target unit of ability being cast)
  • Else - Actions
  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
  • If - Conditions
  • ((Target unit of ability being cast) is Undead) Equal to True
  • Then - Actions
  • Unit - Cause (Last created unit) to damage (Target unit of ability being cast), dealing 50.00 damage of attack type Spells and damage type Normal
  • Else - Actions
Also that doesn't seem to work, I tried casting it on a footman whom i damaged, but he didn't get healed. I tried casting it on a ghoul and it didnt take the damage either!!!
 
Level 24
Joined
Jun 26, 2006
Messages
3,406
The custom script isn't JASS. There is physically an action to call a custom script, all you have to do is type in that custom script correctly (possibly case-sensitive).
 
Level 6
Joined
Mar 2, 2006
Messages
306
Also that doesn't seem to work
for this spell, you don't need the dummy unit. just check if the target is undead; if it is, have caster damage it; if it isn't, just set target's hp to its_previous_hp+X or its_previous_hp*1.xx...
I don't do jass!
you don't have to do full-jass triggers. but single lines of jass are necessary to clean up leaks (custom script action is located below the comment action). ever played a map that gradually started to lag a bit as the game got longer and longer? ever noticed that on game over, some maps let you return to chatroom/menus instantly, while some take half a minute to unload?
(possibly case-sensitive)
yep
 
Status
Not open for further replies.
Top