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

Starfall

Status
Not open for further replies.

Uncle

Warcraft Moderator
Level 64
Joined
Aug 10, 2018
Messages
6,516
You need to trigger something like that. The Object Editor is pretty limited, what you see is what you get-besides maybe a few rare cases here and there.

Here's an extremely simple example that would work for a single unit. It's not hard to make it work for multiple units/players, but there would be a bit more to it.

Edit: With the new natives in 1.31, as people below have mentioned below, there will probably be a better method of doing this, although it will still require triggers.

  • Cast Starfall
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to Starfall
    • Actions
      • Set tempUnit[0] = (Triggering unit)
      • Trigger - Turn on Starfall Timer <gen>
  • Stop Casting Starfall
    • Events
      • Unit - A unit Stops casting an ability
    • Conditions
      • (Ability being cast) Equal to Starfall
    • Actions
      • Trigger - Turn off Starfall Timer <gen>
  • Starfall Timer
    • Events
      • Time - Every 1.50 seconds of game time
    • Conditions
    • Actions
      • Set tempPoint[0] = (Position of tempUnit[0])
      • Custom script: set bj_wantDestroyGroup = true
      • Unit Group - Pick every unit in (Units within 1000.00 of tempPoint[0]) and do (Actions)
        • Loop - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • ((Picked unit) belongs to an enemy of (Owner of tempUnit[0])) Equal to True
              • ((Picked unit) is alive) Equal to True
              • ((Picked unit) is invulnerable) Equal to False
              • ((Picked unit) is Magic Immune) Equal to False
            • Then - Actions
              • Unit - Cause tempUnit[0] to damage (Picked unit), dealing (Real((Intelligence of tempUnit[0] (Include bonuses)))) damage of attack type Spells and damage type Normal
              • Special Effect - Create a special effect attached to the origin of (Picked unit) using Abilities\Spells\NightElf\Starfall\StarfallTarget.mdl
              • Special Effect - Destroy (Last created special effect)
            • Else - Actions
      • Custom script: call RemoveLocation (udg_tempPoint[0])
 
Last edited:
Level 9
Joined
Feb 20, 2014
Messages
409
You need to trigger something like that. The Object Editor is pretty limited, what you see is what you get-besides maybe a few rare cases here and there.

Here's an extremely simple example that would work for a single unit. It's not hard to make it work for multiple units/players, but there would be a bit more to it.

  • Cast Starfall
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to Starfall
    • Actions
      • Set tempUnit[0] = (Triggering unit)
      • Trigger - Turn on Starfall Timer <gen>
  • Stop Casting Starfall
    • Events
      • Unit - A unit Stops casting an ability
    • Conditions
      • (Ability being cast) Equal to Starfall
    • Actions
      • Trigger - Turn off Starfall Timer <gen>
  • Starfall Timer
    • Events
      • Time - Every 1.50 seconds of game time
    • Conditions
    • Actions
      • Set tempPoint[0] = (Position of tempUnit[0])
      • Custom script: set bj_wantDestroyGroup = true
      • Unit Group - Pick every unit in (Units within 1000.00 of tempPoint[0]) and do (Actions)
        • Loop - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • ((Picked unit) belongs to an enemy of (Owner of tempUnit[0])) Equal to True
              • ((Picked unit) is alive) Equal to True
              • ((Picked unit) is invulnerable) Equal to False
              • ((Picked unit) is Magic Immune) Equal to False
            • Then - Actions
              • Unit - Cause tempUnit[0] to damage (Picked unit), dealing (Real((Intelligence of tempUnit[0] (Include bonuses)))) damage of attack type Spells and damage type Normal
              • Special Effect - Create a special effect attached to the origin of (Picked unit) using Abilities\Spells\NightElf\Starfall\StarfallTarget.mdl
              • Special Effect - Destroy (Last created special effect)
            • Else - Actions
      • Custom script: call RemoveLocation (udg_tempPoint[0])

Hi, I read your trigger and did mine. It works well but only the first casting (it is supposed to deals damage every sec during 10 sec)

  • Events
    • Unit - A unit Starts to cast an ability
  • Conditions
    • (Ability being cast) Egal à Starfall
  • Actions
    • Set caster = (Triggering unit)
    • Set Player = (Triggering player)
    • Set UnitGroup = (Units within 900.00 of (Position of caster))
    • Set intellE = (Intelligence of (Triggering unit) (Inclure bonuses))
    • Set intell = (Real(intellE))
    • Unit Group- Pick every unit in UnitGroup and do (Actions)
      • Loop - Actions
        • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
          • If - Conditions
            • ((Picked unit) is alive) Egal à TRUE
            • ((Picked unit) belongs to an enemy of Player) Egal à TRUE
            • (Level of Starfall for (Triggering unit)) Egal à 1
          • Then - Actions
            • Special Effect - Create a special effect at (Position of (Picked unit)) using Abilities\Spells\Human\HolyBolt\HolyBoltSpecialArt.mdl
            • Unité - Cause caster to damage (Picked unit), dealing (100000.00 + (intell x 2.00)) damage of attack type Sorts and damage type Universel
            • Wait 1.00 seconds
            • Special Effect - Create a special effect at (Position of (Picked unit)) using Abilities\Spells\Human\HolyBolt\HolyBoltSpecialArt.mdl
            • Unité - Cause caster to damage (Picked unit), dealing (100000.00 + (intell x 2.00)) damage of attack type Sorts and damage type Universel
            • Wait 1.00 seconds
            • Special Effect - Create a special effect at (Position of (Picked unit)) using Abilities\Spells\Human\HolyBolt\HolyBoltSpecialArt.mdl
            • Unité - Cause caster to damage (Picked unit), dealing (100000.00 + (intell x 2.00)) damage of attack type Sorts and damage type Universel
            • Wait 1.00 seconds
            • Special Effect - Create a special effect at (Position of (Picked unit)) using Abilities\Spells\Human\HolyBolt\HolyBoltSpecialArt.mdl
            • Unité - Cause caster to damage (Picked unit), dealing (100000.00 + (intell x 2.00)) damage of attack type Sorts and damage type Universel
            • Wait 1.00 seconds
            • Special Effect - Create a special effect at (Position of (Picked unit)) using Abilities\Spells\Human\HolyBolt\HolyBoltSpecialArt.mdl
            • Unité - Cause caster to damage (Picked unit), dealing (100000.00 + (intell x 2.00)) damage of attack type Sorts and damage type Universel
            • Wait 1.00 seconds
            • Special Effect- Create a special effect at (Position of (Picked unit)) using Abilities\Spells\Human\HolyBolt\HolyBoltSpecialArt.mdl
            • Unité - Cause caster to damage (Picked unit), dealing (100000.00 + (intell x 2.00)) damage of attack type Sorts and damage type Universel
            • Wait 1.00 seconds
            • Special Effect - Create a special effect at (Position of (Picked unit)) using Abilities\Spells\Human\HolyBolt\HolyBoltSpecialArt.mdl
            • Unité - Cause caster to damage (Picked unit), dealing (100000.00 + (intell x 2.00)) damage of attack type Sorts and damage type Universel
            • Wait 1.00 seconds
            • Special Effect - Create a special effect at (Position of (Picked unit)) using Abilities\Spells\Human\HolyBolt\HolyBoltSpecialArt.mdl
            • Unité - Cause caster to damage (Picked unit), dealing (100000.00 + (intell x 2.00)) damage of attack type Sorts and damage type Universel
            • Wait 1.00 seconds
            • Special Effect - Create a special effect at (Position of (Picked unit)) using Abilities\Spells\Human\HolyBolt\HolyBoltSpecialArt.mdl
            • Unité - Cause caster to damage (Picked unit), dealing (100000.00 + (intell x 2.00)) damage of attack type Sorts and damage type Universel
            • Wait 1.00 seconds
            • Special Effect - Create a special effect at (Position of (Picked unit)) using Abilities\Spells\Human\HolyBolt\HolyBoltSpecialArt.mdl
            • Unité - Cause caster to damage (Picked unit), dealing (100000.00 + (intell x 2.00)) damage of attack type Sorts and damage type Universel
          • Sinon - Actions
 

Uncle

Warcraft Moderator
Level 64
Joined
Aug 10, 2018
Messages
6,516
Player is set to Triggering Player. It needs to be set to "Owner of Triggering Unit". Also, Waits are pretty bad to use, that's why I use a timer. You also don't clean up any leaks.
  • Set UnitGroup = (Units within 900.00 of (Position of caster))
will leak and slow down your game. Also, because of how you setup your Unit Group, your trigger will only ever damage enemies that were around the Hero when you first cast the ability. The Unit Group should be destroyed and then recreated every single Starfall interval.

Is there a reason why you didn't use my trigger? If you want it to work for multiple units I could show you how to do that too.
 
Last edited:
Level 8
Joined
May 21, 2019
Messages
435
Hi,
I would like to make starfall dealing damage based on my intelligence.
But how to do it? I mean I have to change every star's damage, is it possible? Is there a function in the editor?
Normally, this would have to be triggered kinda like what Uncle wrote, however, this can be done in 1.31 using the action that changes the data of an ability. I'd recommend simply waiting until they hotfix 1.31 and then make it using that.
 

Wrda

Spell Reviewer
Level 25
Joined
Nov 18, 2012
Messages
1,870
Changing data is bad if you have multiple units with that ability, it changes the data about the ability, for ALL units, not just the ability that a certain unit has. Keep that in mind.

Edit: I'm an idiot, tested and it only changes the data for a single unit.
 
Last edited:
Level 8
Joined
May 21, 2019
Messages
435
Changing data is bad if you have multiple units with that ability, it changes the data about the ability, for ALL units, not just the ability that a certain unit has. Keep that in mind.
Makes me wonder if there's a clever solution for this.
Off the top of my head, you could create a custom skill leveling system, where skill levels are stored in a variable, and the actual skill levels are used as indices for different units using the spell, so you write whatever stats the given unit has on the ability into the data fields of the level matching the unit index.
An advantage of that system over triggered simulation of the effect is that it's often a lot less resource intensive, and you can actually update the tooltips to match the scaling.
 

Uncle

Warcraft Moderator
Level 64
Joined
Aug 10, 2018
Messages
6,516
I'm sure Blizzard will get around to making these functions have both options, so you can change a specific ability for a specific unit instead of adjusting the data for EVERYTHING. I mean they already have stuff like this:
  • Unit - For Unit (Triggering unit), Set cooldown of ability Animate Dead, Level: 0 to 5.00
 

Wrda

Spell Reviewer
Level 25
Joined
Nov 18, 2012
Messages
1,870
I'm sure Blizzard will get around to making these functions have both options, so you can change a specific ability for a specific unit instead of adjusting the data for EVERYTHING. I mean they already have stuff like this:
  • Unit - For Unit (Triggering unit), Set cooldown of ability Animate Dead, Level: 0 to 5.00
I've posted above that function sets the ability's field globally, meaning for all units...(Then I tested yesterday) I was wrong to believe it, because the title of the action (when you're scrolling through it, not when you click on the action) looked like it affected the ability for all units, but no, it only affects the data of the UNIT you're refering to. Obviously it doesn't update the tooltip because if you have 2 units of same unit-type with an ability and modify the cooldown data of one unit's ability, you'll have different values, but updating the tooltip is effortless.
 
Level 12
Joined
Nov 3, 2013
Messages
989
Player is set to Triggering Player. It needs to be set to "Owner of Triggering Unit".
That's false, for player unit events (generic unit event in GUI) you can use triggering player.

The issue should be that waits simply don't work in loops at all.
 
Level 8
Joined
May 21, 2019
Messages
435
I've posted above that function sets the ability's field globally, meaning for all units...(Then I tested yesterday) I was wrong to believe it, because the title of the action (when you're scrolling through it, not when you click on the action) looked like it affected the ability for all units, but no, it only affects the data of the UNIT you're refering to.
That's nice to hear, thanks for the update! I haven't installed the patch myself due to the corruption issues, so it's nice to get some insight.
 

Uncle

Warcraft Moderator
Level 64
Joined
Aug 10, 2018
Messages
6,516
I'd like to mention that For Loops do work with waits. The ones that do not work with waits are: Unit Groups, Player Groups, Item Enumerator.

Didn't know that, maybe my fear of waits is unwarranted. I read that waits have a delay/minimum duration and have issues with lag. But I guess they're fine if you're doing something with a 1 second interval like this starfall trigger. I just avoid them at all costs since timers are accurate and pretty easy to use.

Anyway, if you're working in GUI i'd highly recommend using a Unit Indexer / Hashtables if you're going to be making a map with a lot of custom spells.
 
Level 8
Joined
May 21, 2019
Messages
435
Didn't know that, maybe my fear of waits is unwarranted. I read that waits have a delay/minimum duration and have issues with lag. But I guess they're fine if you're doing something with a 1 second interval like this starfall trigger. I just avoid them at all costs since timers are accurate and pretty easy to use.

Anyway, if you're working in GUI i'd highly recommend using a Unit Indexer / Hashtables if you're going to be making a map with a lot of custom spells.
Waits have a delay, something like 0.23 seconds or something, meaning that any wait underneath that threshold will be counted as 0.23, so for extremely quick pauses, wait isn't even remotely accurate. Using timers in loops tends to be pretty hard though.
 

Wrda

Spell Reviewer
Level 25
Joined
Nov 18, 2012
Messages
1,870
Didn't know that, maybe my fear of waits is unwarranted. I read that waits have a delay/minimum duration and have issues with lag.
Not true anymore since hostbots are gone. When they existed, there was a window showing "waiting for players..." when someone lagged, and the game paused, this was problematic. Now there is no need to worry about that, the only thing that can be a problem is when someone pauses/saves a game.
Of course the accuracy is also a problem, calculated by everyone's delay and the wait itself.
 
Status
Not open for further replies.
Top