Can a building Cast Chain Lightning? Autocast?

M

MBomberZ1

Guest
I have been trying for a while now to make a tower that uses chain lightning as its attack. So far i have just run into a bunch of dead ends, do you guys have a good starting point?

Is it possible to make a tower have a chain lighting attack?

if not, can you give it the ability of chain lightning and set it to autocast?

i couldn't figure out how to get it to autocast so i tried to make a trigger autocast it but i couldn't figure out where a good starting point was.

Thanks for any help!
 
M

MBomberZ1

Guest
i was able to give the building the chain lightning ability, i set it to cost 0 mana so the building could cast it, i could manually cast it on the creeps, but how can i get it to autocast? i assume its with a trigger since there is no Data section in the chainlighting spell to set that.
 
T

Tubba

Guest
Set the cooldown to slightly shorter than the attack, make the attack 1-1, as long-ranged as the chain lighthning-spell. Don't forget aquision range.

Trigger: A unit is attacked
Conditions: Unit-type of attacking unit equal to [building]
Actions: Order [attacking unit] to cast [Orc - Far Seer - Chain Lightning] (Assuming this is what you based your spell off)
 
M

MBomberZ1

Guest
ok great ill go try that now, thanks for the help, ill get back to you in a bit.
 

FhelZone

Have a drink of a nice cold mellowberry juice!
Reaction score
103
A unit is attacked?
It will not respond unless it is attacked
 
M

MBomberZ1

Guest
i was guessing i could delete the visuals from the normal attack of the tower, lower its damage down to 1.

But i just ran into a problem, when selecting
Code:
For each (Integer A) from 1 to 5000, do (Actions)
    Loop - Actions
        Wait 1.90 seconds
        Unit - Order (Attacking unit) to Neutral Naga Sea Witch - Forked Lightning (Attacked unit)

the Neutral Naga Sea Witch Forked Lightning is the only lightning ability i can select from the list, is it possible to add them? the Far Seer chain lightning you suggested i use, is not on the list, i can only summon wolfs with him, odd.
 
M

MBomberZ1

Guest
That was odd, i cycled through it a few times and now the wolfs are gone and i can use chain lightning? Maybe im just too tired =)
 

Romek

Super Moderator
Reaction score
964
Maybe you were on Issue order with no target.

As an alternative to casting the spell, You could give the tower a bouncing attack, like a huntress.
 
M

MBomberZ1

Guest
If i give up on this ill do the huntress idea, but my dream for now is the lightning tower =D

So it works.. sometimes, its very random on when it feels like chain lightning and i think it wont do it until i hover over or select the tower at least once, then it starts.. but still very random

here is the code for what is doing it right now.



Code:
    Events
        Unit - A unit Is attacked
    Conditions
        (Unit-type of (Attacking unit)) Equal to Chain Lightning Tower
    Actions
        For each (Integer A) from 1 to 5000, do (Actions)
            Loop - Actions
                Wait 1.90 seconds
                Unit - Order (Attacking unit) to Orc Far Seer - Chain Lightning (Attacked unit)
 

parmsib

New Member
Reaction score
0
Why loop it 5000 times and have the wait there?

I would have done something like

E
A unit is attacked.
C
(unit-type of (attacking unit)) Equal to Chain Lightning Tower
A
Order (attacking unit) to orc far seer - Chain Lightning (attacked unit)
 

darkRae

Ueki Fan (Ueki is watching you)
Reaction score
173
O_O Why do you have to use a For Loop?
1 to 5000?

EDIT:
parmsib's trigger is the correct one.
 
M

MBomberZ1

Guest
Ok here is the revised one, tbh the 5000 is because i don't know what im doing heh, wasnt sure if it would limit how many times it would run through? what do the numbers even mean if all you want to do is use a loop?
Code:
Untitled Trigger 002
    Events
        Unit - A unit Is attacked
    Conditions
        (Unit-type of (Attacking unit)) Equal to Chain Lightning Tower
    Actions
        For each (Integer Number1[1]) from 1 to 10, do (Actions)
            Loop - Actions
                Unit - Order (Attacking unit) to Orc Far Seer - Chain Lightning (Attacked unit)

This is working much better.
 

darkRae

Ueki Fan (Ueki is watching you)
Reaction score
173
Why do you use a Loop?
If you use a Loop like the one above that means you're ordering the Attacking Unit to Chain Lightning the Attacked Unit 10 times (but of course it will just do it once) which is a waste of call function.
 
M

MBomberZ1

Guest
I just don't know any other way to get a trigger to repeat itself. I'm using this same method to spawn creeps .5 seconds apart from each other to avoid bunching up.

Code:
Level 1
    Events
        Time - Elapsed game time is 40.00 seconds
    Conditions
    Actions
        Set LevelNumber = 1
        Player Group - Pick every player in (All players controlled by a User player) and do (Player - Add ((LevelNumber x 2) x 2) to (Picked player) Current gold)
        For each (Integer Number1[1]) from 1 to 15, do (Actions)
            Loop - Actions
                Wait 0.50 seconds
                Unit - Create 1 Seal Level 1 for Neutral Hostile at (Center of RedCreepSpawn <gen>) facing Default building facing degrees

So this should technically work then?

Code:
ChainLightningLoop
    Events
        Unit - A unit Is attacked
    Conditions
        (Unit-type of (Attacking unit)) Equal to Chain Lightning Tower
    Actions
         Unit - Order (Attacking unit) to Orc Far Seer - Chain Lightning (Attacked unit)
 

FroznYoghurt

New Member
Reaction score
37
Except the old thing with the Unit - A unit Is attacked event.
It triggers when a unit starts attacking and not when the target actually takes damage. This gives the possibilty for players to spam stop while the unit attacks wich will massivly trigger the chain lightning.

I know one nonMUI way around it but except that youl have to import CS + emjl3rs on attack template. I tried it once but couldnt get it installed properly so i ended up using Unit - A unit Is attacked anyways :D

...back to topic....


Couldn't you use a loop to select targets for the unit?
like:

Code:
E - every 1.5 sec 
C - 
A -
Set tempgroup = units in map with level of lightning > 0
pick all in tempgroup and
set tempunit = picked unit
set temppoint = postion of tempunit
set tempgroup2 = units within [range of your spell] of temppoint matching is an enemy and [other conditions you may want]
order tempunit cast lightning on random unit from tempgroup2
remove tempgroup and tempgroup2 and temppoint
 

darkRae

Ueki Fan (Ueki is watching you)
Reaction score
173
^Except that towers don't have attack animations, so players don't usually do it right.
Plus if you spam 'S' for Stop, the tower won't start casting Chain Lightning anyway :rolleyes:
To do this, give the tower a Cast Backswing (see in Art section)
 

TheCrystal

New Member
Reaction score
36
Orb of slow is a wonderful thing.
It's designed to cast a certain spell with a percentage chance.

All you need to do is change the spell and percentage. You need zero triggers total. This question has also been asked before.
 
General chit-chat
Help Users
  • No one is chatting at the moment.

      The Helper Discord

      Staff online

      • Ghan
        Administrator - Servers are fun

      Members online

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials

      Network Sponsors

      Apex Steel Pipe - Buys and sells Steel Pipe.
      Top