System Status

SanKakU

Member
Reaction score
21
but the spells made by that system will give kills to neutral hostile player instead of to the player who casted a spell that told the dummy to cast his dummy spell, right? that's why i said what i did earlier about it seems to mean it's for creeps' spells.

which actually is a good thing, if that's what it does...because i want to make a bunch of triggered creeps spells. anyway, i think i've perhaps found plenty of spells that although wouldn't fit a hero, would probably fit a creep already.
 

Jesus4Lyf

Good Idea™
Reaction score
397
but the spells made by that system will give kills to neutral hostile player instead of to the player who casted a spell
No. They won't. :)
Damage should be dealt by Damage, and the status effects for WC3 should be applied through Status. BuffStruct is just a convenient way of managing effects which last over a duration, and SpellStruct is for rapid coding of spells. My point with all that is, since the damage is dealt through Damage, and not from a spell cast through the DummyCaster, the kills will always be assigned to the correct unit, even if the status effects are officially from Neutral Hostile, or whoever else. :)

This system basically renders redundant the process of makes making dummy spells to create WC3 statuses. Speeds up everything a lot...
 

the Immortal

I know, I know...
Reaction score
51
Both the map and the .txt file contain only version 1.2.8, as I see. The post, indeed, contains 1.3.0 but it is unpleasantly half-ish. Unless I am missing something important, how should I download the latest version?

*except merging and/or replicating changes made in latest versions
 

the Immortal

I know, I know...
Reaction score
51
rofl... gotta learn to read whole threads, eh?

Still, updating a txt wouldnt take more than a minute or two =P
 

Laiev

Hey Listen!!
Reaction score
188
I got a question about this...

For example, your demo map...

if unit die before the timeout the status still in that unit and never remove it? :rolleyes:
 

Laiev

Hey Listen!!
Reaction score
188
JASS:
// Stuns every unit on the map for 5 seconds.
scope SimpleStun initializer Demo
    private function Timeout takes unit target, real time returns nothing
        // You should use your favourite timer system instead of TriggerSleepAction.
        call TriggerSleepAction(time)
        call Status[target].removeStun()
    endfunction
    function Stun takes unit target, real time returns nothing
        call Status[target].addStun()
        call Timeout.execute(target,time)
    endfunction
    
    private function Action takes nothing returns nothing
        call Stun(GetEnumUnit(),5.0)
    endfunction
    private function DoThings takes nothing returns nothing
        call TriggerSleepAction(1.0)
        // This is because deep down I love GUI and all the trouble it causes.
        call BJDebugMsg("Stunning everything for 5 seconds.")
        call ForGroupBJ(GetUnitsInRectAll(GetPlayableMapRect()),function Action)
        call TriggerSleepAction(5.0)
        call BJDebugMsg("5 seconds has passed.")
    endfunction
    private function Demo takes nothing returns nothing
        call DoThings.execute()
    endfunction
endscope


unit target die before the Timeout execute...

unit target stay with stun, after revive?
 

Jesus4Lyf

Good Idea™
Reaction score
397
(Note for this explanation: "status" - a status applied by this system; versus "Status" - the system itself.)

This happens because of the difference between a "status" and a "bonus". Status applies both statuses and bonuses, but because of the way statuses work in WC3, they are removed on death. Actually, statuses should remain on the units after they revive, but I have not coded for this yet, and may not. You actually still have to remove the status, or else the unit's level of the status applied will bug. Example:

This is correct:

Stun unit.
Unit dies.
Unstun unit. (this may happen after revival, that is fine also.)
Unit revives.
Stun unit/unstun unit, etc, things progress as per normal.

This is incorrect:

Stun unit.
Unit dies.
Don't bother unstunning unit since it is dead.
Unit revives.
Unit is stunned. <-- This will become a permastun because its stunlevel was permenantly incremented, meaning when you try to decrement it after here, it will drop back to 1, not 0.

So, in short, consider it a "bug" that when a unit revives, its statuses do not seem to still be on it. The correct behavior is that in everything you apply, it remains on the unit until removed. :)

If you have issues with removing the move speed bonus from a unit on death, I recommend you use BuffStruct, and write a trigger which, on death, moves all buffs from the dying unit to a null unit. I can help you with that in the BuffStruct thread, if you like. (That also solves the above issues, and makes things -really- easy to manage. :))
 

Laiev

Hey Listen!!
Reaction score
188
hmm very thank you for the explain

I will play now, I need import the buffstruct (don't get yet) and need see how it work... i'm not too good with method and struct, may need read more tutorial :rolleyes::rolleyes::rolleyes:

about the status, it will work if i just do something like this:

JASS:
function test takes nothing returns nothing
    local u = GetTriggerUnit()
    call Status<u>.modMovementSpeedBonus(-Status<u>.getMovementSpeedBonus())
    set u = null
endfunction</u></u>


?
 

Jesus4Lyf

Good Idea™
Reaction score
397
about the status, it will work if i just do something like this:
Well, depends what you want to achieve...

How are you normally removing the speed bonus?

ie. is this a buff on a unit which lasts x seconds and then he amount added is subtracted? Might you accidentally remove it twice in this circumstance?

BuffStruct has nice ways of managing this, which detach the buff instance duration itself from the unit, when required. Might be worth seeing this, for a demo.

Then, whenever a unit dies, you can take all its buffs and move them to a null unit. This will fix everything, basically. :p

But if you want code for that, let's shift to the BuffStruct thread. Ask how there. :)
 

Laiev

Hey Listen!!
Reaction score
188
>> How are you normally removing the speed bonus?

JASS:
//MoveSpeed
private function TimeoutMoveSpeed takes unit target, real time, integer amount returns nothing
    call TriggerSleepAction(time)
    call Status[target].modMoveSpeedBonus(amount)
endfunction

public function MoveSpeed takes unit target, real time, integer amount returns nothing
    call Status[target].modMoveSpeedBonus(amount)
    call TimeoutMoveSpeed.execute(target,time,- amount)
endfunction


>> is this a buff on a unit which lasts x seconds and then he amount added is subtracted? Might you accidentally remove it twice in this circumstance?

No, just a effect passive which increase 1 ms periodic and remove after X seconds..

>> BuffStruct has nice ways of managing this, which detach the buff instance duration itself from the unit, when required. Might be worth seeing this, for a demo.

Hmm... how i said, i need learn more about methods and structs but this demo just show me (and explain) more then i need :p
 

Laiev

Hey Listen!!
Reaction score
188
JASS:
call Status[d.cast].modMoveSpeedBonus( - Status[d.cast].getMoveSpeedBonus() )


and work :) also, don't bug with my 'little' library

This remove completely status added by the system :rolleyes:
 

XeNiM666

I lurk for pizza
Reaction score
138
i have a question about this system..
It seems that i can add negative bonuses to a unit correct? ( lets say reduction of attack damage )
Whenever i decrease the attack damage by 1, it doubles the previous reduction..

example:
JASS:
    private function AtckRed takes integer lvl returns integer
        return /*10 + ( lvl * 15 )*/ 1
    endfunction

    private function PB_Attacked takes nothing returns boolean  
        local unit attacked = GetTriggerUnit()
        local unit attacker = GetEventDamageSource()
        local integer i 
        local integer id = GetUnitId( attacker )
        
        call DisableTrigger( GetTriggeringTrigger() )
        
        if Damage_IsAttack() == true and GetUnitAbilityLevel( attacker, &#039;B00C&#039; ) &gt;= 1 then
            set i = Status[ attacker ].getDamageBonus()
            call BJDebugMsg( I2S( AtckRed( level[ id ] ) ) ) // equal to 1, displayed: 1
            call Status[ attacker ].modDamageBonus( i - AtckRed( level[ id ] ) )
            set dmgred[ GetUnitId( attacker ) ] = dmgred[ id ] + AtckRed( level[ id ] )
        endif
        
        call EnableTrigger( GetTriggeringTrigger() )
        
        set attacked = null
        set attacker = null
        
        return false
    endfunction

in this case, AtkRed == 1 so every time the unit attacks it decreases its attack damage by 1, then 3, then 7, then 15, then 31 and so on.. Why is that? :confused:
 
General chit-chat
Help Users
  • No one is chatting at the moment.

      The Helper Discord

      Staff online

      Members online

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials

      Network Sponsors

      Apex Steel Pipe - Buys and sells Steel Pipe.
      Top