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.
  • WildTurkey WildTurkey:
    is there a stephen green in the house?
    +1
  • The Helper The Helper:
    What is up WildTurkey?
  • The Helper The Helper:
    Looks like Google fixed whatever mistake that made the recipes on the site go crazy and we are no longer trending towards a recipe site lol - I don't care though because it motivated me to spend alot of time on the site improving it and at least now the content people are looking at is not stupid and embarrassing like it was when I first got back into this like 5 years ago.
  • The Helper The Helper:
    Plus - I have a pretty bad ass recipe collection now! That section of the site is 10 thousand times better than it was before
  • The Helper The Helper:
    We now have a web designer at my job. A legit talented professional! I am going to get him to redesign the site theme. It is time.
  • Varine Varine:
    I got one more day of community service and then I'm free from this nonsense! I polished a cop car today for a funeral or something I guess
  • Varine Varine:
    They also were digging threw old shit at the sheriff's office and I tried to get them to give me the old electronic stuff, but they said no. They can't give it to people because they might use it to impersonate a cop or break into their network or some shit? idk but it was a shame to see them take a whole bunch of radios and shit to get shredded and landfilled
  • The Helper The Helper:
    whatever at least you are free
  • Monovertex Monovertex:
    How are you all? :D
    +1
  • Ghan Ghan:
    Howdy
  • Ghan Ghan:
    Still lurking
    +3
  • The Helper The Helper:
    I am great and it is fantastic to see you my friend!
    +1
  • The Helper The Helper:
    If you are new to the site please check out the Recipe and Food Forum https://www.thehelper.net/forums/recipes-and-food.220/
  • Monovertex Monovertex:
    How come you're so into recipes lately? Never saw this much interest in this topic in the old days of TH.net
  • Monovertex Monovertex:
    Hmm, how do I change my signature?
  • tom_mai78101 tom_mai78101:
    Signatures can be edit in your account profile. As for the old stuffs, I'm thinking it's because Blizzard is now under Microsoft, and because of Microsoft Xbox going the way it is, it's dreadful.
  • The Helper The Helper:
    I am not big on the recipes I am just promoting them - I use the site as a practice place promoting stuff
    +2
  • Monovertex Monovertex:
    @tom_mai78101 I must be blind. If I go on my profile I don't see any area to edit the signature; If I go to account details (settings) I don't see any signature area either.
  • The Helper The Helper:
    You can get there if you click the bell icon (alerts) and choose preferences from the bottom, signature will be in the menu on the left there https://www.thehelper.net/account/preferences
  • The Helper The Helper:
    I think I need to split the Sci/Tech news forum into 2 one for Science and one for Tech but I am hating all the moving of posts I would have to do
  • The Helper The Helper:
    What is up Old Mountain Shadow?

      The Helper Discord

      Members online

      No members online now.

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials

      Network Sponsors

      Apex Steel Pipe - Buys and sells Steel Pipe.
      Top