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.
 

SFilip

Gone but not forgotten
Reaction score
634
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
 
5

56k Fanatic

Guest
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?
 
5

56k Fanatic

Guest
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.
 

Vexorian

Why no custom sig?
Reaction score
187
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.
 
5

56k Fanatic

Guest
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
 

AceHart

Your Friendly Neighborhood Admin
Reaction score
1,495
> 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...
 
5

56k Fanatic

Guest
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?
 

AceHart

Your Friendly Neighborhood Admin
Reaction score
1,495
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.
 
5

56k Fanatic

Guest
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 :)
 
5

56k Fanatic

Guest
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
 
5

56k Fanatic

Guest
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 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