Stupid Locust..

Exide

I am amazingly focused right now!
Reaction score
448
I came to think about Dota. There's a spell there 'Elune's Arrow', I think it's called. -Which shoots an arrow from the shooter in a straight line, until it hits an enemy. Then stuns the enemy according to how far the arrow travelled, max 5 seconds stun.
I figured that arrow must be a Locust, and is pretty much the same that I want here (except for the stun part).
Does anyone know how to make an Elune's Arrow trigger? :p
 

vypur85

Hibernate
Reaction score
803
I think it's just a typical sliding trigger which detects AOE units around it. If there is a unit, then the arrow will be removed and a dummy is created to stun the detected unit.

A Locust unit can detect non-Locust unit around it. But you cannot detect Locust unit around a non-Locust unit.

So what you want to do with the spell actually?
 

Exide

I am amazingly focused right now!
Reaction score
448
What I want is a room full of "traps".
At one point (Point A) there's a ward-like tower (just for decoration, really): which shoots Lightning bolts (Lightning Balls, rather) towards Point B.
The Hero (Player's unit) is supposed to get through this room alive. Should he get hit by a lightning bolt, he will take 50 damage, and the Lightning Bolt will be removed. -There will also be a Thunderclap special effect, where the hero stood.

If the lightning bolts doesn't hit anything, and reach Point B - they will be removed from the game.
I have a simple trigger that works, as long as the Lightning bolts IS NOT a locust. But then the player can select the lightning bolt, and the lightning bolt also has a hp bar.

I want some sort of a Elune's Arrow (that looks like a lightning ball, instead of that arrow) that fires every X second from point A towards point B.
-To further complicate things, I have several point A and several point B.
 

vypur85

Hibernate
Reaction score
803
I've created something similar to Elune's Arrow. Just without the stun (this can also be done by detecting the custom value of the dummy unit and set the level accordingly using modulus). It's MUI and in GUI. Should be leakless.
 

Attachments

  • Elune's Arrow.w3x
    19.7 KB · Views: 171

Exide

I am amazingly focused right now!
Reaction score
448
That is awesome!
But how can I merge it with my spawn trigger in Post #11?
Or, could I add this ability to the ward (decoration) units, and order them to 'every X -use your ability-'?
-They fire towards different points, so I guess I would need a lot of if/then/else's..


EDIT:
Ok, it nearly works now. :p
I must've done something wrong, though, because my locust missile unit only moves towars 90 degrees. (Probably some trigger that I re-wrote wrong.)
Also, is there a way to slow this unit down? As it is now, it'll be impossible to dodge. :p
 

vypur85

Hibernate
Reaction score
803
For casting ability method:
Code:
Using Ability
    Events
        Unit - A unit Starts the effect of an ability
    Conditions
        (Ability being cast) Equal to Abi_Elune_EluneArrow
    Actions
        Set Pt_Elune_TriggerPos = (Position of (Triggering unit))
        Set Pt_Elune_TargetPos = (Target point of ability being cast)
        Unit - Create 1 UnitType_Elune_Dummy for (Owner of (Triggering unit)) at Pt_Elune_TriggerPos facing (Angle from Pt_Elune_TriggerPos to Pt_Elune_TargetPos) degrees
        Unit - Turn collision for (Last created unit) Off
        Unit - Add Abi_Elune_EluneArrow to (Last created unit)
        Unit - Set level of Abi_Elune_EluneArrow for (Last created unit) to (Level of Abi_Elune_EluneArrow for (Triggering unit))
        Unit Group - Add (Last created unit) to Unitgp_Elune_Dummy
        Trigger - Turn on Movement <gen>
        Custom script:   call RemoveLocation (udg_Pt_Elune_TriggerPos)
        Custom script:   call RemoveLocation (udg_Pt_Elune_TargetPos)

For Attack Method:
Code:
Using Attack
    Events
        Unit - A unit Is attacked
    Conditions
        (Unit-type of ([B]Attacking unit[/B])) Equal to Footman <-- [I]Change this is the attached map, did some mistake. Lazy to re-upload again. :P[/I]
    Actions
        Set Pt_Elune_TriggerPos = (Position of (Attacking unit))
        Set Pt_Elune_TargetPos = (Position of (Triggering unit))
        Unit - Create 1 UnitType_Elune_Dummy for (Owner of (Attacking unit)) at Pt_Elune_TriggerPos facing (Angle from Pt_Elune_TriggerPos to Pt_Elune_TargetPos) degrees
        Unit - Turn collision for (Last created unit) Off
        Unit - Add Abi_Elune_EluneArrow to (Last created unit)
        Unit - Set level of Abi_Elune_EluneArrow for (Last created unit) to (Level of Abi_Elune_EluneArrow for (Attacking unit))
        Unit Group - Add (Last created unit) to Unitgp_Elune_Dummy
        Trigger - Turn on Movement <gen>
        Custom script:   call RemoveLocation (udg_Pt_Elune_TriggerPos)
        Custom script:   call RemoveLocation (udg_Pt_Elune_TargetPos)

For Periodic Spawn Method:
Code:
Using Periodic
    Events
        Time - Every 2.00 seconds of game time
    Conditions
    Actions
        Unit Group - Pick every unit in (Units in (Playable map area) matching ((Unit-type of (Matching unit)) Equal to Footman)) and do (Actions)
            Loop - Actions
                Set Pt_Elune_TriggerPos = (Position of (Picked unit))
                Set Pt_Elune_TargetPos = (Pt_Elune_TriggerPos offset by 256.00 towards (Random angle) degrees)
                Unit - Create 1 UnitType_Elune_Dummy for (Owner of (Picked unit)) at Pt_Elune_TriggerPos facing (Angle from Pt_Elune_TriggerPos to Pt_Elune_TargetPos) degrees
                Unit - Turn collision for (Last created unit) Off
                Unit - Add Abi_Elune_EluneArrow to (Last created unit)
                Unit - Set level of Abi_Elune_EluneArrow for (Last created unit) to (Level of Abi_Elune_EluneArrow for (Picked unit))
                Unit Group - Add (Last created unit) to Unitgp_Elune_Dummy
                Trigger - Turn on Movement <gen>
                Custom script:   call RemoveLocation (udg_Pt_Elune_TriggerPos)
                Custom script:   call RemoveLocation (udg_Pt_Elune_TargetPos)

It depends on how you manipulate the points. See the above 3 given examples. See how the Pt_Elune_TriggerPos and Pt_Elune_TargetPos change according to the event. Make sure which is attacking unit and picked unit and etc, and the trigger will work fine. And make sure the dummy facing is what you intend it to be.

The most important trigger is this case is the periodic Movement trigger. Everytime you create a dummy, just add it into the Movement periodic trigger to the Unitgp_Elune_Dummy. Once added, everything will become automatic.

The trigger is quite easy to implement, I think.

Hope you understand what I've crabbed. :)

Edit:
> Also, is there a way to slow this unit down? As it is now, it'll be impossible to dodge.
Increase the periodic trigger to 0.03 or 0.04.

OR

Change this:
Code:
Set Pt_Elune_TargetPos = (Pt_Elune_DummyPos [B]offset by 10.00 towards[/B] (Facing of (Picked unit)) degrees)

to this:
Code:
Set Pt_Elune_TargetPos = (Pt_Elune_DummyPos [B]offset by 5.00 towards[/B] (Facing of (Picked unit)) degrees)

You should be able to imagine what difference could it make :).
 

Attachments

  • Elune's Arrow.w3x
    21.1 KB · Views: 155

Exide

I am amazingly focused right now!
Reaction score
448
Ok, I'm gonna throw a bunch of triggers at you. :p (I nearly got it to work now.)

So here we go, the first triggers are working (some are yours):
Code:
Start
    Events
        Unit - A unit Starts the effect of an ability
    Conditions
        (Ability being cast) Equal to Lightning Bolt 
    Actions
        Set LB_Point = (Position of (Triggering unit))
        Set LB_Point_Target = (Target point of ability being cast)
        Unit - Create 1 LightningBolt for (Owner of (Triggering unit)) at LB_Point facing (Angle from LB_Point to LB_Point_Target) degrees
        Unit - Turn collision for (Last created unit) Off
        Unit - Add Lightning Bolt  to (Last created unit)
        Unit - Set level of Lightning Bolt  for (Last created unit) to (Level of Lightning Bolt  for (Triggering unit))
        Unit Group - Add (Last created unit) to LB_UnitGroup
        Trigger - Turn on Movement <gen>
        Custom script:   call RemoveLocation (udg_LB_Point)
        Custom script:   call RemoveLocation (udg_LB_Point_Target)

Code:
Movement
    Events
        Time - Every 0.01 seconds of game time  //Will change this later, after reading your last post. =)
    Conditions
    Actions
        Unit Group - Pick every unit in LB_UnitGroup and do (Actions)
            Loop - Actions
                Set LB_Point = (Position of (Picked unit))
                Set LB_Point_Target = (LB_Point offset by 10.00 towards (Facing of (Picked unit)) degrees)
                Unit - Move (Picked unit) instantly to LB_Point_Target
                Unit - Set the custom value of (Picked unit) to ((Custom value of (Picked unit)) + 1)
                Set LB_UnitGroup_AOE = (Units within 100.00 of LB_Point matching ((((Matching unit) belongs to an enemy of (Owner of (Picked unit))) Equal to True) and ((((Matching unit) is A structure) Equal to False) and (((Matching unit) is alive) Equal to True))))
                If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    If - Conditions
                        (Number of units in LB_UnitGroup_AOE) Not equal to 0
                    Then - Actions
                        Set LB_TargetUnit = (Random unit from LB_UnitGroup_AOE)
                        Unit - Cause (Picked unit) to damage LB_TargetUnit, dealing (50.00 x (Real((Level of Lightning Bolt  for (Picked unit))))) damage of attack type Chaos and damage type Lightning
                        Set specloc = (Position of LB_TargetUnit)
                        Special Effect - Create a special effect at specloc using Abilities\Spells\Human\ThunderClap\ThunderClapCaster.mdl
                        Special Effect - Destroy (Last created special effect)
                        Unit - Remove (Picked unit) from the game
                        Custom script:   call RemoveLocation (udg_specloc)
                    Else - Actions
                Custom script:   call DestroyGroup (udg_LB_UnitGroup_AOE)
                If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    If - Conditions
                        (Custom value of (Picked unit)) Greater than or equal to 130
                    Then - Actions
                        Unit - Remove (Picked unit) from the game
                        Special Effect - Create a special effect at LB_Point using Abilities\Weapons\FarseerMissile\FarseerMissile.mdl
                        Special Effect - Destroy (Last created special effect)
                    Else - Actions
                Custom script:   call RemoveLocation (udg_LB_Point)
                Custom script:   call RemoveLocation (udg_LB_Point_Target)
        If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            If - Conditions
                (Number of units in LB_UnitGroup) Equal to 0
            Then - Actions
                Trigger - Turn off (This trigger)
            Else - Actions

This one is quite obvious.. :p
Code:
Turn on Traps
    Events
        Unit - A unit enters Turn on Traps <gen>
    Conditions
        ((Triggering unit) is A Hero) Equal to True
    Actions
        Trigger - Turn off (This trigger)
        Trigger - Turn on Lightning Bolts Spawn <gen>

Code:
Trap Remove Unit
    Events
        Unit - A unit enters Trap loc2 <gen>
        Unit - A unit enters Trap loc4 <gen>
        Unit - A unit enters Trap loc6 <gen>
        Unit - A unit enters Trap loc8 <gen>
        Unit - A unit enters Trap loc10 <gen>
        Unit - A unit enters Trap loc12 <gen>
        Unit - A unit enters Trap loc14 <gen>
        Unit - A unit enters Trap loc16 <gen>
    Conditions
        (Unit-type of (Triggering unit)) Equal to Lightning Bolt
    Actions
        Unit - Remove (Triggering unit) from the game


Here's the one that doesn't quite work: (I changed to 'Base Order ID' of the Elune Arrow (Lightning Bolts) spell to: 'tornado'.)

Code:
Lightning Bolts Spawn
    Events
        Time - Every (Random real number between 0.60 and 1.50) seconds of game time
    Conditions
    Actions
        Set TempGroup = (Units of type Lightning Tower)
        Custom script:   set bj_wantDestroyGroup=true
        Unit Group - Pick every unit in (Random 1 units from TempGroup) and do (Actions)
            Loop - Actions
                If ((Trap loc1 <gen> contains (Picked unit)) Equal to True) then do (Set LB_Spell_Loc = (Center of Trap loc2 <gen>)) else do (Do nothing)
                If ((Trap loc3 <gen> contains (Picked unit)) Equal to True) then do (Set LB_Spell_Loc = (Center of Trap loc4 <gen>)) else do (Do nothing)
                If ((Trap loc5 <gen> contains (Picked unit)) Equal to True) then do (Set LB_Spell_Loc = (Center of Trap loc6 <gen>)) else do (Do nothing)
                If ((Trap loc7 <gen> contains (Picked unit)) Equal to True) then do (Set LB_Spell_Loc = (Center of Trap loc8 <gen>)) else do (Do nothing)
                If ((Trap loc9 <gen> contains (Picked unit)) Equal to True) then do (Set LB_Spell_Loc = (Center of Trap loc10 <gen>)) else do (Do nothing)
                If ((Trap loc11 <gen> contains (Picked unit)) Equal to True) then do (Set LB_Spell_Loc = (Center of Trap loc12 <gen>)) else do (Do nothing)
                If ((Trap loc13 <gen> contains (Picked unit)) Equal to True) then do (Set LB_Spell_Loc = (Center of Trap loc14 <gen>)) else do (Do nothing)
                If ((Trap loc15 <gen> contains (Picked unit)) Equal to True) then do (Set LB_Spell_Loc = (Center of Trap loc16 <gen>)) else do (Do nothing)
                Unit - Order (Picked unit) to Neutral Naga Sea Witch - Tornado LB_Spell_Loc
                Custom script:   call RemoveLocation(udg_LB_Spell_Loc)
        Custom script:   call DestroyGroup(udg_TempGroup)
The idea of this trigger is to check where the unit I pick is, and then order it to shoot the "Elune's Arrow" towards it's oposing region.

Any ideas?
 

vypur85

Hibernate
Reaction score
803
Mind posting the map? (Guess you mind :p but still try my luck)

It's kinda hard to do what you want without having the actual working region and units.

But from what I can see, you can just use my 'Periodic spawn method'. It will pick all 'towers' and create dummy at their position. As for the end point, you can array the regions and create according to the position of the towers. Quite hard to understand isn't it >.<".
 

Exide

I am amazingly focused right now!
Reaction score
448
Well, the triggers seems allright. It's just.. nothing happens. :p

So yea, I deleted all irrelevant triggers, and kept only the ones needed:

Code:
Using Periodic
    Events
        Time - Every 2.00 seconds of game time
    Conditions
    Actions
        Custom script:   set bj_wantDestroyGroup=true
        Unit Group - Pick every unit in (Units of type Lightning Tower) and do (Actions)
            Loop - Actions
                Set LB_Point = (Position of (Picked unit))
                Set LB_Point_Target = (LB_Point offset by 10.00 towards (Facing of (Picked unit)) degrees)
                Unit - Create 1 Lightning Bolt for (Owner of (Picked unit)) at LB_Point facing (Angle from LB_Point to LB_Point_Target) degrees
                Unit - Turn collision for (Last created unit) Off
                Unit Group - Add (Last created unit) to LB_UnitGroup
                Trigger - Turn on Movement <gen>
                Custom script:   call RemoveLocation (udg_LB_Point)
                Custom script:   call RemoveLocation (udg_LB_Point_Target)

Code:
Movement
    Events
        Time - Every 0.01 seconds of game time
    Conditions
    Actions
        Unit Group - Pick every unit in LB_UnitGroup and do (Actions)
            Loop - Actions
                Set LB_Point = (Position of (Picked unit))
                Set LB_Point_Target = (LB_Point offset by 10.00 towards (Facing of (Picked unit)) degrees)
                Unit - Move (Picked unit) instantly to LB_Point_Target
                Unit - Set the custom value of (Picked unit) to ((Custom value of (Picked unit)) + 1)
                Set LB_UnitGroup_AOE = (Units within 100.00 of LB_Point matching ((((Matching unit) belongs to an enemy of (Owner of (Picked unit))) Equal to True) and ((((Matching unit) is A structure) Equal to False) and (((Matching unit) is alive) Equal to True))))
                If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    If - Conditions
                        (Number of units in LB_UnitGroup_AOE) Not equal to 0
                    Then - Actions
                        Set LB_TargetUnit = (Random unit from LB_UnitGroup_AOE)
                        Unit - Cause (Picked unit) to damage LB_TargetUnit, dealing (50.00 x (Real((Level of Lightning Bolt  for (Picked unit))))) damage of attack type Chaos and damage type Lightning
                        Set specloc = (Position of LB_TargetUnit)
                        Special Effect - Create a special effect at specloc using Abilities\Spells\Human\ThunderClap\ThunderClapCaster.mdl
                        Special Effect - Destroy (Last created special effect)
                        Unit - Remove (Picked unit) from the game
                        Custom script:   call RemoveLocation (udg_specloc)
                    Else - Actions
                Custom script:   call DestroyGroup (udg_LB_UnitGroup_AOE)
                If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    If - Conditions
                        (Custom value of (Picked unit)) Greater than or equal to 130
                    Then - Actions
                        Unit - Remove (Picked unit) from the game
                        Special Effect - Create a special effect at LB_Point using Abilities\Weapons\FarseerMissile\FarseerMissile.mdl
                        Special Effect - Destroy (Last created special effect)
                    Else - Actions
                Custom script:   call RemoveLocation (udg_LB_Point)
                Custom script:   call RemoveLocation (udg_LB_Point_Target)
        If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            If - Conditions
                (Number of units in LB_UnitGroup) Equal to 0
            Then - Actions
                Trigger - Turn off (This trigger)
            Else - Actions

I'm guessing that in 'Using Periodic', the units can't be picked, because they are Locust as well.. (stupid locust :banghead:)
I thought I read AceHart saying Locust can be picked with 'units of type', though.. -Unless I misunderstood that, then 'Using Periodic' isn't responsible. Then I don't know what is, because there are no other triggers that affect these things.

I'll try to remove Locust from the wards/towers, and see what happens..
EDIT: Nope, nothing happened.
Maybe I could just spawn the "arrows" in the region that the wards are in? :p
 

vypur85

Hibernate
Reaction score
803
> I thought I read AceHart saying Locust can be picked with 'units of type'

It's true. The trigger seems workable. Not sure why it doesn't work. No dummies spawned at all? Did you turn on the periodic spawn trigger? Put in Game Text to see whether the trigger runs or not. Put in the loop as well to see if the loop really looped or not.
 

Exide

I am amazingly focused right now!
Reaction score
448
Yea.
I then even added a Quest message saying 'Woo!' everytime the trigger runs.
I didn't see a single message. :(

I have this trigger, which spawns the "Towers":

JASS:

function Trig_Castle_Spawn_Units_Actions takes nothing returns nothing
    local location array spawnloc
    local integer loopstart = 1

    set spawnloc[1] = GetRectCenter(gg_rct_Trap_loc1)
    set spawnloc[2] = GetRectCenter(gg_rct_Trap_loc3)
    set spawnloc[3] = GetRectCenter(gg_rct_Trap_loc8)
    set spawnloc[4] = GetRectCenter(gg_rct_Trap_loc10)
    set spawnloc[5] = GetRectCenter(gg_rct_Trap_loc11)
    set spawnloc[6] = GetRectCenter(gg_rct_Trap_loc14)
    set spawnloc[7] = GetRectCenter(gg_rct_Trap_loc15)
    
    set spawnloc[8] = GetRectCenter(gg_rct_Trap_loc2)
    set spawnloc[9] = GetRectCenter(gg_rct_Trap_loc4)
    set spawnloc[10] = GetRectCenter(gg_rct_Trap_loc7)
    set spawnloc[11] = GetRectCenter(gg_rct_Trap_loc9)
    set spawnloc[12] = GetRectCenter(gg_rct_Trap_loc12)
    set spawnloc[13] = GetRectCenter(gg_rct_Trap_loc13)
    set spawnloc[14] = GetRectCenter(gg_rct_Trap_loc16)
    
    set spawnloc[15] = GetRectCenter(gg_rct_Trap_loc5)
    set spawnloc[16] = GetRectCenter(gg_rct_Trap_loc6)


    loop
        exitwhen loopstart &gt; 7
        call CreateNUnitsAtLoc( 1, &#039;h00X&#039;, Player(2), spawnloc[loopstart], 270.00 )
        set udg_RemoveUnits[loopstart] = GetLastCreatedUnit()
        set loopstart = loopstart + 1
    endloop
    
    loop
        exitwhen loopstart &gt; 14
        call CreateNUnitsAtLoc( 1, &#039;h00X&#039;, Player(2), spawnloc[loopstart], 90.00 )
        set udg_RemoveUnits[loopstart] = GetLastCreatedUnit()
        set loopstart = loopstart + 1
    endloop
    
    call CreateNUnitsAtLoc( 1, &#039;h00X&#039;, Player(2), spawnloc[15], 0.00 )
    set udg_RemoveUnits[15] = GetLastCreatedUnit()
    call CreateNUnitsAtLoc( 1, &#039;h00X&#039;, Player(2), spawnloc[16], 180.00 )
    set udg_RemoveUnits[16] = GetLastCreatedUnit()
    
    set loopstart = 1
    loop
        exitwhen loopstart &gt; 16
        call RemoveLocation(spawnloc[loopstart])
        set spawnloc[loopstart] = null
        set loopstart = loopstart + 1
    endloop
    
endfunction

//===========================================================================
function InitTrig_Castle_Spawn_Units takes nothing returns nothing
    set gg_trg_Castle_Spawn_Units = CreateTrigger(  )
    call DisableTrigger( gg_trg_Castle_Spawn_Units )
    call TriggerAddAction( gg_trg_Castle_Spawn_Units, function Trig_Castle_Spawn_Units_Actions )
endfunction


They do spawn properly, but no "Arrows"..

EDIT: I managed to spawn some units. :p
I got terribly spammed my the 'Woo!' message, and I believe I made a terrible leak. -Also ALL towers fired at the same time, I would prefer if they fire more randomly. But at the moment, I'm happy they fired at all.

So what I did?
I added a loop like this:
Code:
For each (Integer A) from 1 to 16, do (Actions)
    Loop - Actions
        Unit Group - Add RemoveUnits[(Integer A)] to TempGroup

Then used this:

Code:
Unit Group - Pick every unit in TempGroup and do (Actions)
    Loop - Actions
        Quest - Display to (All players) the Quest Update message: Woo!
        ...The other actions..
 

vypur85

Hibernate
Reaction score
803
>I then even added a Quest message saying 'Woo!' everytime the trigger runs.

In the loop or outside the loop. If outside the loop then the trigger is not turned on (duh).

If inside the loop, then the unit is not picked. Did you pick the correct unit type? Try it with another unit without locust. Say, a Footman, then place it randomly in your map. And turn on the spawn trigger. It should work. (At least mine did :p)
 

Exide

I am amazingly focused right now!
Reaction score
448
Would this leak?

Code:
Using Periodic
    Events
        Time - Every 2.00 seconds of game time
    Conditions
    Actions
        For each (Integer A) from 1 to 16, do (Actions)
            Loop - Actions
                Unit Group - Add RemoveUnits[(Integer A)] to TempGroup
        Unit Group - Pick every unit in TempGroup and do (Actions)
            Loop - Actions
                Set LB_Point = (Position of (Picked unit))
                Set LB_Point_Target = (LB_Point offset by 10.00 towards (Facing of (Picked unit)) degrees)
                Unit - Create 1 Lightning Bolt for (Owner of (Picked unit)) at LB_Point facing (Angle from LB_Point to LB_Point_Target) degrees
                Unit - Turn collision for (Last created unit) Off
                Unit Group - Add (Last created unit) to LB_UnitGroup
                Trigger - Turn on Movement <gen>
                Custom script:   call RemoveLocation (udg_LB_Point)
                Custom script:   call RemoveLocation (udg_LB_Point_Target)
        Custom script:   call DestroyGroup(udg_TempGroup)
 

vypur85

Hibernate
Reaction score
803
Code:
        For each (Integer A) from 1 to 16, do (Actions)
            Loop - Actions
                Unit Group - Add RemoveUnits[(Integer A)] to TempGroup

Do this in Map Init. Or where you create these units.

Code:
Unit - Create 1 XXX at somewhere etc etc
Unit Group - Add Last created unit to TempGroup

If the units are preplaced, then use the integer loop instead.

In Map Init, that is...



Or just use the loop immediately and remove the Unit Group altogether:
Code:
        For each (Integer A) from 1 to 16, do (Actions)
            Loop - Actions
                Set LB_Point = (Position of RemoveUnits[(Integer A)]
                Set LB_Point_Target = (LB_Point offset by 10.00 towards (Facing of RemoveUnits[(Integer A)] degrees)
                Unit - Create 1 Lightning Bolt for (Owner of RemoveUnits[(Integer A)]) at LB_Point facing (Angle from LB_Point to LB_Point_Target) degrees
                Unit - Turn collision for (Last created unit) Off
                Unit Group - Add (Last created unit) to LB_UnitGroup
                Trigger - Turn on Movement <gen>
                Custom script:   call RemoveLocation (udg_LB_Point)
                Custom script:   call RemoveLocation (udg_LB_Point_Target)
 

Exide

I am amazingly focused right now!
Reaction score
448
That's awesome! :)
It works. :D

Now. :p
Is there a way to make the towers fire more randomly?
As of now, they all fire at the same time. I'd like them to fire "whenever they feel like it". :p
EDIT #2: Oh, and while we're at it.. Some of the towers won't fire at all, since they're standing on the "recieving end" - in one of the regions which automatically removes the Lightning Bolt unit from the game. -Is there a way we could exclude them from the whole periodic spawn trigger?

EDIT: I can't give you +rep again, so I hope someone else will.
 

vypur85

Hibernate
Reaction score
803
Code:
        For each (Integer A) from 1 to 16, do (Actions)
            Loop - Actions
[B]                Set TempGroup = All units within XX range RemoveUnits[(Integer A)]
                If then else
                    Condition
                        Number of units in TempGroup Not equal to 0[/B]
                    Then
                        Set LB_Point = (Position of RemoveUnits[(Integer A)]
                        Set LB_Point_Target = (LB_Point offset by 10.00 towards (Facing of RemoveUnits[(Integer A)] degrees)
                        Unit - Create 1 Lightning Bolt for (Owner of RemoveUnits[(Integer A)]) at LB_Point facing (Angle from LB_Point to LB_Point_Target) degrees
                        Unit - Turn collision for (Last created unit) Off
                        Unit Group - Add (Last created unit) to LB_UnitGroup
                        Trigger - Turn on Movement <gen>
                        Custom script:   call RemoveLocation (udg_LB_Point)
                        Custom script:   call RemoveLocation (udg_LB_Point_Target)
                    Else

You get the point :).


Or

Use regions to activate them. It's up to you. Play around with conditions.

Edit: This would be my last post for today~

>EDIT #2
Remove the regions. Calculate the distance. Adjust the custom value to change the max distance traveled. Ok. Gtg. Sleep. :) See you again tomorrow if there are more questions.
 

Exide

I am amazingly focused right now!
Reaction score
448
I'll try that.
Thanks a lot for your help. :) :thup:
 
General chit-chat
Help Users
  • No one is chatting at the moment.

      The Helper Discord

      Members online

      No members online now.

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials

      Network Sponsors

      Apex Steel Pipe - Buys and sells Steel Pipe.
      Top