Dinowc
don't expect anything, prepare for everything
- Reaction score
- 223
ok I tried making some stuff in vJass (a mass sleep spell) and got stuck
here's the code:
I started learning Jass 2 days ago so please don't be harsh on me
I saw one tutorial where I should start immediately learning vJass instead of classic ugly Jass
when I try to save the map I get this error message from JassHelper: "Unable to find initializer: Init" with endscope being highlighted
so my first thought is, what...? :nuts:
what does it mean?
EDIT: ok solved.
here's the code:
JASS:
scope MassSleep initializer Init
private function SleepConditions takes nothing returns boolean
return GetSpellAbilityId() == 039;A001039;
endfunction
private function SleepActions takes nothing returns nothing
local unit SleepCaster = GetTriggerUnit()
local location SleepLoc = GetSpellTargetLoc()
local group SleepGroup = GetUnitsInRangeOfLocAll(500.00,SleepLoc)
local unit SleepU
local unit SleepDummy
loop
set SleepU = FirstOfGroup(SleepGroup)
exitwhen SleepU == null
if IsUnitEnemy(SleepU, GetOwningPlayer(SleepCaster)) == true then
set SleepDummy = CreateUnitAtLoc(GetOwningPlayer(SleepCaster), 039;h000039;, GetUnitLoc(SleepU),0.00)
call UnitAddAbility(SleepDummy,039;A002039;)
call IssueTargetOrderById(SleepDummy,039;A002039;,SleepU)
call UnitApplyTimedLifeBJ(0.50, 039;BHwe039;,SleepDummy)
set SleepDummy = null
endif
call GroupRemoveUnit(SleepGroup, SleepU)
set SleepU = null
endloop
set SleepGroup = null
set SleepLoc = null
set SleepCaster = null
endfunction
//=========================================================
private function MassSleep takes nothing returns nothing
local trigger t = CreateTrigger()
call TriggerRegisterAnyUnitEventBJ(t, EVENT_PLAYER_UNIT_SPELL_EFFECT)
call TriggerAddCondition(t, Condition(function SleepConditions))
call TriggerAddAction(t, function SleepActions)
endfunction
endscope
I started learning Jass 2 days ago so please don't be harsh on me
I saw one tutorial where I should start immediately learning vJass instead of classic ugly Jass
when I try to save the map I get this error message from JassHelper: "Unable to find initializer: Init" with endscope being highlighted
so my first thought is, what...? :nuts:
what does it mean?
EDIT: ok solved.