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.
  • 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 The Helper:
    New recipe is another summer dessert Berry and Peach Cheesecake - https://www.thehelper.net/threads/recipe-berry-and-peach-cheesecake.194169/

      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