Point, Offset, Maths, Urgh!

Grags_1977

Ultra Cool Member
Reaction score
32
I'm terrible at maths, and explaining things. But I will try my best...

I have 2 problems.


Problem 1

I'm trying to get the point that's between Point1 and Point2.

For instance...

set point1 = position of unit
set point2 = position of target unit
Create a special effect at point1 using BlinkCaster.mdl
Create a special effect in between point1 and point2 using BlinkCaster.mdl
Create a special effect at point2 using BlinkTarget.mdl



Problem 2

set point2 = Just In front of the target unit. So whichever ever way the target unit is facing point 2 is there. So when the casting unit is moved to point 2 the units are not stood on top of each other.


The ability in detail

The ability is called Rush. It's a bit like how Charge worked in WoW Pre-Tbc and is my answer to a hookshot in the Zelda games.

The ability warps the hero to any destructible, Item, Unit (even allied, invulnerable) in a 1600 radius. It's superb!

These are my triggers (If it helps)

Trigger:
  • Rush
    • Events
      • Unit - A unit Begins casting an ability
    • Conditions
      • (Ability being cast) Equal to Rush
    • Actions
      • Wait 0.01 seconds
      • Set TempPoint[16] = (Position of Unit_Hero)
      • Special Effect - Create a special effect at TempPoint[16] using Abilities\Spells\Other\Drain\ManaDrainTarget.mdl
      • Custom script: call RemoveLocation( udg_TempPoint[16] )
      • Set SpecialEffect_SFX = (Last created special effect)
      • Animation - Change Unit_Hero's animation speed to 50.00% of its original speed
      • Custom script: call SetUnitAnimationByIndex(udg_Unit_Hero, 117)
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Target destructible of ability being cast) Not equal to No destructible
        • Then - Actions
          • Trigger - Run Rush Destructible <gen> (ignoring conditions)
        • Else - Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Target item of ability being cast) Not equal to No item
        • Then - Actions
          • Trigger - Run Rush Item <gen> (ignoring conditions)
        • Else - Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Target unit of ability being cast) Not equal to No unit
        • Then - Actions
          • Trigger - Run Rush Unit <gen> (ignoring conditions)
        • Else - Actions
      • Wait 0.41 seconds
      • Animation - Change Unit_Hero's animation speed to 100.00% of its original speed
      • Set TempPoint[16] = (Position of Unit_Hero)
      • Special Effect - Create a special effect at TempPoint[16] using Objects\Spawnmodels\Undead\ImpaleTargetDust\ImpaleTargetDust.mdl
      • Special Effect - Destroy (Last created special effect)
      • Wait 0.40 seconds
      • Animation - Reset Unit_Hero's animation


Trigger:
  • Rush Unit
    • Events
    • Conditions
    • Actions
      • Set Unit_TempOther = (Target unit of ability being cast)
      • Wait 0.40 seconds
      • Special Effect - Destroy SpecialEffect_SFX
      • Set TempPoint[15] = (Position of Unit_TempOther)
      • Set TempPoint[16] = (Position of Unit_Hero)
      • Special Effect - Create a special effect at TempPoint[16] using Abilities\Spells\NightElf\Blink\BlinkCaster.mdl
      • Special Effect - Destroy (Last created special effect)
      • Custom script: call RemoveLocation( udg_TempPoint[16] )
      • Unit - Move Unit_Hero instantly to TempPoint[15]
      • Set TempPoint[16] = (Position of Unit_Hero)
      • Special Effect - Create a special effect at TempPoint[16] using Abilities\Spells\NightElf\Blink\BlinkTarget.mdl
      • Special Effect - Destroy (Last created special effect)
      • Custom script: call RemoveLocation( udg_TempPoint[16] )
      • Custom script: call RemoveLocation( udg_TempPoint[15] )
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Unit_TempOther belongs to an enemy of Player 1 (Red)) Equal to True
        • Then - Actions
          • Unit - Cause Unit_Hero to damage Unit_TempOther, dealing ((Real((Agility of Unit_Hero (Include bonuses)))) x 3.00) damage of attack type Spells and damage type Normal
        • Else - Actions
          • Unit - Remove Stunned (Pause) buff from Unit_TempOther
 

GFreak45

I didnt slap you, i high 5'd your face.
Reaction score
130
you could, create a unit at point 1 (dummy unit with a blank model and locust) facing point 2, and set point 3 equal to a point in front of the dummy unit half the distance between point 1 and point 2
 

Grags_1977

Ultra Cool Member
Reaction score
32
Sorry GFreak, but what you're explaining, seems to be a mix of both of the problems that i'm asking. Even with the dummy unit, i'm still left with the same questions...

Or am I reading you incorrectly?
 

GFreak45

I didnt slap you, i high 5'd your face.
Reaction score
130
my post was a solution to question 1, idk what the question was for the 2nd issue
 

Ryushi

"I will stand, or I will fall. I will not sit."
Reaction score
59
For Problem 1, you can set a point to be in the middle of two other points like this:
Trigger:
  • Set Point3 = (Point1 offset by ((Distance between Point1 and Point2) / 2.00) towards (Angle from Point1 to Point2) degrees)

For Problem 2, you haven't said what's going wrong with the trigger.
 

Grags_1977

Ultra Cool Member
Reaction score
32
Thankyou Ryushi, your trigger will most deffo be used +Rep

As for problem 2. There isn't really much wrong with the trigger, it's just a perfectionist issue. ATM when I cast Rush, the hero warps to the unit perfectly(ish). I want the hero to warp just in front of the unit so thier models arn't on top of each other. Preferably in front of the target units facing angle. So he's just in attacking distance.

The "problem" doesn't really count for any other object as i'm over paranoid with paving blockers.
 

merlinds

Member
Reaction score
15
For the problem 2. You need to know the "Caster" atacking range.
For the example lets set it as 120.
The point4 will be
Set point4 = (Position of TargetUnit offset by 120 facing "Facing angle of TargetUnit)
 

GFreak45

I didnt slap you, i high 5'd your face.
Reaction score
130
to do this you would need create a trigger that fires every 0.2 seconds or so (timer) and move him closer every time it fires, and then destroy it when he is close enough to attack

or if its just instant move up to the unit type of ability, do just like what ryushi said but make it distance of the units - 90 instead of /2
 

Grags_1977

Ultra Cool Member
Reaction score
32
Then have a look :)


This version is 2 days old as in the most playable version. I made this version as a friend who is also mad into world editor wanted to test it. So I stuck a few creeps in and made it a somewhat near playable map.

I think in around 6 months time (maybe more, maybe less) I could have a beta version on the forum.

If you want a preview of the Abilities type in ALL and you will have all the abilities.


Yes it's called Dunno, cause I dunno what to call it yet :)
 

GFreak45

I didnt slap you, i high 5'd your face.
Reaction score
130
ill definately try it out when i get home :)

EDIT: Ty for the rep :D, after i test it if i like the concepts ill def +rep you too... gotta have a reason >.<
 
General chit-chat
Help Users
  • No one is chatting at the moment.

      The Helper Discord

      Members online

      No members online now.

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials

      Network Sponsors

      Apex Steel Pipe - Buys and sells Steel Pipe.
      Top