Spell Sequencer

Tom Jones

N/A
Reaction score
437
Come to think of it, I haven't submitted anything to th.net. So to clear it up, here's something from the archieves :)

Sequencer.
When you fist cast Sequencer, it'll store the attacks and unit target spells made in a duration of time (It won't store attacks/spells unless the unit has the buff).
You can then later execute the attacks stored, which will make the unit attack the same targets with the same attack. Note that the stored attack wont take effect
if the unit is dead, if the attack is a spell and the spell is on cooldown (can be edited), if the attack is a spell and the mana cost is greater then the units current mana (can be edited).
It MUI, and should be leak free. Comments are appreciated :)

What you can modify:
Attack Speed gain when you store attacks (Object Editor).
Move Speed gain when you store attacks (Object Editor).
Duration for storing attacks (Object Editor).
Attack Speed gain when executing stored attacks (Object Editor).
If attacks made upon allies can be stored (Trigger Editor).
If stored spell attacks should ignore cooldown (Trigger Editor).
If stored spell attacks should ignore mana cost (Trigger Editor).
Max attacks stored (Trigger Editor).
Bonus damage on stored attacks (Trigger Editor).

I would like to implement point spells aswell, however I have no clue on how this should work with the sequencer. I have some few ideas:
The stored spell will be cast at the same location.
The stored spell will be cast at the units current location.
The stored spell will be cast at the location of one of the targeted units.

I was also thinking about implementing bash, crit and miss to sequencer, meaning that if the unit gets a bash, crit or miss when storing attacks,
it'll also bash, crit, or miss on that attack when the sequencer is executed. Good or bad idea?
 

Attachments

Tinki3

Special Member
Reaction score
418
This should be for the spell forum, did I do something wrong at submission?
The only thing that was "wrong", was that the title didn't have a [spell] tag in it.

The tag makes it easier for people to recognise the thread as a thread relating to a spell, for the spell forum, or, just to be some spell for show.
 

Mr Zero

Junior Regular (Got the T-shirt)
Reaction score
64
Ehh... yeah...
So what do we got here? :p

Well I try the spell map and the spell does not see to do anything...
All it does when I active it;

1. Gives me a buff on 10 sec.
2. Some nice sfx's.

When I press Excute it blinks and nothing happends...
Supose to? No units around me is getting damage...

Tryed 4 times, all the same.
 

Tom Jones

N/A
Reaction score
437
Then your targets have ceased to exits :) The sequenced attack won't take effect if the target is dead, if the sequenced attack is a spell, and the unit does not have enough mana to cast it, or the sequenced spell is on cooldown.
 

Mr Zero

Junior Regular (Got the T-shirt)
Reaction score
64
Well I hade over 100 mana in most cases. And there were like 4 or 5 units around me when I tryed...:confused:
 

SFilip

Gone but not forgotten
Reaction score
634
In the init function instead of this
Code:
    local trigger preload = CreateTrigger()
...
    call TriggerAddAction(preload,function Sequencer_Preload)
    call TriggerExecute(preload)
you can simply call the function (or even better execute)...
Code:
    call ExecuteFunc("Sequencer_Preload")
Also you need to set all handle type locals to null at the end of the function (no need to do this in a loop, its enough to only do it once in the end).
 

Tom Jones

N/A
Reaction score
437
Doesn't the Preload trigger takes more than one function? Anyways, I'll have a look.
*Edit*
Are you referring to this part:
Code:
                if GetUnitState(u,UNIT_STATE_MANA) >= GetHandleReal(Sequencer(),u,"manacost"+I2S(i)) and (GetHandleString(Sequencer(),u,"orderid"+I2S(i)) == OrderId2String(GetUnitCurrentOrder(u))) and IsUnitType(v,UNIT_TYPE_DEAD) == false then
                    set trig = CreateTrigger()
                    call SetHandleBoolean(Sequencer(),trig,"b",false)
                    call SetHandleHandle(Sequencer(),trig,"u",u)
                    call TriggerRegisterUnitEvent(trig,v,EVENT_UNIT_DAMAGED)
                    call TriggerAddAction(trig,function Sequencer_Damaged)
                    loop
                        exitwhen GetHandleBoolean(Sequencer(),trig,"b") == true
                        call TriggerSleepAction(0.05)
                    endloop
                    call DisableTrigger(trig)
                    call FlushHandleLocals(Sequencer(),trig)
                    call DestroyTrigger(trig)
                endif
I have to make a trigger every time the loop runs, so I'll have to create/destroy on every run. That's why I'm nulling it in the loop. Got a better suggestion?
Executefunc would be easier.
 

SFilip

Gone but not forgotten
Reaction score
634
> Doesn't the Preload trigger takes more than one function?
Well no, all you did was adding an action and then running the trigger...

> I have to make a trigger every time the loop runs, so I'll have to create/destroy on every run.
Yes, but you don't have to null it every time.
For instance this code
Code:
function something takes nothing returns nothing
    local timer t = CreateTimer()
    call DestroyTimer(t)
    set t = CreateTimer()
    call DestroyTimer(t)
    set t = CreateTimer()
    call DestroyTimer(t)
    set t = CreateTimer()
    call DestroyTimer(t)
    set t = CreateTimer()
    call DestroyTimer(t)
    set t = null
endfunction
is leakless.
 

Tom Jones

N/A
Reaction score
437
>Very original spell! I quite like it, though it's only really useful when fighting an enemy hero.
Indeed.

>Yes, but you don't have to null it every time.
I'm not nulling it everytime. I'm nulling the variable trig at the end of the function, however the created variable get's handle assigned to it, and we both have to agree that handles should be cleaned before destroying the handle.

>Preload
I know I said that ExecuteFunc() would be easier, but actually the easiest thing to do is simply calling the function.
 
G

gonecase

Guest
Getting error while importing

I am getting error while importing this spell to my map,, I get error here

Code:
local unit u = GetHandleUnit(Sequencer(),trig,"u")
Invalid number of arguments
 

Tom Jones

N/A
Reaction score
437
That's odd, because that's the correct number of arguments.

Did you import my gamecache system or KaTTaNas original? The gamecache system I used for that spell is modified a little, meaning that you can't use it together with KaTTaNas original game cache system.
 
General chit-chat
Help Users
  • No one is chatting at the moment.
  • jonas jonas:
    That sounds like fun!
    +1
  • The Helper The Helper:
    it was a blast!
  • The Helper The Helper:
    I am going to post the Youtube of the investigation in the forums when it is ready
    +1
  • jonas jonas:
    cool!
  • vypur85 vypur85:
    Sounds cool TH.
  • tom_mai78101 tom_mai78101:
    I was on a Legend of Zelda marathon...
  • tom_mai78101 tom_mai78101:
    Am still doing it now
    +1
  • jonas jonas:
    which one(s) are you playing?
  • jonas jonas:
    I played a little bit of the switch title two weeks ago and found it quite boring
  • The Helper The Helper:
    just got back from San Antonio this weekend had the best Buffalo Chicken Cheesesteak sandwhich in Universal City, TX - place was called Yous Guys freaking awesome! Hope everyone had a fantastic weekend!
    +1
  • The Helper The Helper:
    Happy Tuesday!
  • The Helper The Helper:
    We have been getting crazy numbers reported by the forum of people online the bots are going crazy on us I think it is AI training bots going at it at least that is what it looks like to me.
  • The Helper The Helper:
    Most legit traffic is tracked on multiple Analytics and we have Cloud Flare setup to block a ton of stuff but still there is large amount of bots that seem to escape detection and show up in the user list of the forum. I have been watching this bullshit for a year and still cannot figure it out it is drving me crazy lol.
    +1
  • Ghan Ghan:
    Beep boop
    +1
  • The Helper The Helper:
    hears robot sounds while 250 bots are on the forum lol
  • The Helper The Helper:
    Happy Saturday!
    +1
  • The Helper The Helper:
    and then it was Thursday...
    +2
  • tom_mai78101 tom_mai78101:
    And then Monday
    +1
  • The Helper The Helper:
    I got the day off today!
    +1
  • tom_mai78101 tom_mai78101:
    How...? (T-T)
  • The Helper The Helper:
    I took the day off. I work for myself so I can do that.
    +1
  • Varine Varine:
    Well I'm already over summer
  • jonas jonas:
    varine! good to see you
  • jonas jonas:
    what's going on, what's got you going
  • The Helper The Helper:
    good to see you varine hope you are well my friend

    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