• Listen to a special audio message from Bill Roper to the Hive Workshop community (Bill is a former Vice President of Blizzard Entertainment, Producer, Designer, Musician, Voice Actor) 🔗Click here to hear his message!
  • Read Evilhog's interview with Gregory Alper, the original composer of the music for WarCraft: Orcs & Humans 🔗Click here to read the full interview.

Chain?

Status
Not open for further replies.
Level 5
Joined
Jun 22, 2004
Messages
109
hey peeps, gots a question...how would i make a chain lightning based spell?? like for example instead of chain lightning its chain poison or chain freeze or somthing...(i mainly thought of an ability where a unit casts chain lightning and after it hits its last target, it begins to chain heal allies/ havent been succesful in making that) some help would be greatly appreciated :) thx
 
Level 10
Joined
Aug 8, 2004
Messages
562
i think i know the solution, first make a dummy spell (the poison effect or whatever) that has the effect you want.
then you make a trigger that looks somthin like this (assuming you are slightly fimilar with triggers and actions)-

Event-
unit starts the effect of an ability
Conditions-
Ability being cast = Your Ability
Actions-
-Set TargetunitVar = target unit of ability being cast
-Create one Dummy Unit for owner of triggering unit
-issue last created unit to *What your dummy spell is based off* TargetUnitVar
-Wait .4 (or so) seconds
-Set TargetedVarArray[1] = Random unit from units within 400 (or so) of TargetUnitVar matching (conditions) matching unit equal enemy of triggering equal to True (and) Matching unit equal to building equal to false (and) matching unit is dead equal to false.
-Create one Dummy Unit for owner of triggering unit
-issue last created unit to *What your dummy spell is based off* Targeted VarArray[1]
***Repeat these (except the first 3) actions for how many times you want the spell to bounce and increase the array (of course) on the Targeted Array***

:roll:

~iplaystarcraft
 
Level 5
Joined
Jun 22, 2004
Messages
109
ok thx guys ill try both, but if you dont mind me asking, ive always been curious about how arrays work, what are they exactly? and also how do real intergers work? (might aswell ask) ill keep you posted if it works or not for me. thx
 
Level 10
Joined
Aug 8, 2004
Messages
562
well arrays can hold a number of units, special effects, etc.
and real variables are just numbers (i use them to deal damage) they also can do many other things that deals with numbers. Such as if you make a trigger that does damage instead of - an number you can do - Real Variable. The reason you use reals for this is because you can add to the real when a skill is leveled.

:roll:

~iplaystarcraft
 
Level 5
Joined
Jun 22, 2004
Messages
109
ok so heres wat i got for my chain ability....

Trigger

Event
Unit - A unit Starts the effect of an ability
Condition
(Ability being cast) Equal to Twin Chain
Action
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
(Level of Twin Chain for (Triggering unit)) Equal to 6
Then - Actions
Set TwinChainTarget[0] = (Target unit of ability being cast)
Set TwinChainCaster = (Casting unit)
Lightning - Create a lightning effect Mana Flare (Position of TwinChainCaster) (Position of TwinChainTarget[0])
Set TwinLightningEffect[0] = (Last created lightning effect)
Unit - Create 1 Twin Chains Dummy for (Owner of TwinChainCaster) at (Position of TwinChainTarget[0]) facing Default building facing degrees
Set TwinChainsDummyPurge = (Last created unit)
Unit - Set Level of Twin Chains Dummy purge for TwinChainsDummyPurge to 6
Unit - Add a 3.00 second Generic expiration timer to TwinChainsDummyPurge
Unit - Order TwinChainsDummyPurge to Orc Shaman - Purge TwinChainTarget[0]
Unit - Create 1 Twin Chains Dummy Damage for (Owner of TwinChainCaster) at (Position of TwinChainTarget[0]) facing Default building facing degrees
Set TwinChainDummyDamage = (Last created unit)
Unit - Set Level of Twin Chains Dummy Damage for TwinChainDummyDamage to 6
Unit - Add a 3.00 second Generic expiration timer to TwinChainDummyDamage
Unit - Order TwinChainDummyDamage to Neutral Alchemist - Acid Bomb TwinChainTarget[0]
Wait 0.40 seconds
Lightning - Destroy TwinLightningEffect[0]
Set TwinChainTarget[1] = (Random unit from (Units within 500.00 of (Position of TwinChainTarget[0]) matching ((((Matching unit) belongs to an enemy of (Owner of TwinChainCaster)) Equal to True) and ((TwinChainTarget[1] has buff Twin Chains ) Equal to False))))
If ((Number of units in (Units within 500.00 of (Position of TwinChainTarget[0]) matching (((Matching unit) belongs to an enemy of (Owner of TwinChainCaster)) Equal to True))) Equal to 0) then do (Skip remaining actions) else do (Do nothing)
If ((TwinChainTarget[1] is dead) Equal to True) then do (Set TwinChainTarget[1] = (Random unit from (Units within 500.00 of (Position of TwinChainTarget[0]) matching ((((Matching unit) belongs to an enemy of (Owner of TwinChainCaster)) Equal to True) and ((TwinChainTarget[1] is alive) Equal to True))))) else do (Do nothing)
Lightning - Create a lightning effect Mana Flare (Position of TwinChainTarget[0]) (Position of TwinChainTarget[1])
Set TwinLightningEffect[1] = (Last created lightning effect)
Unit - Create 1 Twin Chains Dummy for (Owner of TwinChainCaster) at (Position of TwinChainTarget[1]) facing Default building facing degrees
Set TwinChainsDummyPurge = (Last created unit)
Unit - Set Level of Twin Chains Dummy purge for TwinChainsDummyPurge to 6
Unit - Add a 3.00 second Generic expiration timer to TwinChainsDummyPurge
Unit - Order TwinChainsDummyPurge to Orc Shaman - Purge TwinChainTarget[1]
Unit - Create 1 Twin Chains Dummy Damage for (Owner of TwinChainCaster) at (Position of TwinChainTarget[1]) facing Default building facing degrees
Set TwinChainDummyDamage = (Last created unit)
Unit - Set Level of Twin Chains Dummy Damage for TwinChainDummyDamage to 6
Unit - Add a 3.00 second Generic expiration timer to TwinChainDummyDamage
Unit - Order TwinChainDummyDamage to Neutral Alchemist - Acid Bomb TwinChainTarget[1]
Wait 0.40 seconds
Lightning - Destroy TwinLightningEffect[1]
Set TwinChainTarget[2] = (Random unit from (Units within 500.00 of (Position of TwinChainTarget[1]) matching ((((Matching unit) belongs to an enemy of (Owner of TwinChainCaster)) Equal to True) and ((TwinChainTarget[2] has buff Twin Chains ) Equal to False))))
If ((Number of units in (Units within 500.00 of (Position of TwinChainTarget[1]) matching (((Matching unit) belongs to an enemy of (Owner of TwinChainCaster)) Equal to True))) Equal to 0) then do (Skip remaining actions) else do (Do nothing)
If ((TwinChainTarget[2] is dead) Equal to True) then do (Set TwinChainTarget[2] = (Random unit from (Units within 500.00 of (Position of TwinChainTarget[1]) matching ((((Matching unit) belongs to an enemy of (Owner of TwinChainCaster)) Equal to True) and ((TwinChainTarget[2] is alive) Equal to True))))) else do (Do nothing)
Lightning - Create a lightning effect Mana Flare (Position of TwinChainTarget[1]) (Position of TwinChainTarget[2])
Set TwinLightningEffect[2] = (Last created lightning effect)
Unit - Create 1 Twin Chains Dummy for (Owner of TwinChainCaster) at (Position of TwinChainTarget[2]) facing Default building facing degrees
Set TwinChainsDummyPurge = (Last created unit)
Unit - Set Level of Twin Chains Dummy purge for TwinChainsDummyPurge to 6
Unit - Add a 3.00 second Generic expiration timer to TwinChainsDummyPurge
Unit - Order TwinChainsDummyPurge to Orc Shaman - Purge TwinChainTarget[2]
Unit - Create 1 Twin Chains Dummy Damage for (Owner of TwinChainCaster) at (Position of TwinChainTarget[2]) facing Default building facing degrees
Set TwinChainDummyDamage = (Last created unit)
Unit - Set Level of Twin Chains Dummy Damage for TwinChainDummyDamage to 6
Unit - Add a 3.00 second Generic expiration timer to TwinChainDummyDamage
Unit - Order TwinChainDummyDamage to Neutral Alchemist - Acid Bomb TwinChainTarget[2]
Wait 0.40 seconds
Lightning - Destroy TwinLightningEffect[2]
Set TwinChainTarget[3] = (Random unit from (Units within 500.00 of (Position of TwinChainTarget[2]) matching ((((Matching unit) belongs to an enemy of (Owner of TwinChainCaster)) Equal to True) and ((TwinChainTarget[3] has buff Twin Chains ) Equal to False))))
If ((Number of units in (Units within 500.00 of (Position of TwinChainTarget[2]) matching (((Matching unit) belongs to an enemy of (Owner of TwinChainCaster)) Equal to True))) Equal to 0) then do (Skip remaining actions) else do (Do nothing)
If ((TwinChainTarget[3] is dead) Equal to True) then do (Set TwinChainTarget[3] = (Random unit from (Units within 500.00 of (Position of TwinChainTarget[2]) matching ((((Matching unit) belongs to an enemy of (Owner of TwinChainCaster)) Equal to True) and ((TwinChainTarget[3] is alive) Equal to True))))) else do (Do nothing)
Lightning - Create a lightning effect Mana Flare (Position of TwinChainTarget[2]) (Position of TwinChainTarget[3])
Set TwinLightningEffect[3] = (Last created lightning effect)
Unit - Create 1 Twin Chains Dummy for (Owner of TwinChainCaster) at (Position of TwinChainTarget[3]) facing Default building facing degrees
Set TwinChainsDummyPurge = (Last created unit)
Unit - Set Level of Twin Chains Dummy purge for TwinChainsDummyPurge to 6
Unit - Add a 3.00 second Generic expiration timer to TwinChainsDummyPurge
Unit - Order TwinChainsDummyPurge to Orc Shaman - Purge TwinChainTarget[3]
Unit - Create 1 Twin Chains Dummy Damage for (Owner of TwinChainCaster) at (Position of TwinChainTarget[3]) facing Default building facing degrees
Set TwinChainDummyDamage = (Last created unit)
Unit - Set Level of Twin Chains Dummy Damage for TwinChainDummyDamage to 6
Unit - Add a 3.00 second Generic expiration timer to TwinChainDummyDamage
Unit - Order TwinChainDummyDamage to Neutral Alchemist - Acid Bomb TwinChainTarget[3]
Wait 0.40 seconds
Lightning - Destroy TwinLightningEffect[3]
Set TwinChainTarget[4] = (Random unit from (Units within 500.00 of (Position of TwinChainTarget[3]) matching ((((Matching unit) belongs to an enemy of (Owner of TwinChainCaster)) Equal to True) and ((TwinChainTarget[4] has buff Twin Chains ) Equal to False))))
If ((Number of units in (Units within 500.00 of (Position of TwinChainTarget[3]) matching (((Matching unit) belongs to an enemy of (Owner of TwinChainCaster)) Equal to True))) Equal to 0) then do (Skip remaining actions) else do (Do nothing)
If ((TwinChainTarget[4] is dead) Equal to True) then do (Set TwinChainTarget[4] = (Random unit from (Units within 500.00 of (Position of TwinChainTarget[3]) matching ((((Matching unit) belongs to an enemy of (Owner of TwinChainCaster)) Equal to True) and ((TwinChainTarget[4] is alive) Equal to True))))) else do (Do nothing)
Lightning - Create a lightning effect Mana Flare (Position of TwinChainTarget[3]) (Position of TwinChainTarget[4])
Set TwinLightningEffect[4] = (Last created lightning effect)
Unit - Create 1 Twin Chains Dummy for (Owner of TwinChainCaster) at (Position of TwinChainTarget[4]) facing Default building facing degrees
Set TwinChainsDummyPurge = (Last created unit)
Unit - Set Level of Twin Chains Dummy purge for TwinChainsDummyPurge to 6
Unit - Add a 3.00 second Generic expiration timer to TwinChainsDummyPurge
Unit - Order TwinChainsDummyPurge to Orc Shaman - Purge TwinChainTarget[4]
Unit - Create 1 Twin Chains Dummy Damage for (Owner of TwinChainCaster) at (Position of TwinChainTarget[4]) facing Default building facing degrees
Set TwinChainDummyDamage = (Last created unit)
Unit - Set Level of Twin Chains Dummy Damage for TwinChainDummyDamage to 6
Unit - Add a 3.00 second Generic expiration timer to TwinChainDummyDamage
Unit - Order TwinChainDummyDamage to Neutral Alchemist - Acid Bomb TwinChainTarget[4]
Wait 0.40 seconds
Lightning - Destroy TwinLightningEffect[4]
Set TwinChainTarget[5] = (Random unit from (Units within 500.00 of (Position of TwinChainTarget[4]) matching ((((Matching unit) belongs to an enemy of (Owner of TwinChainCaster)) Equal to True) and ((TwinChainTarget[5] has buff Twin Chains ) Equal to False))))
If ((Number of units in (Units within 500.00 of (Position of TwinChainTarget[4]) matching (((Matching unit) belongs to an enemy of (Owner of TwinChainCaster)) Equal to True))) Equal to 0) then do (Skip remaining actions) else do (Do nothing)
If ((TwinChainTarget[5] is dead) Equal to True) then do (Set TwinChainTarget[5] = (Random unit from (Units within 500.00 of (Position of TwinChainTarget[4]) matching ((((Matching unit) belongs to an enemy of (Owner of TwinChainCaster)) Equal to True) and ((TwinChainTarget[5] is alive) Equal to True))))) else do (Do nothing)
Lightning - Create a lightning effect Mana Flare (Position of TwinChainTarget[4]) (Position of TwinChainTarget[5])
Set TwinLightningEffect[5] = (Last created lightning effect)
Unit - Create 1 Twin Chains Dummy for (Owner of TwinChainCaster) at (Position of TwinChainTarget[5]) facing Default building facing degrees
Set TwinChainsDummyPurge = (Last created unit)
Unit - Set Level of Twin Chains Dummy purge for TwinChainsDummyPurge to 6
Unit - Add a 3.00 second Generic expiration timer to TwinChainsDummyPurge
Unit - Order TwinChainsDummyPurge to Orc Shaman - Purge TwinChainTarget[5]
Unit - Create 1 Twin Chains Dummy Damage for (Owner of TwinChainCaster) at (Position of TwinChainTarget[5]) facing Default building facing degrees
Set TwinChainDummyDamage = (Last created unit)
Unit - Set Level of Twin Chains Dummy Damage for TwinChainDummyDamage to 6
Unit - Add a 3.00 second Generic expiration timer to TwinChainDummyDamage
Unit - Order TwinChainDummyDamage to Neutral Alchemist - Acid Bomb TwinChainTarget[5]
Wait 0.40 seconds
Lightning - Destroy TwinLightningEffect[5]
Set TwinChainTarget[6] = (Random unit from (Units within 1000.00 of (Position of TwinChainTarget[5]) matching ((Percentage life of TwinChainTarget[6]) Less than 10.00)))
Unit - Create 1 Twin Chains Dummy Heal for (Owner of TwinChainCaster) at (Position of TwinChainTarget[6]) facing Default building facing degrees
Set TwinChainsDummyHeal = (Last created unit)
Unit - Set Level of TwinChainDummy heal for TwinChainsDummyHeal to 6
Unit - Add a 3.00 second Generic expiration timer to TwinChainsDummyHeal
Unit - Order TwinChainsDummyHeal to Orc Shadow Hunter - Healing Wave TwinChainTarget[6]
Else - Actions
Do nothing


ok this is only for lvl 6, so n e ways, basically the problem i have is that i cast it, it hits like 2 units then all of sudden stops and the lightning effect goes to the middle of the map, so it just randomly stops and the units are created in the middle of the map, and dont do n e thing from there. second problem i have is that most of the time it does not cast healing wave on my allies or units.

plz help its soo close to being done!
 
Level 12
Joined
Apr 29, 2005
Messages
999
First of all, please you MUST use loops (for each integer A do action) instead of having all those lines repeated for each bounce. It will spare so much time, space and will allow you to change the amount of bounces in no time instead of remoing or deleting all those lines.
The reason that the lightnings and dummies are created at the middle of the map is that when a function that uses a location don't have any location it uses center of the map as location. So somehow there is no location to use when the things are created at the middle of the map. An advice when you make spells is to let the game write out text lines and text tags in the game telling some vaules and stuff so you know when the trigger works as it should.
I don't know the exact reason why your script don't work. I tried to make a chain spell with GUI once but it didn't work correctly. I hade similar problems like yours. One thing that always could be the reason is the pick-actions. After a spell I tried to make I don't trust them at all. They can often pick wrong targets and stuff. I now longer only use JASS.
A last thing to say, I recommend you to don't use lightnings in simialted chain spells like yours becouse the lightnings will stay on the ground where they were created which doesn't look good at all when the targets are moving. Use missiles instead. A sad but true fact.
 
Level 5
Joined
Jun 22, 2004
Messages
109
ok cool, but i duno how to use jass, and i dont understand how it could be leaking a postion/location, if the trigger is written right there, it should follow what its told shouldnt it? and is there a trigger that allows you to use missles? how would u do that?

oh yeah and i forgot to add, should i use for each intiger A do actions or should i not?
 
Level 12
Joined
Apr 29, 2005
Messages
999
PostPosted: Sun Aug 14, 2005 2:53 am Post subject:
I never use loop action in a chain spell couse if there is a wait action in the loop the loop will stop and the trigger wont finish. I dont know why I get this bug icon_sad.gif
Very strange. I have never experienced this.

And DemonHunterX, yes as long as you don't get Freezer's strange results you should always use loops in chain spells. About the missiles, just create a dummy at the previous target unit and make it cast some spell or attack the current target unit.
 
Level 12
Joined
Apr 29, 2005
Messages
999
For the second time, lightning effects should never be used if the spell is ment to hit moving targets since the lightning will stay on the ground where they were created and not follow the unit. It doesn't look good.
 
Level 5
Joined
Jun 22, 2004
Messages
109
ok cool, just one thing tho, when i did try doing the interger thing, it never hit other units, it would either hit the same unit many time(target unit of ability being cast) or it would hit that unit once, so i duno maybe my code is wrong or its the wait thing im not sure but, im w8iing on u starcraft :p thx for ur help.
 
Status
Not open for further replies.
Top