maksud dia, cman dari attack, jadi gak semua damage, gw mau juga dunk..
maksud dia, cman dari attack, jadi gak semua damage, gw mau juga dunk..
Mau buat hero??
TwinkleCraft - Grand Schism
The New Division of AoS and Hero Craftings
http://twinklecraft.6.forumer.com
ganti aja
EVENT_UNIT_DAMAGED
sama
EVENT_UNIT_ATTACKED
( ini ya gw lupa mana eventnya )
btr gw liat lg
intinya sih ganti damage ma attack
Ok gw ada code utk bikin skill mass shackles dari aerial shackles biasa dan bersifat channeling. Code terlampir di bawah dalam bentuk JASS
Ok masalah terjadi ketika gw test spell tersebut, spell tersebut jalan dengan benar, masalah muncul pada waktu selesai casting maka langsung fatal error...Code:constant function MS_SID takes nothing returns integer return 'A03W' endfunction constant function MS_OS takes nothing returns string return "monsoon" endfunction constant function MS_DID takes nothing returns integer return 'h01J' endfunction constant function MS_DSID takes nothing returns integer return 'A051' endfunction constant function MS_DOS takes nothing returns string return "magicleash" endfunction function MSS_C takes nothing returns boolean return GetSpellAbilityId() == MS_SID() endfunction function MSS_Filter takes nothing returns boolean if ( not ( IsUnitType(GetFilterUnit(), UNIT_TYPE_STRUCTURE) == false ) ) then return false endif if ( not ( IsUnitAliveBJ(GetFilterUnit()) == true ) ) then return false endif if ( not ( IsUnitDeadBJ(GetFilterUnit()) == false ) ) then return false endif if ( not ( IsUnitEnemy(GetFilterUnit(), GetOwningPlayer(GetTriggerUnit())) == true ) ) then return false endif if ( not ( UnitHasBuffBJ(GetTriggerUnit(), 'B02C') == false ) ) then return false endif if ( not ( GetUnitAbilityLevelSwapped('A09Z', GetFilterUnit()) == 0 ) ) then return false endif return true endfunction function MSS_A takes nothing returns nothing local unit MSS_Dummy local unit MSS_Target local unit MSS_Caster = GetTriggerUnit() local group MSS_Group = CreateGroup() local group MSS_Group2 = CreateGroup() local location MSS_Loc = GetSpellTargetLoc() local integer MSS_Lv = GetUnitAbilityLevel(MSS_Caster,MS_SID()) local real MSS_Range = 100.00 + ( 50.00 * I2R(MSS_Lv)) local player MSS_Player = GetOwningPlayer(MSS_Caster) loop exitwhen OrderId2String(GetUnitCurrentOrder(MSS_Caster)) != MS_OS() call DestroyEffect(AddSpecialEffectTargetUnitBJ( "origin", MSS_Caster, "Abilities\\Spells\\Orc\\AncestralSpirit\\AncestralSpiritCaster.mdl" ) ) call GroupEnumUnitsInRangeOfLoc(MSS_Group, MSS_Loc, MSS_Range, Condition(function MSS_Filter)) loop set MSS_Target = FirstOfGroup(MSS_Group) exitwhen MSS_Target == null set MSS_Dummy = CreateUnit(MSS_Player,MS_DID(),GetUnitX(MSS_Caster),GetUnitY(MSS_Caster),0) call UnitAddAbility(MSS_Dummy,MS_DSID()) call SetUnitAbilityLevel(MSS_Dummy,MS_DSID(),MSS_Lv) call IssueTargetOrder(MSS_Dummy,MS_DOS(),MSS_Target) call GroupAddUnit(MSS_Group2,MSS_Dummy) call GroupRemoveUnit(MSS_Group,MSS_Target) endloop call GroupClear(MSS_Group) call TriggerSleepAction(0.5) endloop loop set MSS_Dummy = FirstOfGroup(MSS_Group2) exitwhen MSS_Dummy == null call IssueImmediateOrderById(MSS_Dummy,OrderId("stop")) call KillUnit(MSS_Dummy) call GroupRemoveUnit(MSS_Group2,MSS_Dummy) call RemoveUnit(MSS_Dummy) endloop call RemoveLocation(MSS_Loc) call DestroyGroup(MSS_Group) call DestroyGroup(MSS_Group2) set MSS_Dummy = null set MSS_Target = null set MSS_Caster = null set MSS_Group = null set MSS_Group2 = null set MSS_Player = null set MSS_Loc = null endfunction function Mass_Shackles_Start takes nothing returns nothing local trigger MSS = CreateTrigger() call TriggerRegisterAnyUnitEventBJ( MSS, EVENT_PLAYER_UNIT_SPELL_EFFECT ) call TriggerAddCondition( MSS, Condition( function MSS_C ) ) call TriggerAddAction( MSS, function MSS_A ) endfunction function InitTrig_Mass_Shackles takes nothing returns nothing endfunction
Ada yang bisa bantu kenapa masalah bisa muncul?
Infinite loop error. Struktur fungsi nya diganti aja, gk perlu pake doble loop.loop
set MSS_Target = FirstOfGroup(MSS_Group)
exitwhen MSS_Target == null
set MSS_Dummy = CreateUnit(MSS_Player,MS_DID(),GetUnitX(MSS_Caster ),GetUnitY(MSS_Caster),0)
call UnitAddAbility(MSS_Dummy,MS_DSID())
call SetUnitAbilityLevel(MSS_Dummy,MS_DSID(),MSS_Lv)
call IssueTargetOrder(MSS_Dummy,MS_DOS(),MSS_Target)
call GroupAddUnit(MSS_Group2,MSS_Dummy)
call GroupRemoveUnit(MSS_Group,MSS_Target)
endloop
idem sama doos diatas
sekalian ganti
samaCode:function MSS_Filter takes nothing returns boolean if ( not ( IsUnitType(GetFilterUnit(), UNIT_TYPE_STRUCTURE) == false ) ) then return false endif if ( not ( IsUnitAliveBJ(GetFilterUnit()) == true ) ) then return false endif if ( not ( IsUnitDeadBJ(GetFilterUnit()) == false ) ) then return false endif if ( not ( IsUnitEnemy(GetFilterUnit(), GetOwningPlayer(GetTriggerUnit())) == true ) ) then return false endif if ( not ( UnitHasBuffBJ(GetTriggerUnit(), 'B02C') == false ) ) then return false endif if ( not ( GetUnitAbilityLevelSwapped('A09Z', GetFilterUnit()) == 0 ) ) then return false endif return true endfunction
biar ga panjang kebawahCode:function MSS_Filter takes nothing returns boolean return IsUnitType(GetFilterUnit(), UNIT_TYPE_STRUCTURE) == false and IsUnitAliveBJ(GetFilterUnit()) == true and IsUnitEnemy(GetFilterUnit(), GetOwningPlayer(GetTriggerUnit())) == true and UnitHasBuffBJ(GetTriggerUnit(), 'B02C') == false and GetUnitAbilityLevelSwapped('A09Z', GetFilterUnit()) == 0 endfunction
Ini sebetulnya tidak perlu, dan loop tersebut menyebabkan infinite loop dimana akan membuat Warcraft III jadi fatal error.loop
set MSS_Target = FirstOfGroup(MSS_Group)
exitwhen MSS_Target == null
set MSS_Dummy = CreateUnit(MSS_Player,MS_DID(),GetUnitX(MSS_Caster ),GetUnitY(MSS_Caster),0)
call UnitAddAbility(MSS_Dummy,MS_DSID())
call SetUnitAbilityLevel(MSS_Dummy,MS_DSID(),MSS_Lv)
call IssueTargetOrder(MSS_Dummy,MS_DOS(),MSS_Target)
call GroupAddUnit(MSS_Group2,MSS_Dummy)
call GroupRemoveUnit(MSS_Group,MSS_Target)
endloop
exitwhen MSS_Target == null
MSS_Target selalu == null, sebaiknya
loop itu nggak infinite doos, liat di awal loop udah ditentukan bahwa
MSS_Target = FirstofGroup(MSS_Group)
Sistem loop itu sistem utk damage group dalam 1 fungsi yg sama, nggak pake fungsi yang berbeda pada umumnya.
disini nggak masalah doos, kalo lu bikin triggernya, jalan sampe sini dah bener.
Masalah timbul disini, ntah kenapa sewaktu diperintahkan untuk remove dummy unit di group ini dari map tiba2 fatal error. Gw dah coba pake sistem pick grup biasa dengan pake fungsi laen tapi jg tetep error.Code:loop set MSS_Dummy = FirstOfGroup(MSS_Group2) exitwhen MSS_Dummy == null call IssueImmediateOrderById(MSS_Dummy,OrderId("stop")) call KillUnit(MSS_Dummy) call GroupRemoveUnit(MSS_Group2,MSS_Dummy) call RemoveUnit(MSS_Dummy) endloop
Weq... makin sulit dah...
Yah JASS master Rizzuh ama saya sendiri ngelihat itu loop ada infinite loop error. Kalo RemoveUnit(MSS_Dummy) itu gk mungkin error. Coba rizz lu kan lebih jago dr gua menurut lu error nya dmn? Gua sih lihatnya diInfiinte Loop, loop tidak pernah akan exit karena MSS_Dummy tidak pernah == null.loop
set MSS_Dummy = FirstOfGroup(MSS_Group2)
exitwhen MSS_Dummy == null
call IssueImmediateOrderById(MSS_Dummy,OrderId("stop"))
call KillUnit(MSS_Dummy)
call GroupRemoveUnit(MSS_Group2,MSS_Dummy)
call RemoveUnit(MSS_Dummy)
endloop
baiknyaCode:loop exitwhen OrderId2String(GetUnitCurrentOrder(MSS_Caster)) != MS_OS() call DestroyEffect(AddSpecialEffectTargetUnitBJ( "origin", MSS_Caster, "Abilities\\Spells\\Orc\\AncestralSpirit\\AncestralSpiritCaster.mdl" ) ) call GroupEnumUnitsInRangeOfLoc(MSS_Group, MSS_Loc, MSS_Range, Condition(function MSS_Filter)) loop set MSS_Target = FirstOfGroup(MSS_Group) exitwhen MSS_Target == null set MSS_Dummy = CreateUnit(MSS_Player,MS_DID(),GetUnitX(MSS_Caster),GetUnitY(MSS_Caster),0) call UnitAddAbility(MSS_Dummy,MS_DSID()) call SetUnitAbilityLevel(MSS_Dummy,MS_DSID(),MSS_Lv) call IssueTargetOrder(MSS_Dummy,MS_DOS(),MSS_Target) call GroupAddUnit(MSS_Group2,MSS_Dummy) call GroupRemoveUnit(MSS_Group,MSS_Target) endloop call GroupClear(MSS_Group) call TriggerSleepAction(0.5) endloop
exitwhen IsUnitGroupEmptyBJ(MSS_Group) == true
yg iniCode:loop set MSS_Dummy = FirstOfGroup(MSS_Group2) exitwhen MSS_Dummy == null call IssueImmediateOrderById(MSS_Dummy,OrderId("stop")) call KillUnit(MSS_Dummy) call GroupRemoveUnit(MSS_Group2,MSS_Dummy) call RemoveUnit(MSS_Dummy) endloop
exitwhen IsUnitGroupEmptyBJ(MSS_Group2) == true
Mau buat hero??
TwinkleCraft - Grand Schism
The New Division of AoS and Hero Craftings
http://twinklecraft.6.forumer.com
Justru MSS_Dummy itu akan null, karena kalo lu liat:
Berfungsi menaruh semua unit MSS_Dummy yang dibuat di loop pertama ke dalam grup MSS_Group2 sejumlah loop yang terjadi. Dimana jumlah loop terjadi sesuai dengan jumlah unit yang di pick melalui fungsi:Code:call GroupAddUnit(MSS_Group2,MSS_Dummy)
Code:call GroupEnumUnitsInRangeOfLoc(MSS_Group, MSS_Loc, MSS_Range, Condition(function MSS_Filter))Berfungsi sebagai menentukan kembali bahwa MSS_Dummy adalah unit pertama yang ada di dalam grup MSS_Group2.Code:set MSS_Dummy = FirstOfGroup(MSS_Group2)
Yang ini ngebuang MSS_Dummy yang di pick dengan code di atas dari grup sehingga jumlah unit yang di dalam grup berkurang.Code:call GroupRemoveUnit(MSS_Group2,MSS_Dummy)
Yang mana nantinya ketika loop, seharusnya MSS_Dummy adalah unit lain yang berada di dalam grup MSS_Group2
Begitu seterusnya.....
@Lambhe.
Dah gw coba pake gituan juga masih fatal error. Lagian pake fungsi seperti lebih punya map leak.
call RemoveUnit(MSS_Dummy)
endloop
coba lu debug gini di loopnya
call BJDebugMsg I2S(CountUnitsInGroup(MSS_Group2))
kl sampe 0 artinya null tapi kl ga artinya infinite loop
cobain aja di debug dulu, buat cek masalah loopnya
cobain jg buat loop lainnya buat cek exitwhennya ke execute atau ngga
abis kl gw perhatiin emang ky ga ada masalah, jadi kynya emang harus di debug dl
meskipun gw optimis kynya gara gara ini
anyway dari yg sering gw baca sebaiknya ga ada sleepaction di loopexitwhen OrderId2String(GetUnitCurrentOrder(MSS_Caster)) != MS_OS()
Last edited by rizzuh; 15-04-08 at 14:13.
Di debug digimanain? tinggal taruh aja di salah 1 fungsi?
Yang :
Salah dimananya emang? Mustinya sih ok2 aja, sebagian spell channeling gw gw pake code sejenis, dan lancar2 aja sih ga ada masalah. Cuman kebanaykan ga pake variable, langsung order yang dipakai sih...Code:exitwhen OrderId2String(GetUnitCurrentOrder(MSS_Caster)) != MS_OS()
soal sleepaction itu emang salah mustinya pakeItu belom sempet gw benerin.Code:call polledwait
ky gini
liat hasilnya jadi 0 apa ngga, kl iya artinya loop itu beres, dah gitu coba debug loop yang lainCode:loop exitwhen OrderId2String(GetUnitCurrentOrder(MSS_Caster)) != MS_OS() call DestroyEffect(AddSpecialEffectTargetUnitBJ( "origin", MSS_Caster, "Abilities\\Spells\\Orc\\AncestralSpirit\\AncestralSpiritCaster.mdl" ) ) call GroupEnumUnitsInRangeOfLoc(MSS_Group, MSS_Loc, MSS_Range, Condition(function MSS_Filter)) loop set MSS_Target = FirstOfGroup(MSS_Group) exitwhen MSS_Target == null set MSS_Dummy = CreateUnit(MSS_Player,MS_DID(),GetUnitX(MSS_Caster),GetUnitY(MSS_Caster),0) call UnitAddAbility(MSS_Dummy,MS_DSID()) call SetUnitAbilityLevel(MSS_Dummy,MS_DSID(),MSS_Lv) call IssueTargetOrder(MSS_Dummy,MS_DOS(),MSS_Target) call GroupAddUnit(MSS_Group2,MSS_Dummy) call GroupRemoveUnit(MSS_Group,MSS_Target) call BJDebugMsg(I2S(CountUnitsInGroup(MSS_Group2))) endloop call GroupClear(MSS_Group) call TriggerSleepAction(0.5) endloop
Last edited by rizzuh; 16-04-08 at 23:43.
Kenapa gk pake kondisi IsUnitGroupEmpty ?
Siapa tahu JASS ada kelemahan seperti ini ketika set variable lalu dituduh variable tersebut tak memiliki nilai. (BUG dari JASSnya kali..)
aq sih setuju ama LaMBhE...
Mendingan cari gampangny aja...
Share This Thread