First Shot at a "Dash" Spell

substance

New Member
Reaction score
34
> 2 locations, 4 points.

But if you did that, wouldn't you have to convert the coordinates to locations first with the native Location function?

Oh yeh, I forgot that function uses locations and not reals. Well I think the formula for getting the distance from 2 sets of coordiantes is
JASS:
SquareRoot((x2 - x) * (x2 - x) + (y2 - y) * (y2 - y))
 

Ghan

Administrator - Servers are fun
Staff member
Reaction score
889
> I opened it up and when I look at a JASS trigger, there's no highlighting and there's no Syntax Checker.

No idea. Have you checked the menus that you said you can see? Everything enabled? How about posting a screenshot of what you do see?

As for the location, you might be able to use this:

JASS:
native Location                 takes real x, real y returns location
 

WarLuvr3393

Hmmm...too many things to play (WoW, COD4, WC3)
Reaction score
54
help1fc4.png


help2jt1.png


help3rz9.png


Anything supposed to be checked?
 

WarLuvr3393

Hmmm...too many things to play (WoW, COD4, WC3)
Reaction score
54
JASS:
//**********************
//* Constant Functions *
//**********************

constant function FW_Rawcode takes nothing returns integer
  return 'A002' // This is the Raw Code for the spell "Flamewalk" (Based on Shockwave)
endfunction

//**************
//* Conditions *
//**************

function FW_Check takes nothing returns boolean
  return GetSpellAbilityId() == FW_Rawcode()
endfunction

//*************
//* Functions *
//*************

function PolarX takes real x, real dist, real angle returns real
           return x+dist*Cos(angle*bj_DEGTORAD)
endfunction

function PolarY takes real y, real dist, real angle returns real
           return y+dist*Sin(angle*bj_DEGTORAD)
endfunction

function FW takes nothing returns nothing
  //Local Variables
    local timer t = GetExpiredTimer()
    local unit caster = GetHandleUnit(t, "caster")
    local real x = GetUnitX(caster)
    local real y = GetUnitY(caster)
    local location casterpos = Location(GetUnitX(caster), GetUnitY(caster))
    local location point = GetSpellTargetLoc()
            
  //Functions
    if DistanceBetweenPoints(casterpos, point) != 0 then
      call SetUnitPosition(caster, PolarX(x, DistanceBetweenPoints(casterpos, point)+30.00, AngleBetweenPoints(casterpos, point)), PolarY(y, DistanceBetweenPoints(casterpos, point)+10.00, AngleBetweenPoints(casterpos, point)))
    else
      call PauseUnit(caster, false)
      call ResetUnitAnimation(caster)
    endif     
    
  //Null Variables
    set caster = null
    call RemoveLocation(point)
    set point = null 
endfunction

function FW_Cast takes nothing returns nothing
  //Local Variables
    local timer t = CreateTimer()
    local unit caster = GetTriggerUnit()
            
  //Set Variables
    call SetHandleHandle(t, "caster", caster)
       
  //Functions
    call SetUnitAnimation(caster, "attack")
    call PauseUnit(caster, true)
    call TimerStart(t, 0.05, true, function FW)
    call TriggerSleepAction(2.0)
    call FlushHandleLocals(t)
    call DestroyTimer(t)
    
  //Null Variables
    set t = null
    set caster = null
endfunction
    
//===========================================================================
function InitTrig_Flamewalk takes nothing returns nothing
local integer i
    set gg_trg_Flamewalk = CreateTrigger(  )
    loop
    exitwhen i>12
      call TriggerRegisterPlayerUnitEventSimple(gg_trg_Flamewalk, Player(i), EVENT_PLAYER_UNIT_SPELL_EFFECT)
      set i=i+1
    endloop
    call TriggerAddCondition( gg_trg_Flamewalk, Condition(function FW_Check))
    call TriggerAddAction( gg_trg_Flamewalk, function FW_Cast )
endfunction


Here's the current script. It still doesn't work. It's crashing.
 

Waaaaagh

I lost all my rep and my title being a jerk
Reaction score
70
If NewGen is crashing on you, I can't even begin to imagine what your problem is...
 

Waaaaagh

I lost all my rep and my title being a jerk
Reaction score
70
... Just make sure it is installed in the folder that NewGen comes with. Just follow the instructions really....


EDIT: nvm. I just save, cause NewGen has never crashed on me, and it does a good job of finding the errors.
 

elmstfreddie

The Finglonger
Reaction score
203
JASS:
call TriggerAddAction( gg_trg_Flamewalk, function FW_Cast )


JASS:
function FW_Cast takes nothing returns nothing
  //Local Variables
    local timer t = CreateTimer()
    local unit caster = <b>GetTriggerUnit()</b>
            
  //Set Variables
    call SetHandleHandle(t, &quot;caster&quot;, caster)
       
  //Functions
    call SetUnitAnimation(caster, &quot;attack)
    call PauseUnit(caster, true)
    call TimerStart(t, 0.05, true, function FW)
    call TriggerSleepAction(2.0)
    call FlushHandleLocals(t)
    call DestroyTimer(t)
    
  //Null Variables
    set t = null
    set caster = null
endfunction
    
<b>endfunction</b>


Explain to me how that is supposed to work :p

(I intended to bold foney things but that didn't work o_O)
 

WarLuvr3393

Hmmm...too many things to play (WoW, COD4, WC3)
Reaction score
54
Check up the posts a little more, I posted the updated the version of my script. Please check that out.
 

substance

New Member
Reaction score
34
Here ya go :

JASS:
globals
 constant integer FW_Rawcode = &#039;A002&#039;
endglobals

function FW_Check takes nothing returns boolean
 return GetSpellAbilityId() == FW_Rawcode
endfunction

function FW takes nothing returns nothing
 local timer t = GetExpiredTimer()
 local unit caster = GetHandleUnit(t, &quot;caster&quot;)
 local location target = GetSpellTargetLoc()
 local real x = GetUnitX(caster)
 local real y = GetUnitY(caster)
 local real x2 = GetLocationX(target)
 local real y2 = GetLocationY(target)
 local real angle = 3.14159/180.0 * Atan2(y2 - y, x2 - x)
 local real distance = SquareRoot((x2 - x) * (x2 - x) + (y2 - y) * (y2 - y))

    if distance != 0 then
       call SetUnitPosition(caster, x + 30.0 * Cos(angle * 3.14159/180.0), y + 10.0 * Sin(angle * 3.14159/180.0))
    else
       call PauseUnit(caster, false)
       call ResetUnitAnimation(caster)
    endif     
    
    set caster = null
    call RemoveLocation(target)
    set target = null
//  set t = null **I dont know if you would have to set t to null here...   
endfunction

function FW_Cast takes nothing returns nothing
 local timer t = CreateTimer()
 local unit caster = GetTriggerUnit()
            
    call SetHandleHandle(t, &quot;caster&quot;, caster)       
    call SetUnitAnimation(caster, &quot;attack&quot;)
    call PauseUnit(caster, true)
    call TimerStart(t, 0.05, true, function FW)
    call TriggerSleepAction(2.0)
    call FlushHandleLocals(t)
    call DestroyTimer(t)
    
    set t = null
    set caster = null
endfunction
    
//===========================================================================
function InitTrig_Flamewalk takes nothing returns nothing
 local integer i = 0
 
    set gg_trg_Flamewalk = CreateTrigger()
    loop
       exitwhen i&gt;12
       call TriggerRegisterPlayerUnitEventSimple(gg_trg_Flamewalk, Player(i), EVENT_PLAYER_UNIT_SPELL_EFFECT)
       set i=i+1
    endloop
    call TriggerAddCondition( gg_trg_Flamewalk, Condition(function FW_Check))
    call TriggerAddAction( gg_trg_Flamewalk, function FW_Cast )
endfunction


Should work.
 

substance

New Member
Reaction score
34
I'm getting: "Expected End of Line" in many places. :p

If you're using the JASS NEWGEN PACK it should compile fine, I just tested it. If you dont wanna use it then just go back to using constant function for getting the abilityID and it'll work in regular WE too.
 

WarLuvr3393

Hmmm...too many things to play (WoW, COD4, WC3)
Reaction score
54
OMG! This JASS stuff is really starting to make me quit........ugh........whenever I try to load this up on NewGen, it gives me an error and when warcraft iii opens, it goes to the main menu.

What's the best way to learn JASS? This is getting annoying.
 

substance

New Member
Reaction score
34
OMG! This JASS stuff is really starting to make me quit........ugh........whenever I try to load this up on NewGen, it gives me an error and when warcraft iii opens, it goes to the main menu.

What's the best way to learn JASS? This is getting annoying.

Haha, you better get on those tutorials! Lucky for you there are a TON on these forums. I would suggest the GUI to JASS tutorials to get started.
 

Sooda

Diversity enchants
Reaction score
318
In post #23 uncheck mark from "Disable vJASS Syntax". That should enable vJASS syntax check. When you go into main menu while testing your map in New Gen then it means there are syntax errors (What means vJASS syntax check didn' t ran at all. I have encountered same problem many time. Usually helps to save map twice. Then with other save syntax check kicks in.).
Right now it seems that your vJASS syntax check is disabled and you have to uncheck that mark to enable it.
 

emjlr3

Change can be a good thing
Reaction score
395
ever heard of my Dash tutorial???

yea...search it up
 

WarLuvr3393

Hmmm...too many things to play (WoW, COD4, WC3)
Reaction score
54
Eh, but you used the caster system and it's so hard to understand it with your "Table" stuff.
 

emjlr3

Change can be a good thing
Reaction score
395
i didnt use the caster system, i used a cache system, which is required for it to work well and MUI, until vJASS came along
 
General chit-chat
Help Users
  • No one is chatting at the moment.
  • 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 The Helper:
    Happy Thursday!
    +1
  • Varine Varine:
    Crazy how much 3d printing has come in the last few years. Sad that it's not as easily modifiable though
  • Varine Varine:
    I bought an Ender 3 during the pandemic and tinkered with it all the time. Just bought a Sovol, not as easy. I'm trying to make it use a different nozzle because I have a fuck ton of Volcanos, and they use what is basically a modified volcano that is just a smidge longer, and almost every part on this thing needs to be redone to make it work
  • Varine Varine:
    Luckily I have a 3d printer for that, I guess. But it's ridiculous. The regular volcanos are 21mm, these Sovol versions are about 23.5mm
  • Varine Varine:
    So, 2.5mm longer. But the thing that measures the bed is about 1.5mm above the nozzle, so if I swap it with a volcano then I'm 1mm behind it. So cool, new bracket to swap that, but THEN the fan shroud to direct air at the part is ALSO going to be .5mm to low, and so I need to redo that, but by doing that it is a little bit off where it should be blowing and it's throwing it at the heating block instead of the part, and fuck man
  • Varine Varine:
    I didn't realize they designed this entire thing to NOT be modded. I would have just got a fucking Bambu if I knew that, the whole point was I could fuck with this. And no one else makes shit for Sovol so I have to go through them, and they have... interesting pricing models. So I have a new extruder altogether that I'm taking apart and going to just design a whole new one to use my nozzles. Dumb design.
  • Varine Varine:
    Can't just buy a new heatblock, you need to get a whole hotend - so block, heater cartridge, thermistor, heatbreak, and nozzle. And they put this fucking paste in there so I can't take the thermistor or cartridge out with any ease, that's 30 dollars. Or you can get the whole extrudor with the direct driver AND that heatblock for like 50, but you still can't get any of it to come apart
  • Varine Varine:
    Partsbuilt has individual parts I found but they're expensive. I think I can get bits swapped around and make this work with generic shit though
  • Ghan Ghan:
    Heard Houston got hit pretty bad by storms last night. Hope all is well with TH.
  • The Helper The Helper:
    Power back on finally - all is good here no damage
    +2
  • V-SNES V-SNES:
    Happy Friday!
    +1

      The Helper Discord

      Members online

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials

      Network Sponsors

      Apex Steel Pipe - Buys and sells Steel Pipe.
      Top