HomeUser Control Panel (unavailable in archive)ForumsTutorialsArt GalleryResourcesMaps

Teh JASS

08-25-2004, 03:35 AM#1
sweet5
ok, I got this spell I making and it uses chain lightning as a base, so I have an array called UnitVar that keeps track of all the targets thats the lightning hits. This is how I set it up:

Code:
For each (Integer A) from 1 to 10, do (Actions)
    Loop - Actions
        Set IntVar = (Integer A)
        Set UnitVar[IntVar] = (Target unit of ability being cast)

but when I use the spell it still only morphs the first targeted unit...
08-25-2004, 03:37 AM#2
Eeporgorg
What that's doing is setting the same unit to 10 different arrays. I would find a solution, but I have to go right away.:( I'm sure someone like Hexen or Lord Vexorian will assume their duties.
08-25-2004, 03:39 AM#3
sweet5
how am I setting the same unit to the array over and over? I thought I was setting it to all the differnt targets :/
08-25-2004, 05:54 AM#4
Rhezz
Well Im no expert but I see the problem.

Quote:
Set UnitVar[IntVar] = (Target unit of ability being cast)

Its setting IntVar to the selected target of the chain lightning spell (the enemy that you click on to start the spell). Theres the problem but unfortunetly Im too much of a nub to come up with a solution. :)
08-25-2004, 05:58 AM#5
sweet5
ok well now I've got this and it still dosent work, but Im getting closer


Code:
Chain Sheep
    Events
        Unit - A unit Starts the effect of an ability
    Conditions
        (Ability being cast) Equal to Chain Lightning
    Actions
        Set SweetsVar = (Triggering unit)
        For each (Integer A) from 1 to 3, do (Actions)
            Loop - Actions
                If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    If - Conditions
                        (Integer A) Equal to 1
                    Then - Actions
                        Set UnitVar[(Integer A)] = (Target unit of ability being cast)
                    Else - Actions
                        Set UnitVar[(Integer A)] = (Random unit from (Units within 500.00 of (Position of UnitVar[((Integer A) - 1)])))
                Custom script:   call CasterCastAbility( GetOwningPlayer(udg_SweetsVar), 'A000', "polymorph", udg_UnitVar[GetForLoopIndexA()], true)
08-25-2004, 05:15 PM#6
Eeporgorg
I'm pretty sure you can't make a chain polymorph spell by basing it on chain lightning. It'd be much easier to do it custom.
Code:
Events 
A unit begins the effect of an ability
Conditions 
Ability being cast  equal to first target chain
Actions
Set Caster = Casting Unit
For each integer A between 1 and (Level of "Chain PolyMorph" x 3)
Set Target = Random unit within 1000 of target unit of ability being cast matching is an enemy of owner of casting unit and has buff polymorph equal to false
Custom Script: CasterCastAbility(GetOwningPlayer(udg_Caster)'A000',"polymorph",udg_Target,true)
Wait .50 seconds
08-25-2004, 05:23 PM#7
sweet5
Thats pretty much what I did so I dont think it'll work but I'll try :\
08-25-2004, 05:43 PM#8
Eeporgorg
What you did was completely different, and very disorderly. My version checks that the unit is an enemy and hasn't been polymorphed, polymorphs it then waits half a second to make a crude chain effect.
08-25-2004, 06:04 PM#9
sweet5
mmk well I tried ur way:

Code:
Chain Sheep
    Events
        Unit - A unit Starts the effect of an ability
    Conditions
        (Ability being cast) Equal to Chain Lightning
    Actions
        Set SweetsVar = (Triggering unit)
        For each (Integer A) from 1 to ((Level of Chain Lightning for (Triggering unit)) x 2), do (Actions)
            Loop - Actions
                Set UnitVar[(Integer A)] = (Random unit from (Units within 500.00 of (Position of (Triggering unit)) matching (((Owner of (Triggering unit)) Equal to (Random player from (All enemies of (Owner of (Triggering unit))))) and ((UnitVar[(Integer A)] has buff Polymorph) Equal to False))))
                Custom script:   call CasterCastAbility( GetOwningPlayer(udg_SweetsVar), 'A000', "polymorph", udg_UnitVar[GetForLoopIndexA()], true)

and had no luck, didnt even morph 1st unit... hmm...
08-25-2004, 09:40 PM#10
Eeporgorg
That's your own fault. You completely butchered my system. The base spell is supposed to be something like stormbolt, that selects only one target. Don't flame me because you have to twist what I say.
08-25-2004, 09:47 PM#11
Eeporgorg
Quote:
Originally Posted by sweet5
mmk well I tried ur way:

Code:
Chain Sheep
    Events
        Unit - A unit Starts the effect of an ability
    Conditions
        (Ability being cast) Equal to [b]Chain Lightning[/b]
    Actions
        Set SweetsVar = (Triggering unit)
        For each (Integer A) from 1 to ((Level of Chain Lightning for (Triggering unit)) x 2), do (Actions)
            Loop - Actions
                Set UnitVar[(Integer A)] = (Random unit from (Units within 500.00 of (Position of (Triggering unit)) matching (((Owner of (Triggering unit)) Equal to [b](Random player from (All enemies of (Owner of (Triggering unit[/b]))))) and (([b]UnitVar[(Integer A)][/b] has buff Polymorph) Equal to False))))
                Custom script:   call CasterCastAbility( GetOwningPlayer(udg_SweetsVar), 'A000', "polymorph", udg_UnitVar[GetForLoopIndexA()], true)

and had no luck, didnt even morph 1st unit... hmm...

Your problem is in the bolded areas. Let me help you with that.

1. The base ability should be something like stormbolt.

2. You want the boolean "Owner of (matching unit) is enemy of owner of (triggering unit)"

3. The game doesn't know what unitvar is yet, so you need "matching unit" instead.
Not to mention you don't need UnitVar to be an array.
Plus a small wait (.50 seconds) would add a "chain" effect.
You also want to catch the target in a variable, and cast polymorph on that before you cast it on the others.

Next time, don't whine that my trigger doesn't work because you butchered it.
08-25-2004, 11:01 PM#12
sweet5
First of all I wasent whining o_O Second I wasent mad at u or anything I was just simply say it didnt work, sorry I messed it up :\ I didnt try to
08-25-2004, 11:16 PM#13
Eeporgorg
It doesn't matter ^^ I just want triggers to be fixed, thats all. And it did look very sarcastic in your post.
08-25-2004, 11:21 PM#14
sweet5
sorry, I didnt mean for it to be sarcastic, I usually put a ::sarcastic:: when Im being sarcastic anyway =P anyway, thx for ur help, Im getting closer lol

now, just tried making the changes u suggested and I ethier cant read or I just suck at triggers...maybe I should just give up :\ but heres what I got anyway

Code:
Chain Sheep
    Events
        Unit - A unit Starts the effect of an ability
    Conditions
        (Ability being cast) Equal to Chain Lightning
    Actions
        Set SweetsVar = (Triggering unit)
        For each (Integer A) from 1 to ((Level of Chain Lightning for (Triggering unit)) x 2), do (Actions)
            Loop - Actions
                Set UnitVar[(Integer A)] = (Random unit from (Units within 500.00 of (Position of (Triggering unit)) matching ((((Matching unit) belongs to an enemy of (Owner of (Triggering unit))) Equal to True) and ((UnitVar[(Integer A)] has buff Polymorph) Equal to False))))
                Custom script:   call CasterCastAbility( GetOwningPlayer(udg_SweetsVar), 'A000', "polymorph", udg_UnitVar[GetForLoopIndexA()], true)

bah
08-25-2004, 11:33 PM#15
Eeporgorg
:o

Here, allow me.

Code:
Chain Sheep
    Events
        Unit - A unit Starts the effect of an ability
    Conditions
        (Ability being cast) Equal to Chain polymorph(BASE OFF STORMBOLT WITH 0 DAMAGE AND .1 STUN[0 will make it forever!])
    Actions
        Set SweetsVar = (Triggering unit)
        Set Target = (Target unit of ability being cast)
        Custom script:   call CasterCastAbility( GetOwningPlayer(udg_SweetsVar), 'A000', "polymorph", udg_Target, true)
        Wait .50 seconds
        For each (Integer A) from 1 to ((Level of Chain Polymorph for (Triggering unit)) x 2), do (Actions)
            Loop - Actions
                Set UnitVar = (Random unit from (Units within 700.00 of (Position of (Triggering unit)) matching ((((Matching unit) belongs to an enemy of (Owner of (Triggering unit))) Equal to True) and (((Matching Unit) has buff Polymorph) Equal to False))))
                Custom script:   call CasterCastAbility( GetOwningPlayer(udg_SweetsVar), 'A000', "polymorph", udg_UnitVar, true)
                Wait .50 seconds
Now, copy that trigger to the exact puncuation mark.(besides the comment on the base spell)You should be fine after that.