My triggering is probably done wrong, but here it is anyway.
- What I want is for a unit to be created at the casters position and attack ground, so it makes a projectile model for my skillshot. It works fine, except for the first time it is cast. I cannot see why this happens.
Power Shot Cast
Events
Unit - A unit Starts the effect of an ability
Conditions
(Ability being cast) Equal to Power Shot
Actions
Unit - Create 1 Power Shot Model [Fix] for Player[(Player number of (Owner of (Casting unit)))] at PowerShotCastPoint[(Player number of (Owner of (Casting unit)))] facing (Angle from PowerShotCastPoint[(Player number of (Owner of (Casting unit)))] to PowerShotTargetPoint[(Player number of (Owner of (Casting unit)))]) degrees
Set PowerShotModel[(Player number of (Owner of (Casting unit)))] = (Last created unit)
Unit - Move PowerShotModel[(Player number of (Owner of (Casting unit)))] instantly to ((Position of Hero[(Player number of (Owner of (Casting unit)))]) offset by 50.00 towards (Angle from PowerShotCastPoint[(Player number of (Owner of (Casting unit)))] to PowerShotTargetPoint[(Player number of (Owner of (Casting unit)))]) degrees)
Countdown Timer - Start PowerShotTimer[(Player number of (Owner of (Casting unit)))] as a One-shot timer that will expire in 1.50 seconds
Set PowerShotArrowActive[(Player number of (Owner of (Casting unit)))] = PowerShotArrow[(Player number of (Owner of (Casting unit)))]
Set PowerShotDamage[(Player number of (Owner of (Casting unit)))] = (300 + ((Level of (Ability being cast) for (Casting unit)) x 30))
Set PowerShotCastPoint[(Player number of (Owner of (Casting unit)))] = (Position of (Casting unit))
Set PowerShotTargetPoint[(Player number of (Owner of (Casting unit)))] = (Target point of ability being cast)
Unit - Move PowerShotArrow[(Player number of (Owner of (Casting unit)))] instantly to ((Position of (Casting unit)) offset by 0.00 towards (Angle from PowerShotCastPoint[(Player number of (Owner of (Casting unit)))] to PowerShotTargetPoint[(Player number of (Owner of (Casting unit)))]) degrees)
Unit - Order PowerShotModel[(Player number of (Owner of (Casting unit)))] to Attack Ground (PowerShotCastPoint[(Player number of (Owner of (Casting unit)))] offset by 1500.00 towards (Angle from PowerShotCastPoint[(Player number of (Owner of (Casting unit)))] to PowerShotTargetPoint[(Player number of (Owner of (Casting unit)))]) degrees)
Edit: It's not a problem with variable settings, such as Player[Index] they are all set at map init.
I'm dumb, just figured it out.
- What I want is for a unit to be created at the casters position and attack ground, so it makes a projectile model for my skillshot. It works fine, except for the first time it is cast. I cannot see why this happens.
Power Shot Cast
Events
Unit - A unit Starts the effect of an ability
Conditions
(Ability being cast) Equal to Power Shot
Actions
Unit - Create 1 Power Shot Model [Fix] for Player[(Player number of (Owner of (Casting unit)))] at PowerShotCastPoint[(Player number of (Owner of (Casting unit)))] facing (Angle from PowerShotCastPoint[(Player number of (Owner of (Casting unit)))] to PowerShotTargetPoint[(Player number of (Owner of (Casting unit)))]) degrees
Set PowerShotModel[(Player number of (Owner of (Casting unit)))] = (Last created unit)
Unit - Move PowerShotModel[(Player number of (Owner of (Casting unit)))] instantly to ((Position of Hero[(Player number of (Owner of (Casting unit)))]) offset by 50.00 towards (Angle from PowerShotCastPoint[(Player number of (Owner of (Casting unit)))] to PowerShotTargetPoint[(Player number of (Owner of (Casting unit)))]) degrees)
Countdown Timer - Start PowerShotTimer[(Player number of (Owner of (Casting unit)))] as a One-shot timer that will expire in 1.50 seconds
Set PowerShotArrowActive[(Player number of (Owner of (Casting unit)))] = PowerShotArrow[(Player number of (Owner of (Casting unit)))]
Set PowerShotDamage[(Player number of (Owner of (Casting unit)))] = (300 + ((Level of (Ability being cast) for (Casting unit)) x 30))
Set PowerShotCastPoint[(Player number of (Owner of (Casting unit)))] = (Position of (Casting unit))
Set PowerShotTargetPoint[(Player number of (Owner of (Casting unit)))] = (Target point of ability being cast)
Unit - Move PowerShotArrow[(Player number of (Owner of (Casting unit)))] instantly to ((Position of (Casting unit)) offset by 0.00 towards (Angle from PowerShotCastPoint[(Player number of (Owner of (Casting unit)))] to PowerShotTargetPoint[(Player number of (Owner of (Casting unit)))]) degrees)
Unit - Order PowerShotModel[(Player number of (Owner of (Casting unit)))] to Attack Ground (PowerShotCastPoint[(Player number of (Owner of (Casting unit)))] offset by 1500.00 towards (Angle from PowerShotCastPoint[(Player number of (Owner of (Casting unit)))] to PowerShotTargetPoint[(Player number of (Owner of (Casting unit)))]) degrees)
Edit: It's not a problem with variable settings, such as Player[Index] they are all set at map init.
I'm dumb, just figured it out.
Last edited: