Hello, this is my first "real" post on this website and i have a few questions for you! I am taking a course on C++ and i know a bit of it, so i decided to learn JASS as well... now thing is, i understand how to type it out, to an extent at least. (Loops, functions, calling, etc.) However i am confused about a few things.
A) Why does every variable value or w/e it is have to be declared with parenthisis at the end?
Example:
(or is this just calling a function called "CreateUnit" ?? because if so then many of the tutorials should explain this feature because it seems to me that there're too many functions in them making things too complex for starters.
B) What are the commands of JASS, i'm talking about in example i've seen
now my thing is, isn't calling "call" for calling functions? And is "BJDebugMsg("")" similar to the command "cout << " " << endl; " in c++ imported with iostream.h?
C) What are the commands to make the game do things!!!!!!! All of these example have been taken out of wyrmlords tutorial. Like he said...
was a spell... however how do you actually have the unit move around? it's like me having a "void main() { //calling random things } but not showing the functions being called. Can someone explain to me how to set things up like this?
D) does world editor work w/ c++?? if so is it plausible?
Thank you, i appreciate if you would answer these questions of mine! (i'm very confused about these things )
A) Why does every variable value or w/e it is have to be declared with parenthisis at the end?
Example:
JASS:
function variable_test takes nothing returns nothing
local unit u = CreateUnit()
endfunction
B) What are the commands of JASS, i'm talking about in example i've seen
JASS:
call BJDebugMsg("Hello World")
now my thing is, isn't calling "call" for calling functions? And is "BJDebugMsg("")" similar to the command "cout << " " << endl; " in c++ imported with iostream.h?
C) What are the commands to make the game do things!!!!!!! All of these example have been taken out of wyrmlords tutorial. Like he said...
JASS:
function Slash_Condition takes nothing returns boolean
return GetSpellAbilityId() == 'A000'
endfunction
function Slash_Actions takes nothing returns nothing
local unit caster = GetSpellAbilityUnit()
local location start_position = GetUnitLoc(caster)
local group enemies = CreateGroup()
local unit temp
local integer count = 5
call GroupEnumUnitsInRangeOfLoc(enemies, start_position, 500.0, null)
loop
set temp = FirstOfGroup(enemies)
exitwhen temp == null or count == 0
if IsUnitEnemy(temp, GetOwningPlayer(caster)) then
set temp_loc = GetUnitLoc(temp)
call SetUnitPositionLoc(caster, temp_loc)
call UnitDamageTarget(caster, temp, 50, true, false, ATTACK_TYPE_CHAOS, DAMAGE_TYPE_NORMAL, null)
set count = count - 1
endif
call GroupRemoveUnit(enemies, temp)
endloop
endfunction
function InitTrig_Slash takes nothing returns nothing
set gg_trg_Slash = CreateTrigger()
call TriggerRegisterAnyUnitEventBJ(gg_trg_Slash, EVENT_PLAYER_UNIT_SPELL_EFFECT)
call TriggerAddCondition(gg_trg_Slash, Condition(function Slash_Condition))
call TriggerAddAction(gg_trg_Slash, function Slash_Actions)
endfunction
was a spell... however how do you actually have the unit move around? it's like me having a "void main() { //calling random things } but not showing the functions being called. Can someone explain to me how to set things up like this?
D) does world editor work w/ c++?? if so is it plausible?
Thank you, i appreciate if you would answer these questions of mine! (i'm very confused about these things )
Last edited: