[Solved]Game is bugged with new patch(structs ?)
I i am a new jasser after few test i saw new patch make my strutcs unable to be in map..... those librairy were really usefull for me is there any way to fix it??
i got 2 structs i mainly use isnt there any way to fix or at least a system that could replace them ..........
+rep will be give + credits in my map project Called ''Naruto tribute''
EDIT : PROBLEM IS FIX its wasnt structs it was an indexing problem.... somehow special effect cant be index now @_@, we can close topics i juast hope poeple will fix it in jngp
i use Newjassgen 1.5d i updated it with files gave by ''dr.supergood'' on topics
SYSTEM DOT(Damage OverTime)
I i am a new jasser after few test i saw new patch make my strutcs unable to be in map..... those librairy were really usefull for me is there any way to fix it??
i got 2 structs i mainly use isnt there any way to fix or at least a system that could replace them ..........
+rep will be give + credits in my map project Called ''Naruto tribute''
EDIT : PROBLEM IS FIX its wasnt structs it was an indexing problem.... somehow special effect cant be index now @_@, we can close topics i juast hope poeple will fix it in jngp
i use Newjassgen 1.5d i updated it with files gave by ''dr.supergood'' on topics
JASS:
//SYSTEM FOT(Fading OverTime)
library FOT initializer Init
private keyword Data
globals
private timer tim
private constant real interval = 0.05
private Data array dat
private integer total = 0
endglobals
private function Loop takes nothing returns nothing
local Data d
local integer i = 0
local integer i2 = R2I( 100. * I2R( 255 ) * 0.01 )
loop
exitwhen i >= total
set d = dat[i]
set d.fadecheck = d.fadecheck - d.fade
if d.fadecheck > 0. then
call SetUnitVertexColor( d.faded, i2, i2, i2, R2I( d.fadecheck * I2R( 255 ) * 0.01 ) )
else
call RemoveUnit( d.faded )
set d.faded = null
call d.destroy( )
set total = total - 1
set dat[i] = dat[total]
endif
set i = i + 1
endloop
if total == 0 then
call PauseTimer( tim )
endif
endfunction
private struct Data
unit faded
real duration
real fade
real fadecheck
static method Create takes unit faded, real duration returns nothing
local Data d = Data.allocate( )
set d.faded = faded
set d.fade = 100. / duration * interval
set d.fadecheck = 100.
if total == 0 then
call TimerStart( tim, interval, true, function Loop )
endif
set dat[total] = d
set total = total + 1
endmethod
endstruct
function Fade takes unit faded, real duration returns nothing
call Data.Create( faded, duration )
endfunction
private function Init takes nothing returns nothing
set tim = CreateTimer( )
endfunction
endlibrary
SYSTEM DOT(Damage OverTime)
JASS:
library DOT initializer Init
//DOT system current version 1.2 - Personally updated by Wizardum
private keyword Data
globals
private constant real interval = 0.05
private timer tim
private Data array dat
private integer total = 0
group DOTunits
endglobals
private function Loop takes nothing returns nothing
local Data d
local integer i = 0
local real array r
loop
exitwhen i >= total
set d = dat[i]
set r[1] = d.dmg * d.dur
set r[2] = d.heal * d.dur
set r[3] = GetWidgetLife( d.target )
if r[3] < 0.405 then
set d.dmgcount = r[1]
set d.healcount = r[2]
endif
set d.counter = d.counter + interval
if d.counter >= d.icheck then
set d.counter = 0.
if d.dmgcount < r[1] or d.healcount < r[2] then
set d.dmgcount = d.dmgcount + d.dmg
set d.healcount = d.healcount + d.heal
call SetWidgetLife( d.target, GetWidgetLife( d.target) + d.heal )
call UnitDamageTarget( d.source, d.target, d.dmg, true, false, ATTACK_TYPE_NORMAL, DAMAGE_TYPE_NORMAL, null )
call DestroyEffect( AddSpecialEffectTarget( d.insEffect, d.target, d.attach ) )
else
call DestroyEffect( d.effectOT )
call GroupRemoveUnit( DOTunits, d.target )
set d.effectOT = null
set d.source = null
set d.target = null
call d.destroy( )
set total = total - 1
set dat[i] = dat[total]
endif
endif
set i = i + 1
endloop
if total == 0 then
call PauseTimer( tim )
endif
endfunction
private struct Data
unit source
unit target
real dmg
real heal
real dur
real icheck
string insEffect
effect effectOT
string attach
real counter
real dmgcount
real healcount
static method Create takes unit source, unit target, real dmg, real heal, real dur, real icheck, string insEffect, effect effectOT, string attach returns nothing
local Data d = Data.allocate( )
set d.source = source
set d.target = target
set d.dmg = dmg / dur / icheck
set d.heal = heal / dur / icheck
set d.dur = dur
set d.icheck = icheck
set d.insEffect = insEffect
set d.effectOT = effectOT
if attach == "" then
set d.attach = "chest"
else
set d.attach = attach
endif
set d.counter = 0.
set d.dmgcount = 0.
set d.healcount = 0.
call GroupAddUnit( DOTunits, d.target )
if total == 0 then
call TimerStart( tim, interval, true, function Loop )
endif
set dat[total] = d
set total = total + 1
endmethod
endstruct
function DamageAttach takes unit source, unit target, real totaldmg, real duration, real intervalcheck, string insEffect, string effectOT, string attach returns nothing
local effect e
if not IsUnitInGroup( target, DOTunits ) then
set e = AddSpecialEffectTarget( effectOT, target, attach )
call Data.Create( source, target, totaldmg, 0., duration, intervalcheck, insEffect, e, attach )
set e = null
endif
endfunction
function HealAttach takes unit target, real totalheal, real duration, real intervalcheck, string insEffect, string effectOT, string attach returns nothing
local effect e
if not IsUnitInGroup( target, DOTunits ) then
set e = AddSpecialEffectTarget( effectOT, target, attach )
call Data.Create( null, target, 0., totalheal, duration, intervalcheck, insEffect, e, attach )
set e = null
endif
endfunction
private function Init takes nothing returns nothing
set tim = CreateTimer( )
set DOTunits = CreateGroup( )
endfunction
endlibrary
Last edited: