Problem with a Dash spell

Mr. Reez

New Member
Reaction score
0
Hello everyone,
I need somebody's help. I created a dash spell using loops (to be honest, I copied it with consent), but being new to the Trigger type spells I stumbled upon a problem:
Dashing to a location works fine, but let's say I move away from there, then I use the spell again, it takes back to where the last spell ended and moves to the same direction and distance pointed but from the wrong place
 

Mr. Reez

New Member
Reaction score
0
Dash Cast
Events
Unit - A unit Starts the effect of an ability
Conditions
(Ability being cast) Equal to Dash
Actions
Set Caster = (Triggering unit)
Set Point[0] = (Position of Caster)
Set Point[1] = (Target point of ability being cast)
Set Distance = (Distance between (Position of Caster) and Point[1])
Set Increment = 35.00
Set Angle = (Angle from (Position of Caster) to Point[1])
Custom script: call RemoveLocation(udg_Point[0])
Custom script: call RemoveLocation(udg_Point[1])
Trigger - Turn on Dash Loop <gen>


Dash Loop
Events
Time - Every 0.04 seconds of game time
Conditions
Actions
Set Distance = (Distance - Increment)
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
Distance Greater than 0.00
Then - Actions
Set Point[2] = (Position of Caster)
Set Point[3] = (Point[3] offset by Increment towards Angle degrees)
Unit - Move Caster instantly to Point[3]
Special Effect - Create a special effect at Point[3] using Abilities\Spells\Other\Monsoon\MonsoonBoltTarget.mdl
Special Effect - Destroy (Last created special effect)
Custom script: call RemoveLocation(udg_Point[2])
Else - Actions
Custom script: call RemoveLocation(udg_Point[2])
I would copy it the way it really looks (which is more like a list of options) but I don't know how.
 

Imp Midna

Active Member
Reaction score
52
to make your trigger look like the we's GUI, copy the text between [ wc3] [ /wc3] tags (without the whitespaces).

I will, at this point, asume its some kind of proof-of-concept and ignore any kind of useless lesson about insignificant memory leak

Your problem is this line:
Trigger:
  • Set Point[3] = (Point[3] offset by Increment towards Angle degrees)

You mostlikely wanted to calculate the new point from where the caster currently is (Point[2]) but accidently took point[3] instead. Since Point[3] is mostlikely initialised with (0|0), you will alyways dash from the same point.

Btw, in the else-block of your if in the loop-trigger, consider writing
Trigger:
  • Trigger - Turn off (This trigger)

instead. Else, the game would constantly execute the trigger 25 times a second which is some kind of waste ;)
 

Accname

2D-Graphics enthusiast
Reaction score
1,462
You also leak locations in both triggers.
In the first one you create a point variable Point[0] and set it to be (Position of Caster) but then later you dont use it but use (Position of Caster) directly instead.

In the second trigger you create Set Point[2] and Point[3] but only remove point 2 at the end.

Another tip is not to use "move caster instantly" but the jass line to set a units X and Y directly.
This way your caster would not be stunned while charging and you could still give him orders, possibly stopping the charge if given any other order in the meantime.
 

Mr. Reez

New Member
Reaction score
0
Thank you! Really!
I have no idea how to use Jass yet, I am trying to learn... I didn't know one could mix both together.
I hope I am not asking too much, but what would the Jass line look like?
I really appreciate the help.
 

Accname

2D-Graphics enthusiast
Reaction score
1,462
I dont know for sure anymore. I didnt work with the editor now for quite some time but it was something along the lines of:
SetUnitX(<UNIT>, <(int) VALUE>)
and to get the x value of the point it was something like:
GetLocationX(<Location>)

So the complete part would be something like:
Code:
set Temp_Point = Position of ...
set Temp_Unit = Triggering Unit
custom script: SetUnitX( udg_Temp_Unit, GetLocationX( udg_Temp_Point ) )
and of course another line for the Y axis just with X substituted by Y.

But as i said, the syntax might be off, i havent used it for a long time now.
 
General chit-chat
Help Users
  • No one is chatting at the moment.
  • WildTurkey WildTurkey:
    is there a stephen green in the house?
    +1
  • The Helper The Helper:
    What is up WildTurkey?
  • The Helper The Helper:
    Looks like Google fixed whatever mistake that made the recipes on the site go crazy and we are no longer trending towards a recipe site lol - I don't care though because it motivated me to spend alot of time on the site improving it and at least now the content people are looking at is not stupid and embarrassing like it was when I first got back into this like 5 years ago.
  • The Helper The Helper:
    Plus - I have a pretty bad ass recipe collection now! That section of the site is 10 thousand times better than it was before
  • The Helper The Helper:
    We now have a web designer at my job. A legit talented professional! I am going to get him to redesign the site theme. It is time.
  • Varine Varine:
    I got one more day of community service and then I'm free from this nonsense! I polished a cop car today for a funeral or something I guess
  • Varine Varine:
    They also were digging threw old shit at the sheriff's office and I tried to get them to give me the old electronic stuff, but they said no. They can't give it to people because they might use it to impersonate a cop or break into their network or some shit? idk but it was a shame to see them take a whole bunch of radios and shit to get shredded and landfilled
  • The Helper The Helper:
    whatever at least you are free
  • Monovertex Monovertex:
    How are you all? :D
    +1
  • Ghan Ghan:
    Howdy
  • Ghan Ghan:
    Still lurking
    +3
  • The Helper The Helper:
    I am great and it is fantastic to see you my friend!
    +1
  • The Helper The Helper:
    If you are new to the site please check out the Recipe and Food Forum https://www.thehelper.net/forums/recipes-and-food.220/
  • Monovertex Monovertex:
    How come you're so into recipes lately? Never saw this much interest in this topic in the old days of TH.net
  • Monovertex Monovertex:
    Hmm, how do I change my signature?
  • tom_mai78101 tom_mai78101:
    Signatures can be edit in your account profile. As for the old stuffs, I'm thinking it's because Blizzard is now under Microsoft, and because of Microsoft Xbox going the way it is, it's dreadful.
  • The Helper The Helper:
    I am not big on the recipes I am just promoting them - I use the site as a practice place promoting stuff
    +2
  • Monovertex Monovertex:
    @tom_mai78101 I must be blind. If I go on my profile I don't see any area to edit the signature; If I go to account details (settings) I don't see any signature area either.
  • The Helper The Helper:
    You can get there if you click the bell icon (alerts) and choose preferences from the bottom, signature will be in the menu on the left there https://www.thehelper.net/account/preferences
  • The Helper The Helper:
    I think I need to split the Sci/Tech news forum into 2 one for Science and one for Tech but I am hating all the moving of posts I would have to do
  • The Helper The Helper:
    What is up Old Mountain Shadow?

      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