Got stuck in the middle of an ability...

Larcenist

REP: Respect, Envy, Prosperity?
Reaction score
211
As for the tree life-bar issue, you could create real trees instead of unit's looking like trees. Then after a while you kill those trees and create units there.
 

Kazuga

Let the game begin...
Reaction score
110
Yes well I tried that in the beginning, though then the trees pathing size made the caster get moved outside...
 

Kazuga

Let the game begin...
Reaction score
110
Well another problem is that I can't get the trees to die when I use "for each integer", tried this but didn't work...:
Code:
Ultimate nature protection
    Events
        Unit - A unit Starts the effect of an ability
    Conditions
        (Ability being cast) Equal to Ultimate nature protection 
    Actions
        [B]Set UltimateNatureCounter = 0[/B]
        Set UltimateNatureProtCaster = (Casting unit)
        If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            If - Conditions
            Then - Actions
                For each (Integer A) from 0 to 7, do (Actions)
                    Loop - Actions
                        Set UltimateOffset = ((Position of UltimateNatureProtCaster) offset by 100.00 towards (45.00 x (Real((Integer A)))) degrees)
                       [B] Set UltimateNatureCounter = (UltimateNatureCounter + 1)[/B]
                       [B] Destructible - Create a Summer Tree Wall at UltimateOffset[/B] facing (Random angle) with scale 1.00 and variation 0
                       [B] Set UltimateNatureTree[UltimateNatureCounter] = (Last created destructible)[/B]
                        Animation - Play (Last created destructible)'s birth animation
                        Custom script:   call RemoveLocation (udg_UltimateOffset)
                Unit - Add a ((Real((Level of Ultimate nature protection  for (Casting unit)))) x 2.00) second Generic expiration timer to (Last created unit)
                Unit - Add Life Regeneration Aura (Neutral) to UltimateNatureProtCaster
                Unit - Add Mana Regeneration (Neutral) to UltimateNatureProtCaster
                Special Effect - Create a special effect attached to the overhead of UltimateNatureProtCaster using Abilities\Spells\NightElf\Tranquility\TranquilityTarget.mdl
                Set UltimateNatureProtSpec = (Last created special effect)
                Wait ((Real((Level of Ultimate nature protection  for UltimateNatureProtCaster))) x 2.00) seconds
                [B]Destructible - Kill UltimateNatureTree[UltimateNatureCounter][/B]
                Special Effect - Destroy UltimateNatureProtSpec
                Unit - Remove Life Regeneration Aura (Neutral) from UltimateNatureProtCaster
                Unit - Remove Mana Regeneration (Neutral) from UltimateNatureProtCaster
                For each (Integer A) from 0 to 7, do (Actions)
                    Loop - Actions
                        Set UltimateOffset = ((Position of UltimateNatureProtCaster) offset by 100.00 towards (45.00 x (Real((Integer A)))) degrees)
                        Unit - Create 1 Treant for (Owner of UltimateNatureProtCaster) at UltimateOffset facing Default building facing degrees
                        Custom script:   call RemoveLocation (udg_UltimateOffset)
            Else - Actions
 

Knight7770

Hippopotomonstrosesquiped aliophobia
Reaction score
187
Why do you need to use a variable instead of a value for your array? Wouldn't a value work just fine?
 

Larcenist

REP: Respect, Envy, Prosperity?
Reaction score
211
Make something like this:

For each integer 1 to UltimateNatureCounter do actions
Kill - UltimateNatureTree[Integer A]
 

Kazuga

Let the game begin...
Reaction score
110
Well I really suck at arrays, I barely know what they are and even less how to use them properly :p.
 

Knight7770

Hippopotomonstrosesquiped aliophobia
Reaction score
187
Make something like this:

For each integer 1 to UltimateNatureCounter do actions
Kill - UltimateNatureTree[Integer A]
That's very clever...how do you think of things like this?

Well I really suck at arrays, I barely know what they are and even less how to use them properly :p.
Well, arrays are pretty simple to figure out. Basically, a variable is like one square of information. If you make the variable an array, it can become a cube of information. What I mean by this is that when you just have a variable, you can only put one thing into it. But, if it's an array, it can hold multiple pieces of information as long as they're of the same type (integer arrays can't hold units, etc.) They're also useful for other things that I can't think of right now.
 

Larcenist

REP: Respect, Envy, Prosperity?
Reaction score
211
Are you using "For loop integer A" as array for the Tree variable?
 

Knight7770

Hippopotomonstrosesquiped aliophobia
Reaction score
187
Well, if the number of trees created is always the same, you could just make that many actions killing those trees:

Code:
Destructible - Kill UltimateNatureTree[1]
Destructible - Kill UltimateNatureTree[2]
And so on.
 

Kazuga

Let the game begin...
Reaction score
110
Are you using "For loop integer A" as array for the Tree variable?

Code:
Ultimate nature protection
    Events
        Unit - A unit Starts the effect of an ability
    Conditions
        (Ability being cast) Equal to Ultimate nature protection 
    Actions
        Set UltimateNatureCounter = 0
        Set UltimateNatureProtCaster = (Casting unit)
        If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            If - Conditions
            Then - Actions
                For each (Integer A) from 0 to 7, do (Actions)
                    Loop - Actions
                        Set UltimateOffset = ((Position of UltimateNatureProtCaster) offset by 100.00 towards (45.00 x (Real((Integer A)))) degrees)
                        Set UltimateNatureCounter = (UltimateNatureCounter + 1)
                        Destructible - Create a Summer Tree Wall at UltimateOffset facing (Random angle) with scale 1.00 and variation 0
                        Set UltimateNatureTree[UltimateNatureCounter] = (Last created destructible)
                        Animation - Play (Last created destructible)'s birth animation
                        Custom script:   call RemoveLocation (udg_UltimateOffset)
                Unit - Add a ((Real((Level of Ultimate nature protection  for (Casting unit)))) x 2.00) second Generic expiration timer to (Last created unit)
                Unit - Add Life Regeneration Aura (Neutral) to UltimateNatureProtCaster
                Unit - Add Mana Regeneration (Neutral) to UltimateNatureProtCaster
                Special Effect - Create a special effect attached to the overhead of UltimateNatureProtCaster using Abilities\Spells\NightElf\Tranquility\TranquilityTarget.mdl
                Set UltimateNatureProtSpec = (Last created special effect)
                Wait ((Real((Level of Ultimate nature protection  for UltimateNatureProtCaster))) x 2.00) seconds
                For each (Integer A) from 1 to UltimateNatureCounter, do (Actions)
                    Loop - Actions
                        Destructible - Kill UltimateNatureTree[UltimateNatureCounter]
                Special Effect - Destroy UltimateNatureProtSpec
                Unit - Remove Life Regeneration Aura (Neutral) from UltimateNatureProtCaster
                Unit - Remove Mana Regeneration (Neutral) from UltimateNatureProtCaster
                For each (Integer A) from 0 to 7, do (Actions)
                    Loop - Actions
                        Set UltimateOffset = ((Position of UltimateNatureProtCaster) offset by 100.00 towards (45.00 x (Real((Integer A)))) degrees)
                        Unit - Create 1 Treant for (Owner of UltimateNatureProtCaster) at UltimateOffset facing Default building facing degrees
                        Custom script:   call RemoveLocation (udg_UltimateOffset)
            Else - Actions
 

Knight7770

Hippopotomonstrosesquiped aliophobia
Reaction score
187
Code:
Ultimate nature protection
    Events
        Unit - A unit Starts the effect of an ability
    Conditions
        (Ability being cast) Equal to Ultimate nature protection 
    Actions
        Set UltimateNatureCounter = 0
        Set UltimateNatureProtCaster = (Casting unit)
        If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            If - Conditions
            Then - Actions
                For each (Integer A) from 0 to 7, do (Actions)
                    Loop - Actions
                        Set UltimateOffset = ((Position of UltimateNatureProtCaster) offset by 100.00 towards (45.00 x (Real((Integer A)))) degrees)
                        Set UltimateNatureCounter = (UltimateNatureCounter + 1)
                        Destructible - Create a Summer Tree Wall at UltimateOffset facing (Random angle) with scale 1.00 and variation 0
                        Set UltimateNatureTree[[B]UltimateNatureCounter[/B]] = (Last created destructible)
                        Animation - Play (Last created destructible)'s birth animation
                        Custom script:   call RemoveLocation (udg_UltimateOffset)
                Unit - Add a ((Real((Level of Ultimate nature protection  for (Casting unit)))) x 2.00) second Generic expiration timer to (Last created unit)
                Unit - Add Life Regeneration Aura (Neutral) to UltimateNatureProtCaster
                Unit - Add Mana Regeneration (Neutral) to UltimateNatureProtCaster
                Special Effect - Create a special effect attached to the overhead of UltimateNatureProtCaster using Abilities\Spells\NightElf\Tranquility\TranquilityTarget.mdl
                Set UltimateNatureProtSpec = (Last created special effect)
                Wait ((Real((Level of Ultimate nature protection  for UltimateNatureProtCaster))) x 2.00) seconds
                For each (Integer A) from 1 to UltimateNatureCounter, do (Actions)
                    Loop - Actions
                        Destructible - Kill UltimateNatureTree[[B]UltimateNatureCounter[/B]]
                Special Effect - Destroy UltimateNatureProtSpec
                Unit - Remove Life Regeneration Aura (Neutral) from UltimateNatureProtCaster
                Unit - Remove Mana Regeneration (Neutral) from UltimateNatureProtCaster
                For each (Integer A) from 0 to 7, do (Actions)
                    Loop - Actions
                        Set UltimateOffset = ((Position of UltimateNatureProtCaster) offset by 100.00 towards (45.00 x (Real((Integer A)))) degrees)
                        Unit - Create 1 Treant for (Owner of UltimateNatureProtCaster) at UltimateOffset facing Default building facing degrees
                        Custom script:   call RemoveLocation (udg_UltimateOffset)
            Else - Actions
The stuff in bold needs to be Integer A, and not what you have it as.

P.S. to Kazuga: Reply to my PM, if you don't mind
 

Larcenist

REP: Respect, Envy, Prosperity?
Reaction score
211
Code:
Ultimate nature protection
    Events
        Unit - A unit Starts the effect of an ability
    Conditions
        (Ability being cast) Equal to Ultimate nature protection 
    Actions
        Set UltimateNatureCounter = 0
        Set UltimateNatureProtCaster = (Casting unit)
        If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            If - Conditions
            Then - Actions
                For each (Integer A) from 0 to 7, do (Actions)
                    Loop - Actions
                        Set UltimateOffset = ((Position of UltimateNatureProtCaster) offset by 100.00 towards (45.00 x (Real((Integer A)))) degrees)
                        Set UltimateNatureCounter = (UltimateNatureCounter + 1)
                        Destructible - Create a Summer Tree Wall at UltimateOffset facing (Random angle) with scale 1.00 and variation 0
                        Set UltimateNatureTree[UltimateNatureCounter] = (Last created destructible)
                        Animation - Play (Last created destructible)'s birth animation
                        Custom script:   call RemoveLocation (udg_UltimateOffset)
                Unit - Add a ((Real((Level of Ultimate nature protection  for (Casting unit)))) x 2.00) second Generic expiration timer to (Last created unit)
                Unit - Add Life Regeneration Aura (Neutral) to UltimateNatureProtCaster
                Unit - Add Mana Regeneration (Neutral) to UltimateNatureProtCaster
                Special Effect - Create a special effect attached to the overhead of UltimateNatureProtCaster using Abilities\Spells\NightElf\Tranquility\TranquilityTarget.mdl
                Set UltimateNatureProtSpec = (Last created special effect)
                Wait ((Real((Level of Ultimate nature protection  for UltimateNatureProtCaster))) x 2.00) seconds
                For each (Integer A) from 1 to UltimateNatureCounter, do (Actions)
                    Loop - Actions
                       [B] Destructible - Kill UltimateNatureTree[UltimateNatureCounter][/B]
                Special Effect - Destroy UltimateNatureProtSpec
                Unit - Remove Life Regeneration Aura (Neutral) from UltimateNatureProtCaster
                Unit - Remove Mana Regeneration (Neutral) from UltimateNatureProtCaster
                For each (Integer A) from 0 to 7, do (Actions)
                    Loop - Actions
                        Set UltimateOffset = ((Position of UltimateNatureProtCaster) offset by 100.00 towards (45.00 x (Real((Integer A)))) degrees)
                        Unit - Create 1 Treant for (Owner of UltimateNatureProtCaster) at UltimateOffset facing Default building facing degrees
                        Custom script:   call RemoveLocation (udg_UltimateOffset)
            Else - Actions

Bold part should be Destructible - Kill UltimateNatureTree[Integer A]

Edit: Ain't you the fast one knight :3

Edit 2: The first one doesn't have to be Integer A, only the second one.
 

Knight7770

Hippopotomonstrosesquiped aliophobia
Reaction score
187
>Ain't you the fast one knight :3
Well, I try ;)

If you're using Larcenist's method (which you should), you should make sure that the trees get set to the right variables when they're created.

>Edit 2: The first one doesn't have to be Integer A, only the second one.
The first one can be Integer A. It wouldn't hurt.
 

Kazuga

Let the game begin...
Reaction score
110
The stuff in bold needs to be Integer A, and not what you have it as.

P.S. to Kazuga: Reply to my PM, if you don't mind

Hm, can't find "Integer A"...
>P.S. to Kazuga: Reply to my PM, if you don't mind
As Larcenit said, you sure are fast^^ I don't get time enough to read the first pm before you send me another one :p.
 

Knight7770

Hippopotomonstrosesquiped aliophobia
Reaction score
187
Hm, can't find "Integer A"...
>P.S. to Kazuga: Reply to my PM, if you don't mind
As Larcenit said, you sure are fast^^ I don't get time enough to read the first pm before you send me another one :p.
Hehe... I try to be as efficient as possible without wasting time. You should be able to find Integer A, although it might appear as For Loop Integer A or something like that.:nuts:

EDIT: Urgh...beaten to it.
 
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