Little Help with JASS

5

56k Fanatic

Guest
Can someone help me understand JASS? just translate what the words do like "takes nothing returns nothing" etc., Its kinda hard to learn if you don't know what they do.
 
takes nothing means that the function needs no parameters.
example of a function that takes nothing:
Code:
function DoNothing takes nothing returns nothing
endfunction
you will call it
Code:
call DoNothing()
notice that there is nothing between ( ).

returns nothing means that the function can't return a value.
example
Code:
local integer = DoNothing()
will not work. this only works if the function "returns integer". the "returns nothing" function can only be called using call <func>.

anyway i suggest that you read this:
http://world-editor-tutorials.thehelper.net/jassintro.php
 
I just can't seem to understand most of it. I read Daelin's tut, it helped me alot. Can't get my spell to work though. Spell goes like this:

I based it from Thunder Clap bec. my hero already has a war stomp based spell.
After I start the effect the trigger creates a dummy unit which casts a shockwave in all directions.Can't get it to cast shockwave in 8 directions at once. What do I do?

1 more thing, how do i create multiple units in a straight line at once? Like fissure, cos it creates the fissure unit dummy.And how do i make shockwaves shoot out from my hero in all directions at THE SAME time like shadow fiend's requiem of souls?
 
I know integers and string already. What I want to know is how I create units and move them to the direction they're facing and damage units it comes across with. Sorry for being impatient im only 13.
 
Re:

You can't learn algebra before learning arithmetic you know, you were having problems with the syntax of function declaration which is explained in my tutorial.
 
Hmm, I know the syntax of function declaration already. Its function <function name> takes nothing returns nothing. Maybe you could help me figure out how Ravage makes a dummy unit cast impale in all directions? Tell me which line tells the dummy to cast impale on all directions. Here is the code :
// A03Z = Ravage
function Trig_Tidehunter_Spell_Ravage_Conditions takes nothing returns boolean
if(not (GetSpellAbilityId()=='A03Z'))then
return false
endif
return true
endfunction

// e00E = Spellcaster
// A084 = Ravage 1
// A03Z = Ravage
function Trig_Tidehunter_Spell_Ravage_Actions takes nothing returns nothing
local location fww=GetUnitLoc(GetTriggerUnit())
local location fWW
set bj_forLoopAIndex=1
set bj_forLoopAIndexEnd=16
loop
exitwhen bj_forLoopAIndex>bj_forLoopAIndexEnd
call CreateNUnitsAtLoc(1,'e00E',GetOwningPlayer(GetTriggerUnit()),fww,bj_UNIT_FACING)
call UnitAddAbility(bj_lastCreatedUnit,'A084')
call SetUnitAbilityLevelSwapped('A084',bj_lastCreatedUnit,GetUnitAbilityLevelSwapped('A03Z',GetTriggerUnit()))
set fWW=PolarProjectionBJ(fww,100.,(22.5*I2R(bj_forLoopAIndex)))
call IssuePointOrderByIdLoc(bj_lastCreatedUnit,OrderId("impale"),fWW)
call RemoveLocation(fWW)
set bj_forLoopAIndex=bj_forLoopAIndex+1
endloop
call RemoveLocation(fww)
endfunction

function StartTrigger_Tidehunter_Spell_Ravage takes nothing returns nothing
set gg_trg_Tidehunter_Spell_Ravage=CreateTrigger()
call TriggerRegisterAnyUnitEventBJ(gg_trg_Tidehunter_Spell_Ravage,EVENT_PLAYER_UNIT_SPELL_EFFECT)
call TriggerAddCondition(gg_trg_Tidehunter_Spell_Ravage,Condition(function Trig_Tidehunter_Spell_Ravage_Conditions))
call TriggerAddAction(gg_trg_Tidehunter_Spell_Ravage,function Trig_Tidehunter_Spell_Ravage_Actions)
endfunction

function InitTrig_Tidehunter_Spell_Ravage takes nothing returns nothing
endfunction

Got it from OpenDotA 6.32b
 
> call CreateNUnitsAtLoc(1,'e00E',GetOwningPlayer(GetTriggerUnit()),fww,bj_UN IT_FACING)

Create a dummy.

> call UnitAddAbility(bj_lastCreatedUnit,'A084')

Give it "impale".

> call SetUnitAbilityLevelSwapped('A084',bj_lastCreatedUnit,GetUnitAbilityLev elSwapped('A03Z',GetTriggerUnit()))

At the same level as the Hero's ability.

> set fWW=PolarProjectionBJ(fww,100.,(22.5*I2R(bj_forLoopAIndex)))

This is the direction.

> call IssuePointOrderByIdLoc(bj_lastCreatedUnit,OrderId("impale"),fWW)

And the order.

All looped 16 times.


And there's a lot of improvements possible here...
 
Thanks!!! really needed to find that out, now i just have to test it :D . But ummm, how do i change Ravage to other skills? Do i create a new trigger and copy the rawcode of my ability and replace ravage and its rawcode?
 
Well, the trigger you posted is waiting for the Hero to cast 'A03Z'.
And the dummy is using 'A084'.

I would guess your map doesn't have those anyway... so, put in your own.

Also, the dummies aren't on timed life. So I guess they have a negative health regeneration.
 
Whoops sorry, I solved the problem 10 minutes ago. Sorry :(
The problem was it didnt create the units. :p Problem Solved! Thanks again for helping!! <3
Now I am actually LEARNING something NEW :)
 
corvusHaunt said:
Hahaha.

I'll put money on it that he still didn't change the ability Id's.

Lol forgot to change the dummy's rawcode lmao
 
What double post?

BTW, Ace I need your help AGAIN :( the dummy should cast the shockwave in all directions but looks like it doesn't shoot shockwaves around 270-315 degrees. is there a way to fix this
 
General chit-chat
Help Users
  • No one is chatting at the moment.
  • The Helper The Helper:
    News portal has been retired. Main page of site goes to Headline News forum now
  • The Helper The Helper:
    I am working on getting access to the old news portal under a different URL for those that would rather use that for news before we get a different news view.
  • Ghan Ghan:
    Easily done
    +1
  • The Helper The Helper:
    https://www.thehelper.net/pages/news/ is a link to the old news portal - i will integrate it into the interface somewhere when i figure it out
  • Ghan Ghan:
    Need to try something
  • Ghan Ghan:
    Hopefully this won't cause problems.
  • Ghan Ghan:
    Hmm
  • Ghan Ghan:
    I have converted the Headline News forum to an Article type forum. It will now show the top 20 threads with more detail of each thread.
  • Ghan Ghan:
    See how we like that.
  • The Helper The Helper:
    I do not see a way to go past the 1st page of posts on the forum though
  • The Helper The Helper:
    It is OK though for the main page to open up on the forum in the view it was before. As long as the portal has its own URL so it can be viewed that way I do want to try it as a regular forum view for a while
  • Ghan Ghan:
    Yeah I'm not sure what the deal is with the pagination.
  • Ghan Ghan:
    It SHOULD be there so I think it might just be an artifact of having an older style.
  • Ghan Ghan:
    I switched it to a "Standard" article forum. This will show the thread list like normal, but the threads themselves will have the first post set up above the rest of the "comments"
  • The Helper The Helper:
    I don't really get that article forum but I think it is because I have never really seen it used on a multi post thread
  • Ghan Ghan:
    RpNation makes more use of it right now as an example: https://www.rpnation.com/news/
  • The Helper The Helper:
  • The Helper The Helper:
    What do you think Tom?
  • tom_mai78101 tom_mai78101:
    I will have to get used to this.
  • tom_mai78101 tom_mai78101:
    The latest news feed looks good
  • The Helper The Helper:
    I would like to see it again like Ghan had it the first time with pagination though - without the pagination that view will not work but with pagination it just might...
  • The Helper The Helper:
    This drink recipe I have had more than a few times back in the day! Mind Eraser https://www.thehelper.net/threads/cocktail-mind-eraser.194720/

      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