HomeUser Control Panel (unavailable in archive)ForumsTutorialsArt GalleryResourcesMaps

A unit-type to special effect

09-24-2004, 12:58 PM#1
SoemaWaKaa
I search a way to create a special effect that uses the same model of the unit that triggers my spell.
So this is basically what I want:
if a unit casts [my spell]
create a special effect using [the model of the targeted unit] on blablabla

The problem is here, that you must enter a .mdl string in order to create the special effect, but as you see, the special effect that must be created uses each time a different model when the spell is casted again. Could someone work a way around this problem?
09-24-2004, 01:09 PM#2
ObsidianTitan
What I would do is not create a special effect but create a unit of the type, then add the locust ability(aloc) and pause it(so it dosent attack anything).
09-24-2004, 01:20 PM#3
SoemaWaKaa
I don't want that... I need that special effect because I want to add the effect on the caster (temporarily).
09-24-2004, 01:30 PM#4
ObsidianTitan
alright then, the way to do that would be to create a string array and store all the .mdl file paths of all the units. Then create a way to find the propper unit path when one dies. Give me a sec while i try to write it up.

Edit: Ok I slightly lied, you need the string array but you also need a unit type array. It will take a while to set it up but it will work for what you want.

set up code
Code:
set paths
    Events
        Map initialization
    Conditions
    Actions
        Set UnitTypes[0] = No unit-type
        Set paths[0] = <Empty String>
        Set UnitTypes[1] = Paladin
        Set paths[1] = units\human\HeroPaladin\HeroPaladin.mdl
        Set UnitTypes[2] = Archmage
        Set paths[2] = units\human\HeroArchMage\HeroArchMage.mdl
        Set UnitTypes[3] = Mountain King
        Set paths[3] = units\human\HeroMountainKing\HeroMountainKing.mdl
        Set UnitTypes[4] = Blood Mage
        Set paths[4] = units\human\HeroBloodElf\HeroBloodElf.mdl


Trigger on cast (set the loop higher to cover all units)
Code:
cast spell
    Events
        Unit - A unit Begins casting an ability
    Conditions
    Actions
        For each (Integer A) from 1 to 10, do (Actions)
            Loop - Actions
                If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    If - Conditions
                        UnitTypes[(Integer A)] Equal to (Unit-type of (Triggering unit))
                    Then - Actions
                        Special Effect - Create a special effect attached to the overhead of (Triggering unit) using paths[(Integer A)]
                    Else - Actions
09-24-2004, 02:31 PM#5
SoemaWaKaa
That's just what I wanted. Thank you VERY much!