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

[Trigger] Elune's Arrow-like skill problems need help

Status
Not open for further replies.
Level 4
Joined
Sep 6, 2012
Messages
88
Hi guys !

Currently I'm making a skill that behaves like DotA's Priestess of the Moon's Elune's Arrow, at least in terms of its creation and movement. If you don't know about it, whenever the hero casts that skill, an arrow is sent flying far far away and hit the first target within range.

During the making of this skill, I encountered 2 strange problems that I'd need help with. So, here they are. Oh, firstly I'll show you the trigger for them ~

Creation Trigger: This trigger creates an arrow at the caster position whenever the skill is casted.

  • Arrow Of Replacement
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to Arrow Of Replacement
    • Actions
      • Set Temp_Point = (Position of (Triggering unit))
      • Set Temp_FacingAngle = (Facing of (Triggering unit))
      • Unit - Create 1 Arrow of Replacement for (Owner of (Triggering unit)) at Temp_Point facing Temp_FacingAngle degrees
      • Set ArrowOfReplacement_Unit = (Last created unit)
      • Trigger - Turn on Arrow Of Replacement Movement <gen>
      • Custom script: call RemoveLocation (udg_Temp_Point)
Movement Trigger: This trigger moves the created arrow towards the direction the caster is facing.

  • Arrow Of Replacement Movement
    • Events
      • Time - Every 0.01 seconds of game time
    • Conditions
      • (Unit-type of ArrowOfReplacement_Unit) Equal to Arrow of Replacement
    • Actions
      • Unit - Move ArrowOfReplacement_Unit instantly to ((Position of ArrowOfReplacement_Unit) offset by 5.00 towards Temp_FacingAngle degrees), facing Temp_FacingAngle degrees
Well, now onto my encountered problems:

Untitled_zpsecf56cba.png


In the screenshot, the cursor position was where I clicked to use the skill. However, it turned out that the arrow went off to another direction. Any ideas about what caused this and how to fix it ?

Untitled2_zpsb2c26982.png


Okay, this looks weird. My arrow is always stopped half-way whenever it bumps into a Glacier Doodad. I set the arrow pathing to None and it can pass through all other Doodads like air, but these certain Glaciers always managed to stop it. I don't know why. Can you help me ?

Thank you very much for reading and if you have any ideas, please feel free to make a guess. I'd look forward to hearing your solutions to these problems !
 
Level 16
Joined
May 1, 2008
Messages
1,605
Moin moin =)

GUI hmm? First of all you spell isn't MUI so it will mess up when you cast it more then once at the same time .. hope you know that. Try this:
  • Actions
    • Custom script: set udg_Caster = GetTriggerUnit()
    • Custom script: set udg_FacingAngle = Atan2(GetSpellTargetY() - GetUnitY(udg_Caster),GetSpellTargetX() - GetUnitX(udg_Caster))
    • Custom script: set ArrowOfReplacement_Unit = CreateUnit(GetTriggerPlayer(),'dum1',GetUnitX(GetTriggerUnit()),GetUnitY(GetTriggerUnit()),udg_FacingAngle * bj_RADTODEG)
Store the caster into a variable, store the facing into a variable and store the arrow into a variable. I did it this way, because I don't know how to calculate the true facing in GUI :eek:

Also the shortest duration for a loop is 0.03, nothing below!
 
Level 4
Joined
Sep 6, 2012
Messages
88
@Dr.Boom: Oh well, I don't understand much about custom scripts, that's why I try to avoid them as much as possible, but hey, thanks for the reply.

By the way, I think 0.03 isn't exactly the shortest duration, because I do notice a significance difference between 0.01 and 0.02.

@rulerofiron99: Yup, the problem is definitely as you said. Thanks a lot for answering ! From your solution, I guess I will have to make an angle from 2 points, right ? One is the target point of the spell, and what is the other ?

Edit: Nevermind, I figured it out. Thanks so much ! ^^
 
Level 16
Joined
May 1, 2008
Messages
1,605
First of all, yes sure you avoid customs script .. scary jass, but I didn't found the GUI function for it and I only know jass, but now:
  • Set Face = (Angle from (Target point of issued order) to (Position of (Triggering unit)))
About the loop time. The shortest time you should use (thats more accurate). Because it came out, that people can have performance problems when a lower loop time is used or whatever ..
At least the shortest (jass) loop time we use at hive is: 0.03125 (32 actions per second - more then enough)
 
Status
Not open for further replies.
Top