Komaqtion
You can change this now in User CP.
- Reaction score
- 469
Hello
I just saw a post in some thread here about someone wanting to block "damage giving", meaning that nearby heroes shouldn't get experience when the unit dies.
So, I thought I'd use Damage for this, in combination with AIDS (And maybe Event somehow :S XD) so this is what I came up with (So far ):
The there's only one tiny problem here, and that is that any line after [ljass]call Damage_RegisterEvent( t )[/ljass] doesn't run, meaning that that line somehow broke the thread...
So, I haven't actually used J4L's system Damage before (If I remember correctly XD) so I'm not quite sure how to use it, but I thought I got it right
Anyways, anyone can help me fix this little issue I'm having ?
(Also, if I remove that line (The Damage_RegisterEvent one) then there are a ton of AIDS errors in-game when I test it...
I just saw a post in some thread here about someone wanting to block "damage giving", meaning that nearby heroes shouldn't get experience when the unit dies.
So, I thought I'd use Damage for this, in combination with AIDS (And maybe Event somehow :S XD) so this is what I came up with (So far ):
JASS:
library BlockExpGive requires AIDS, Damage, Event
struct ExpData extends array
//! runtextmacro AIDS()
static if DEBUG_MODE then
private static group ENUM
endif
boolean BlockingExp
method AIDS_onCreate takes nothing returns nothing
set BlockingExp = false
endmethod
static method Actions takes nothing returns boolean
local unit u = GetTriggerUnit()
local thistype this = thistype[ u ]
call BJDebugMsg( "Blocked !" )
if BlockingExp and GetEventDamage() >= GetWidgetLife( u ) then
call Damage_Block( GetEventDamage() - GetWidgetLife( u ) - .415 )
call BJDebugMsg( "Blocked !" )
call RemoveUnit( u )
endif
set u = null
return false
endmethod
static if DEBUG_MODE then
private static method Filters takes nothing returns boolean
local unit u = GetFilterUnit()
set thistype( GetUnitIndex( u ) ).BlockingExp = true
call BJDebugMsg( GetUnitName( u ) )
return false
endmethod
endif
private static method AIDS_onInit takes nothing returns nothing
local trigger t = CreateTrigger()
call BJDebugMsg( "Init !" )
call Damage_RegisterEvent( t )
call TriggerAddCondition( t, Condition( function thistype.Actions ) )
call BJDebugMsg( "Registered !" )
static if DEBUG_MODE then
set thistype.ENUM = CreateGroup()
call GroupEnumUnitsInRect( ENUM, bj_mapInitialPlayableArea, Filter( function thistype.Filters ) )
endif
endmethod
endstruct
endlibrary
The there's only one tiny problem here, and that is that any line after [ljass]call Damage_RegisterEvent( t )[/ljass] doesn't run, meaning that that line somehow broke the thread...
So, I haven't actually used J4L's system Damage before (If I remember correctly XD) so I'm not quite sure how to use it, but I thought I got it right
Anyways, anyone can help me fix this little issue I'm having ?
(Also, if I remove that line (The Damage_RegisterEvent one) then there are a ton of AIDS errors in-game when I test it...