• Listen to a special audio message from Bill Roper to the Hive Workshop community (Bill is a former Vice President of Blizzard Entertainment, Producer, Designer, Musician, Voice Actor) 🔗Click here to hear his message!
  • Read Evilhog's interview with Gregory Alper, the original composer of the music for WarCraft: Orcs & Humans 🔗Click here to read the full interview.

The knockback!!

Status
Not open for further replies.
Level 4
Joined
Aug 3, 2008
Messages
58
Hammer Caster
Events
Unit - A unit Starts the effect of an ability
Conditions
(Ability being cast) Equal to Hammer
Actions
Set HammerCastingUnit[(Player number of (Owner of (Casting unit)))] = (Casting unit)
Set HammerTargetUnit[(Player number of (Owner of (Target unit of ability being cast)))] = (Target unit of ability being cast)
Set HammerEffect = (Position of HammerCastingUnit[(Player number of (Owner of (Casting unit)))])
Special Effect - Create a special effect at HammerEffect using Abilities\Spells\Human\ThunderClap\ThunderClapCaster.mdl
Special Effect - Destroy (Last created special effect)
Custom script: call RemoveLocation (udg_HammerEffect)

Hammer Knockback
Events
Time - Every 0.01 seconds of game time
Conditions
Actions
For each (Integer A) from 1 to 12, do (Actions)
Loop - Actions
Set HammerKnockBack[(Integer A)] = ((Position of HammerTargetUnit[(Integer A)]) offset by 7.00 towards (Angle from (Position of HammerCastingUnit[(Integer A)]) to (Position of HammerTargetUnit[(Integer A)])) degrees)
Unit - Move HammerTargetUnit[(Integer A)] instantly to HammerKnockBack[(Integer A)]
Custom script: call RemoveLocation(udg_HammerKnockBack[GetForLoopIndexA()])

when the paladin uses hammer on a unit, the knockback angle is weird sometimes it doesnt correspond to the facing of paladin help please
 
  • Angry
Reactions: Rui
Level 11
Joined
Dec 31, 2007
Messages
780
if you are gonna use that for a lot of units... yes

save the facing of the casting in an array with the number of the owner as you did for the rest... but make it at the beginning of the casting trigger for it to be more accurate
 
Level 4
Joined
Aug 3, 2008
Messages
58
Hammer Caster
Events
Unit - A unit Starts the effect of an ability
Conditions
(Ability being cast) Equal to Hammer
Actions
Set HammerCastingUnit[(Player number of (Owner of (Casting unit)))] = (Casting unit)
Set HammerTargetUnit[(Player number of (Owner of (Target unit of ability being cast)))] = (Target unit of ability being cast)
Set HammerEffect = (Position of HammerCastingUnit[(Player number of (Owner of (Casting unit)))])
Set HammerFacing[(Player number of (Owner of HammerCastingUnit[(Player number of (Owner of (Casting unit)))]))] = (Facing of HammerCastingUnit[(Player number of (Owner of (Casting unit)))])
Special Effect - Create a special effect at HammerEffect using Abilities\Spells\Human\ThunderClap\ThunderClapCaster.mdl
Special Effect - Destroy (Last created special effect)
Custom script: call RemoveLocation (udg_HammerEffect)

Hammer Knockback
Events
Time - Every 0.01 seconds of game time
Conditions
Actions
For each (Integer A) from 1 to 12, do (Actions)
Loop - Actions
Set HammerKnockBack[(Integer A)] = ((Position of HammerTargetUnit[(Integer A)]) offset by 7.00 towards HammerFacing[(Integer A)] degrees)
Unit - Move HammerTargetUnit[(Integer A)] instantly to HammerKnockBack[(Integer A)]
Custom script: call RemoveLocation(udg_HammerKnockBack[GetForLoopIndexA()])

this is what i did but all the units get knockbacked to the rightside of the map
 
Level 11
Joined
Dec 31, 2007
Messages
780
to make this

Hammer Caster
Events
Unit - A unit Starts the effect of an ability
Conditions
(Ability being cast) Equal to Hammer
Actions
Set HammerCastingUnit[(Player number of (Owner of (Casting unit)))] = (Casting unit)
Set HammerTargetUnit[(Player number of (Owner of (Target unit of ability being cast)))] = (Target unit of ability being cast)
Set HammerEffect = (Position of HammerCastingUnit[(Player number of (Owner of (Casting unit)))])
Set HammerFacing[(Player number of (Owner of HammerCastingUnit[(Player number of (Owner of (Casting unit)))]))] = (Facing of HammerCastingUnit[(Player number of (Owner of (Casting unit)))])
Special Effect - Create a special effect at HammerEffect using Abilities\Spells\Human\ThunderClap\ThunderClapCaster.mdl
Special Effect - Destroy (Last created special effect)
Custom script: call RemoveLocation (udg_HammerEffect)

Hammer Knockback
Events
Time - Every 0.01 seconds of game time
Conditions
Actions
For each (Integer A) from 1 to 12, do (Actions)
Loop - Actions
Set HammerKnockBack[(Integer A)] = ((Position of HammerTargetUnit[(Integer A)]) offset by 7.00 towards HammerFacing[(Integer A)] degrees)
Unit - Move HammerTargetUnit[(Integer A)] instantly to HammerKnockBack[(Integer A)]
Custom script: call RemoveLocation(udg_HammerKnockBack[GetForLoopIndexA()])

look like this

  • Hammer Caster
  • Events
  • Unit - A unit Starts the effect of an ability
  • Conditions
  • (Ability being cast) Equal to Hammer
  • Actions
  • Set HammerCastingUnit[(Player number of (Owner of (Casting unit)))] = (Casting unit)
  • Set HammerTargetUnit[(Player number of (Owner of (Target unit of ability being cast)))] = (Target unit of ability being cast)
  • Set HammerEffect = (Position of HammerCastingUnit[(Player number of (Owner of (Casting unit)))])
  • Set HammerFacing[(Player number of (Owner of HammerCastingUnit[(Player number of (Owner of (Casting unit)))]))] = (Facing of HammerCastingUnit[(Player number of (Owner of (Casting unit)))])
  • Special Effect - Create a special effect at HammerEffect using Abilities\Spells\Human\ThunderClap\ThunderClapCaster.mdl
  • Special Effect - Destroy (Last created special effect)
  • Custom script: call RemoveLocation (udg_HammerEffect)
  • Hammer Knockback
  • Events
  • Time - Every 0.01 seconds of game time
  • Conditions
  • Actions
  • For each (Integer A) from 1 to 12, do (Actions)
  • Loop - Actions
  • Set HammerKnockBack[(Integer A)] = ((Position of HammerTargetUnit[(Integer A)]) offset by 7.00 towards HammerFacing[(Integer A)] degrees)
  • Unit - Move HammerTargetUnit[(Integer A)] instantly to HammerKnockBack[(Integer A)]
  • Custom script: call RemoveLocation(udg_HammerKnockBack[GetForLoopIndexA()])
 
Level 5
Joined
Jan 6, 2006
Messages
106
  • Hammer Knockback
  • Events
  • Time - Every 0.01 seconds of game time
  • Conditions
  • Actions
  • For each (Integer A) from 1 to 12, do (Actions)
  • Loop - Actions
  • Set HammerKnockBack[(Integer A)] = ((Position of HammerTargetUnit[(Integer A)]) offset by 7.00 towards HammerFacing[(Integer A)] degrees)
  • Unit - Move HammerTargetUnit[(Integer A)] instantly to HammerKnockBack[(Integer A)]
  • Custom script: call RemoveLocation(udg_HammerKnockBack[GetForLoopIndexA()])

Why would you set a looping function in an already looping trigger? And yeah, from all I saw in your trigger, there is no condition to disable this looping trigger, which will cause it to keep looping for eternity....

  • Set HammerKnockBack[(Integer A)] = ((Position of HammerTargetUnit[(Integer A)]) offset by 7.00 towards HammerFacing[(Integer A)] degrees)
And you said your trigger sometimes doesn't work as intended as all, the problem should be due to the memory leak here. I'm afraid you'll have to set and destroy another variable for Position of HammerTargetUnit[(Integer A)], since this also constitutes a location leak in itself as well.
 
Status
Not open for further replies.
Top