HomeUser Control Panel (unavailable in archive)ForumsTutorialsArt GalleryResourcesMaps

Help on Custom Spell

03-20-2004, 05:28 AM#1
Transcendence
Code:
Events
        Unit - A unit Begins casting an ability
    Conditions
        (Ability being cast) Equal to Destruction of Heaven and Earth 
    Actions
        Region - Center Destruction of Heaven and Earth <gen> on (Position of (Triggering unit))
        Unit Group - Pick every unit in (Units in Destruction of Heaven and Earth <gen> matching ((Owner of (Picked unit)) Equal to Neutral Hostile)) and do (Unit Group - Add (Picked unit) to DestructionofHeavenAndEarth[1])
        Unit Group - Pick every unit in (Units in Destruction of Heaven and Earth <gen> matching ((Owner of (Picked unit)) Equal to Neutral Hostile)) and do (Unit Group - Add (Picked unit) to DestructionofHeavenAndEarth[2])
        For each (Integer A) from 1 to 2, do (Actions)
            Loop - Actions
                Special Effect - Create a special effect at (Random point in Destruction of Heaven and Earth <gen>) using Units\Demon\Infernal\InfernalBirth.mdl
                Wait 0.30 seconds
                Special Effect - Create a special effect at (Random point in Destruction of Heaven and Earth <gen>) using Abilities\Spells\Human\Thunderclap\ThunderClapCaster.mdl
                Wait 0.30 seconds
                Special Effect - Create a special effect at (Random point in Destruction of Heaven and Earth <gen>) using Abilities\Spells\Items\TomeOfRetraining\TomeOfRetrainingCaster.mdl
                Wait 0.30 seconds
                Special Effect - Create a special effect at (Random point in Destruction of Heaven and Earth <gen>) using Abilities\Spells\Other\Silence\SilenceAreaBirth.mdl
                Wait 0.30 seconds
                Special Effect - Create a special effect at (Random point in Destruction of Heaven and Earth <gen>) using Abilities\Spells\Orc\Shockwave\ShockwaveMissile.mdl
                Wait 0.30 seconds
                Special Effect - Create a special effect at (Random point in Destruction of Heaven and Earth <gen>) using Abilities\Spells\NightElf\shadowstrike\ShadowStrikeMissile.mdl
                Wait 0.30 seconds
                Special Effect - Create a special effect at (Random point in Destruction of Heaven and Earth <gen>) using Abilities\Weapons\VengeanceMissile\VengeanceMissile.mdl
                Wait 0.30 seconds
                Special Effect - Create a special effect at (Random point in Destruction of Heaven and Earth <gen>) using Units\Demon\Infernal\InfernalBirth.mdl
                Wait 0.30 seconds
                Special Effect - Create a special effect at (Random point in Destruction of Heaven and Earth <gen>) using Abilities\Spells\Human\Thunderclap\ThunderClapCaster.mdl
                Wait 0.30 seconds
                Special Effect - Create a special effect at (Random point in Destruction of Heaven and Earth <gen>) using Abilities\Spells\Items\TomeOfRetraining\TomeOfRetrainingCaster.mdl
                Wait 0.30 seconds
                Special Effect - Create a special effect at (Random point in Destruction of Heaven and Earth <gen>) using Abilities\Spells\Other\Silence\SilenceAreaBirth.mdl
                Wait 0.30 seconds
                Special Effect - Create a special effect at (Random point in Destruction of Heaven and Earth <gen>) using Abilities\Spells\Orc\Shockwave\ShockwaveMissile.mdl
                Wait 0.30 seconds
                Special Effect - Create a special effect at (Random point in Destruction of Heaven and Earth <gen>) using Abilities\Weapons\VengeanceMissile\VengeanceMissile.mdl
                Wait 0.30 seconds
                Special Effect - Create a special effect at (Random point in Destruction of Heaven and Earth <gen>) using Abilities\Spells\NightElf\shadowstrike\ShadowStrikeMissile.mdl
        For each (Integer A) from 1 to (Number of units in DestructionofHeavenAndEarth[1]), do (Actions)
            Loop - Actions
                Set TheUnit = (Random unit from DestructionofHeavenAndEarth[1])
                Special Effect - Create a special effect at (Random point in Destruction of Heaven and Earth <gen>) using Units\Demon\Infernal\InfernalBirth.mdl
                Wait 0.30 seconds
                Special Effect - Create a special effect at (Random point in Destruction of Heaven and Earth <gen>) using Abilities\Spells\Human\Thunderclap\ThunderClapCaster.mdl
                Wait 0.30 seconds
                Unit - Set life of TheUnit to ((Life of TheUnit) - 1000.00)
                Special Effect - Create a special effect at (Random point in Destruction of Heaven and Earth <gen>) using Abilities\Spells\Items\TomeOfRetraining\TomeOfRetrainingCaster.mdl
                Wait 0.30 seconds
                Special Effect - Create a special effect at (Random point in Destruction of Heaven and Earth <gen>) using Abilities\Spells\Other\Silence\SilenceAreaBirth.mdl
                Wait 0.30 seconds
                Unit - Set life of TheUnit to ((Life of TheUnit) - 1000.00)
                Special Effect - Create a special effect at (Random point in Destruction of Heaven and Earth <gen>) using Abilities\Spells\Orc\Shockwave\ShockwaveMissile.mdl
                Wait 0.30 seconds
                Special Effect - Create a special effect at (Random point in Destruction of Heaven and Earth <gen>) using Abilities\Spells\NightElf\shadowstrike\ShadowStrikeMissile.mdl
                Wait 0.30 seconds
                Unit - Set life of TheUnit to ((Life of TheUnit) - 1000.00)
                Special Effect - Create a special effect at (Random point in Destruction of Heaven and Earth <gen>) using Abilities\Weapons\VengeanceMissile\VengeanceMissile.mdl
                Wait 0.30 seconds
                Special Effect - Create a special effect at (Random point in Destruction of Heaven and Earth <gen>) using Units\Demon\Infernal\InfernalBirth.mdl
                Wait 0.30 seconds
                Unit - Set life of TheUnit to ((Life of TheUnit) - 1000.00)
                Special Effect - Create a special effect at (Random point in Destruction of Heaven and Earth <gen>) using Abilities\Spells\Human\Thunderclap\ThunderClapCaster.mdl
                Wait 0.30 seconds
                Special Effect - Create a special effect at (Random point in Destruction of Heaven and Earth <gen>) using Abilities\Spells\Items\TomeOfRetraining\TomeOfRetrainingCaster.mdl
                Wait 0.30 seconds
                Unit - Set life of TheUnit to ((Life of TheUnit) - 1000.00)
                Special Effect - Create a special effect at (Random point in Destruction of Heaven and Earth <gen>) using Abilities\Spells\Other\Silence\SilenceAreaBirth.mdl
                Wait 0.30 seconds
                Special Effect - Create a special effect at (Random point in Destruction of Heaven and Earth <gen>) using Abilities\Spells\Orc\Shockwave\ShockwaveMissile.mdl
                Wait 0.30 seconds
                Unit - Set life of TheUnit to ((Life of TheUnit) - 1000.00)
                Special Effect - Create a special effect at (Random point in Destruction of Heaven and Earth <gen>) using Abilities\Weapons\VengeanceMissile\VengeanceMissile.mdl
                Wait 0.30 seconds
                Special Effect - Create a special effect at (Random point in Destruction of Heaven and Earth <gen>) using Abilities\Spells\NightElf\shadowstrike\ShadowStrikeMissile.mdl
                Wait 0.30 seconds
                Unit - Set life of TheUnit to ((Life of TheUnit) - 1000.00)
                Unit Group - Remove TheUnit from DestructionofHeavenAndEarth[1]
        For each (Integer A) from 1 to (Number of units in DestructionofHeavenAndEarth[2]), do (Actions)
            Loop - Actions
                Set TheUnit = (Random unit from DestructionofHeavenAndEarth[2])
                Special Effect - Create a special effect at (Random point in Destruction of Heaven and Earth <gen>) using Units\Demon\Infernal\InfernalBirth.mdl
                Wait 0.30 seconds
                Special Effect - Create a special effect at (Random point in Destruction of Heaven and Earth <gen>) using Abilities\Spells\Human\Thunderclap\ThunderClapCaster.mdl
                Wait 0.30 seconds
                Unit - Set life of TheUnit to ((Life of TheUnit) - 500.00)
                Special Effect - Create a special effect at (Random point in Destruction of Heaven and Earth <gen>) using Abilities\Spells\Items\TomeOfRetraining\TomeOfRetrainingCaster.mdl
                Wait 0.30 seconds
                Special Effect - Create a special effect at (Random point in Destruction of Heaven and Earth <gen>) using Abilities\Spells\Other\Silence\SilenceAreaBirth.mdl
                Wait 0.30 seconds
                Unit - Set life of TheUnit to ((Life of TheUnit) - 500.00)
                Special Effect - Create a special effect at (Random point in Destruction of Heaven and Earth <gen>) using Abilities\Spells\Orc\Shockwave\ShockwaveMissile.mdl
                Wait 0.30 seconds
                Special Effect - Create a special effect at (Random point in Destruction of Heaven and Earth <gen>) using Abilities\Spells\NightElf\shadowstrike\ShadowStrikeMissile.mdl
                Wait 0.30 seconds
                Unit - Set life of TheUnit to ((Life of TheUnit) - 500.00)
                Special Effect - Create a special effect at (Random point in Destruction of Heaven and Earth <gen>) using Abilities\Weapons\VengeanceMissile\VengeanceMissile.mdl
                Wait 0.30 seconds
                Special Effect - Create a special effect at (Random point in Destruction of Heaven and Earth <gen>) using Units\Demon\Infernal\InfernalBirth.mdl
                Wait 0.30 seconds
                Unit - Set life of TheUnit to ((Life of TheUnit) - 500.00)
                Special Effect - Create a special effect at (Random point in Destruction of Heaven and Earth <gen>) using Abilities\Spells\Human\Thunderclap\ThunderClapCaster.mdl
                Wait 0.30 seconds
                Special Effect - Create a special effect at (Random point in Destruction of Heaven and Earth <gen>) using Abilities\Spells\Items\TomeOfRetraining\TomeOfRetrainingCaster.mdl
                Wait 0.30 seconds
                Unit - Set life of TheUnit to ((Life of TheUnit) - 500.00)
                Special Effect - Create a special effect at (Random point in Destruction of Heaven and Earth <gen>) using Abilities\Spells\Other\Silence\SilenceAreaBirth.mdl
                Wait 0.30 seconds
                Special Effect - Create a special effect at (Random point in Destruction of Heaven and Earth <gen>) using Abilities\Spells\Orc\Shockwave\ShockwaveMissile.mdl
                Wait 0.30 seconds
                Unit - Set life of TheUnit to ((Life of TheUnit) - 500.00)
                Special Effect - Create a special effect at (Random point in Destruction of Heaven and Earth <gen>) using Abilities\Weapons\VengeanceMissile\VengeanceMissile.mdl
                Wait 0.30 seconds
                Special Effect - Create a special effect at (Random point in Destruction of Heaven and Earth <gen>) using Abilities\Spells\NightElf\shadowstrike\ShadowStrikeMissile.mdl
                Wait 0.30 seconds
                Unit Group - Remove TheUnit from DestructionofHeavenAndEarth[2]


The above is the coding I used for my custom spell. I had it working, but it was lagging, so I used the wait 0.3 seconds to stop lag, but now, it does not subtract the damage from the units in the region, and stops after the first

"For Each Integer A from 1 to 2 do ...."

I found that it stops right after it completes that. Any suggestion?
03-20-2004, 08:16 AM#2
eva01
You might want to create a special effects array variable and set it to last created special effects for each created special effects(below it). From what I read(I could be wrong) everytime you create a special effects it is stored in memory even if it isn't visible on your map. If you don't destroy it, it will slow down the game.
03-20-2004, 04:14 PM#3
Transcendence
I don't have the lag problem anymre. I am going to add the destroy special effect triggers, but the problem I'm having is that it stops after one thrid of the trigger.
03-20-2004, 05:49 PM#4
BattleBotv8.2
I belive you can only use for each interger a/b once in a trigger, do for each interger a, then b, then if there is more do a run trigger ignoring conditions after b ends the loop and that trigger has for each interger a.