Blink Strike Abilities - Some are glitchy?

227Minutes

New Member
Reaction score
1
I've made a couple of simple blinking attack spells, except one of mine has somehow stopped working. What happens is the caster casts a unit-target spell, and blinks behind that target, dealing damage, attacking, etc.

I made a sort of Omnislash (Dota players should know) and it works fine. The user blinks to the target unit several times and deals damage accordingly.

But on a different hero, I made a normal blink strike. My "Omnislash" moves the unit to [the position of the target unit offset by 35 towards 0-360 degrees]

But this one moves the unit to [the position of the target unit offset by 35 towards [facing of target unit + 180]] -> which gives a sort of 'teleport behind' effect.

HOWEVER

My unit just blinks to some random point on the map
This point has no significance at all (at least I dont think so)
And HE KEEPS BLINKING THERE

I tested both spells on the same unit in the same place, and the second one just doesn't work. It used to work, but all of a sudden it just doesn't work.

So I changed the second spell to be like the Omnislash, using the '[the position of the target unit offset by 35 towards 0-360 degrees]'.

IT STILL DOESNT WORK. I KEEP GOING TO THAT RANDOM PLACE WTF IS GOING ON.

And yea, now the two spells are pretty much the same.

frustration.png
 

Ayanami

칼리
Reaction score
288
Post up your triggers here. Remember to use WC3 tags.

EDIT
Alright. Firstly, are the waits necessary? Secondly, lose "A unit Starts the effect of an ability" as your event. Thirdly, what are you trying to accomplish by inserting the 0.55 seconds wait at the beginning?
 

227Minutes

New Member
Reaction score
1
I put the waits in there to let the effect attachments materialize, otherwise they just don't seem to appear.

The 0.55 seconds at the beginning is to let the manacost/cooldown of the ability kick in.

And yea, use "A unit starts the effect of an ability"? But my other spell uses "beings casting" and works fine, why does this one need that lol

Edit: I changed it to "starts the effect" and the problems still there.

Could there be any external thing thats causing this? The codes of the two spells are pretty much the same, this one just doesnt work .___.
 

Ayanami

칼리
Reaction score
288
Hmm, that's weird. Try this then.

Trigger:
  • Blade Strike
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to Blade Strike
    • Actions
      • Custom script: local unit c = GetTriggerUnit()
      • Custom script: local unit t = GetSpellTargetUnit()
      • Wait 0.55 seconds
      • Custom script: set udg_strikecaster = c
      • Custom script: set udg_striketarget = t
      • <rest of your actions>


Remove the "Do Nothing" as it just does nothing.

By the way, your offset part leaks.

Trigger:
  • Unit - Move strikecaster instantly to (temppoint2 offset by 35.00 towards (Random real number between 0.00 and 360.00) degrees)


Should be:

Trigger:
  • Actions
    • Set tempoffset = (temppoint2 offset by 35.00 towards Random angle degrees)
    • Unit - Move strikecaster instantly to tempoffset
    • Custom script: call RemoveLocation(udg_tempoffset)


And just asking, does the unit have the Omnislash spell as well?
 

227Minutes

New Member
Reaction score
1
Lol it works now. Wtf lol

Any explanation? XD And why does my omnislash work, but this one doesn't?

And no this unit does not have omnislash.

Heres some of my omnislash code:

frustration2.png


I'll fix the leaks later
 

Moridin

Snow Leopard
Reaction score
144
The Do Nothing action is known to cause errors and bugs. There's really no point in using it.

Edit: How to post in WC3 GUI tags:

1) Goto your trigger
2) Right click the name, above events.
3) Select Copy as Text

4) Goto the forum
5) Type this in [noparse]
Trigger:
  • <Paste the copied text here>
[/noparse]
 

Rushhour

New Member
Reaction score
46
I guess it doesn't work because 'Target unit of ability being cast' doesn't return the target unit if you have any (or some seconds) "wait" before it.

So the best way would again be using local variables like already suggested some posts above.
You can also make this fully MUI (that means two unis could cast this at the same time without any problems) by just setting your (global) variables after every "wait".
Trigger:
  • Custom Script: local unit trig=GetTriggerUnit()
    • Custom Script: local unit tar=GetSpellTargetUnit()
    • Custom Script: local location loc1=GetUnitLoc(trig)
    • Custom Script: local location loc2=GetUnitLoc(tar)
    • Comment - these lines NEED to be at the very top!
    • ....
    • Wait X seconds
    • Custom Script: set udg_aunit1=trig
    • Custom Script: set udg_aunit2=tar
    • Custom Script: set udg_apoint1=loc1
    • Custom Script set udg_apoint2=loc2
    • ... //your actions
    • Wait 0.20 seconds
    • Custom Script: set udg_aunit1=trig
    • Custom Script: set udg_aunit2=tar
    • Unit - Cause aunit1 to damage aunit2 dealing 500 damage of type.....

not the nicest way of doing it, but it works.. Ok I see that you are using the wait inside of a ForLoopIntegerA-loop... this would screw things up, when it's recast within the 0.6 seconds the loop needs... are you a perfectionist? :D
 

Bogrim

y hello thar
Reaction score
154
Know that when you refer to a unit in a trigger, you use variables. There are two type of variables, global and local. Global variables are used by all triggers, and local variables are only used by the trigger they're created in. Sadly, local variables are not an integrated part of the GUI.

The main difference between global and local variables is that local variables cannot be altered by anything else than the trigger they're created in, while pre-set global variables lose their original intended data as soon as you introduce a wait action.

The reason these posters are making you custom scripts is because "Triggering Unit" is a local variable but the other event response, "Target unit of ability", is not. That means the moment you introduce a wait action in the trigger, "Target unit of ability" will stop working correctly.

By writing "local <variable type> <variable name> = <value>" in the beginning of your trigger as a custom script, you can create a local variable even in GUI. However, know that you must null all local handle references in the end of the trigger or you will get memory leaks.
 

227Minutes

New Member
Reaction score
1
Know that when you refer to a unit in a trigger, you use variables. There are two type of variables, global and local. Global variables are used by all triggers, and local variables are only used by the trigger they're created in. Sadly, local variables are not an integrated part of the GUI.

The main difference between global and local variables is that local variables cannot be altered by anything else than the trigger they're created in, while pre-set global variables lose their original intended data as soon as you introduce a wait action.

The reason these posters are making you custom scripts is because "Triggering Unit" is a local variable but the other event response, "Target unit of ability", is not. That means the moment you introduce a wait action in the trigger, "Target unit of ability" will stop working correctly.

By writing "local <variable type> <variable name> = <value>" in the beginning of your trigger as a custom script, you can create a local variable even in GUI. However, know that you must null all local handle references in the end of the trigger or you will get memory leaks.

Thank you sir. Great clarification.

How do I null them?
 

Ayanami

칼리
Reaction score
288
Thank you sir. Great clarification.

How do I null them?

This:

Trigger:
  • Actions
    • Custom script: local unit c = GetTriggerUnit()
    • Custom script: local unit t = GetSpellTargetUnit()
    • &lt;Actions&gt;
    • Custom script: set c = null
    • Custom script: set t = null


Also, note that locals should be declared at the most top part of the trigger. You can always declare the local and then set it's value later. Here's an example.

Trigger:
  • Actions
    • Custom script: local unit c
    • Custom script: set c = GetTriggerUnit()
 

Bogrim

y hello thar
Reaction score
154
Thank you sir. Great clarification.

How do I null them?
Let me provide you with an example:
Trigger:
  • Actions
    • Custom script: local unit u = GetSpellTargetUnit()
    • Custom script: local location l = GetUnitLoc( u )
    • Custom script: local group g = GetUnitsInRangeOfLocAll( 512, l )
    • ...
    • Custom script: call RemoveLocation( l )
    • Custom script: call DestroyGroup( g )
    • Custom script: set u = null
    • Custom script: set l = null
    • Custom script: set g = null

First I destroy the handles, then I null the variables. Know that you only have to null variables dealing with handles, integers and reals don't need to be nulled and the editor will give you an error if you attempt to null them.
 
General chit-chat
Help Users
  • No one is chatting at the moment.

      The Helper Discord

      Staff online

      Members online

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials

      Network Sponsors

      Apex Steel Pipe - Buys and sells Steel Pipe.
      Top