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

[Spell] Berserk ability not working

Status
Not open for further replies.
Level 7
Joined
Jan 11, 2022
Messages
108
I'm trying to make a berserk ability that will also cast Inner Fire on triggering unit but I'm doing something wrong
  • Berserk
    • Events
      • Unit - A unit starts effect of the ability
    • Conditions
      • (Ability being cast) Equal to Berserk
      • ((Owner of (Triggering unit)) is an ally of (Owner of (Target unit of ability being cast))) Equal to True
    • Actions
      • Set Be_Temppoint = (Position of (Triggering unit))
      • Set Be_caster = (Triggering Unit)
      • Unit - Create 1 dummy berserk for (Owner of Be_caster) at Be_Temppoint facing generic building facing degrees
      • Custom script: call RemoveLocation(udg_GN_Point)
      • Unit - Set level of Berserk dummy for (Last created unit) to (Level of Berserk for (Triggering unit))
      • Unit - Order (Last created unit) to Human Inner Fire (Triggering unit)
      • Unit - Add a 2.00 second generic expiration timer to (Last created unit)
"Berserk dummy" is the inner fire ability
 
Last edited by a moderator:

Uncle

Warcraft Moderator
Level 65
Joined
Aug 10, 2018
Messages
6,724
Issues:
  • You're setting Be_caster = (Triggering unit) but you only reference it once when it can be referenced throughout the entire trigger.
  • You're removing the wrong Point in your Custom Script, the Point variable is called Be_Temppoint not GN_Point.
  • I recommend ordering the Dummy unit to cast the spell as it's last Action.
  • If your spell doesn't target a unit then this Condition won't work and isn't even necessary. There is no (Target unit of ability being cast) if the spell doesn't target a unit:
  • ((Owner of (Triggering unit)) is an ally of (Owner of (Target unit of ability being cast))) Equal to True
I've adjusted your trigger to be more efficient by taking full advantage of the variables you were using. This may still not work for the reasons I stated before:
  • Berserk
    • Events
      • Unit - A unit starts effect of the ability
    • Conditions
      • (Ability being cast) Equal to Berserk
      • ((Owner of (Triggering unit)) is an ally of (Owner of (Target unit of ability being cast))) Equal to True
    • Actions
      • Set Be_caster = (Triggering Unit)
      • Set Be_Temppoint = (Position of Be_caster)
      • Unit - Create 1 dummy berserk for (Owner of Be_caster) at Be_Temppoint facing generic building facing degrees
      • Custom script: call RemoveLocation(udg_Be_Temppoint)
      • Unit - Set level of Berserk dummy for (Last created unit) to (Level of Berserk for Be_caster)
      • Unit - Add a 2.00 second generic expiration timer to (Last created unit)
      • Unit - Order (Last created unit) to Human Inner Fire Be_caster
Some other possible issues.
  • The Dummy unit doesn't have the ability.
  • The Dummy unit cannot cast the ability.
  • You're referencing the wrong Berserk ability.
  • I think this is probably the main issue -> The Orc ability Berserk doesn't target a unit if that's what you're using.

Also, you should only need a single Dummy unit to cast most if not all of your spells. There are cases where you would want a custom Dummy unit but I doubt this is one of them. And always double check to make sure that the spell your Dummy unit is casting is actually usable. The spell may have issues with it's Mana Cost, Cooldown, Cast Range, Targets Allowed, and Requirements which can all prevent it from casting.
 
Last edited:

Uncle

Warcraft Moderator
Level 65
Joined
Aug 10, 2018
Messages
6,724
This will work:
  • Berserk
    • Events
      • Unit - A unit starts effect of the ability
    • Conditions
      • (Ability being cast) Equal to Berserk
    • Actions
      • Set Be_caster = (Triggering Unit)
      • Set Be_Temppoint = (Position of Be_caster)
      • Unit - Create 1 dummy berserk for (Owner of Be_caster) at Be_Temppoint facing generic building facing degrees
      • Custom script: call RemoveLocation(udg_Be_Temppoint)
      • Unit - Set level of Berserk dummy for (Last created unit) to (Level of Berserk for Be_caster)
      • Unit - Add a 2.00 second generic expiration timer to (Last created unit)
      • Unit - Order (Last created unit) to Human Inner Fire Be_caster
Compare your trigger to this trigger and if you still can't get it to work then show us what you did.

Also, re-read my last post, I state pretty much every possible issue. Does the Dummy unit have the ability? Can it cast the ability?
 
Level 7
Joined
Jan 11, 2022
Messages
108
I seem to be doing something wrong (I have the same trigger)

So I based the spell on Orc's berserk spell. Wanted to make it that when you use the orc's berserk, you also gain custom inner fire buff increasing damage.

Inner fire is castable by unit, checked it. I'm also referencing the right abilities. (dummy berserk is the inner fire) and berserk is copied orc's berserk base spell. I'd love to share a screenshot of object editor and trigger editor but because I'm using my native language in it, i'm not sure if you would be able to get anything from it
 

Uncle

Warcraft Moderator
Level 65
Joined
Aug 10, 2018
Messages
6,724
Screenshot it or use this:

You can also Attach the map here or a Demo map and I'll look at it.
 
Level 7
Joined
Jan 11, 2022
Messages
108
Here's a demo map with that spell

Is it a custom version of inner fire? Asking in case your dummy doesn't have the priest master training upgrade :p
I disabled any requirements on inner fire so that's not it
 

Attachments

  • berserk demo map.w3x
    14.4 KB · Views: 4

Uncle

Warcraft Moderator
Level 65
Joined
Aug 10, 2018
Messages
6,724
Your Dummy unit isn't setup properly and your trigger has mistakes.

1) You're using the wrong Event. It's Starts the effect of an ability.
2) You're setting SW_Temppoint before setting SW_caster.

The order of Actions is very important and can change how your trigger works. In this case, the position of SW_caster doesn't exist since you haven't set SW_caster to a unit. You can't get the position of something that doesn't exist.

Dummy units should be based on the Locust, which is an Undead unit found under the Special category. You only need to create one of these and then you can reuse it in the majority of your custom spells.

After copying and pasting the Locust you need to give it the following settings:
Attacks Enabled: None
Movement Type: None
Speed Base: 0
Model: None
Shadow: None

With these settings the Dummy unit should only be able to cast spells and it should do so instantly without needing to turn to face it's target.

Since you're going to reuse this Dummy unit in multiple custom spells then don't worry about giving it an Ability in the Object Editor. Instead, simply add Inner Fire or whatever ability you want to your Dummy unit after you create it:
  • Unit - Create 1 Dummy...
  • Unit - Add Inner Fire to (Last created unit)
 
Last edited:
Level 7
Joined
Jan 11, 2022
Messages
108
Just checked it, and it must have been the order of variables that caused the problem. Dummy couldn't be set to position of a caster, because as you said, there was no Caster variable set before Temppoint. After fixing it works! Thank you!
 

Uncle

Warcraft Moderator
Level 65
Joined
Aug 10, 2018
Messages
6,724
Just checked it, and it must have been the order of variables that caused the problem. Dummy couldn't be set to position of a caster, because as you said, there was no Caster variable set before Temppoint. After fixing it works! Thank you!
No problem! I highly recommend fixing the Dummy unit as well if you haven't already. Your Sorceress Dummy can attack other units and has a 1+ second delay before it casts spells, not good :p
 
Level 7
Joined
Jan 11, 2022
Messages
108
No problem! I highly recommend fixing the Dummy unit as well if you haven't already. Your Sorceress Dummy can attack other units and has a 1+ second delay before it casts spells, not good :p
Just changed it to locust, and gonna use it in all spells :thumbs_up:
 
Status
Not open for further replies.
Top