Region / pathing Problems

I

ilida76

Guest
RED = Variable
GREEN = Custom Script

Code:
Region Initialization
    Events
        Map initialization
    Conditions
    Actions
        Set [COLOR="Red"]regionArray[10][/COLOR] = Mob Spawn 1 <gen>
        Set [COLOR="red"]regionArray[11][/COLOR] = Spawn 1 A <gen>
        Set [COLOR="red"]regionArray[12][/COLOR] = Spawn 1 B <gen>
        Set [COLOR="red"]regionArray[13][/COLOR] = Spawn 1 C <gen>
        Set [COLOR="red"]regionArray[14][/COLOR] = Spawn 1 D <gen>
        Set [COLOR="red"]regionArray[15][/COLOR] = Spawn 1 Ending <gen>
        Set [COLOR="red"]regionArray[20][/COLOR] = Mob Spawn 2 <gen>
        Set [COLOR="red"]regionArray[21][/COLOR] = Spawn 2 A <gen>
        Set [COLOR="Red"]regionArray[22][/COLOR] = Spawn 2 B <gen>
        Set [COLOR="red"]regionArray[23][/COLOR] = Spawn 2 C <gen>
        Set [COLOR="red"]regionArray[24][/COLOR] = Spawn 2 D <gen>
        Set [COLOR="red"]regionArray[25][/COLOR] = Spawn 2 Ending <gen>
        Set [COLOR="red"]regionArray[30][/COLOR] = Mob Spawn 3 <gen>
        Set [COLOR="red"]regionArray[31][/COLOR] = Spawn 3 A <gen>
        Set [COLOR="red"]regionArray[32][/COLOR] = Spawn 3 B <gen>
        Set [COLOR="red"]regionArray[33][/COLOR] = Spawn 3 C <gen>
        Set [COLOR="red"]regionArray[34[/COLOR]] = Spawn 3 D <gen>
        Set [COLOR="red"]regionArray[35][/COLOR] = Spawn 3 Ending <gen>
        Set [COLOR="red"]regionArray[40][/COLOR] = Mob Spawn 4 <gen>
        Set [COLOR="red"]regionArray[41][/COLOR] = Spawn 4 A <gen>
        Set [COLOR="red"]regionArray[42][/COLOR] = Spawn 4 B <gen>
        Set [COLOR="red"]regionArray[43][/COLOR] = Spawn 4 C <gen>
        Set [COLOR="red"]regionArray[44][/COLOR] = Spawn 4 D <gen>
        Set [COLOR="red"]regionArray[45][/COLOR] = Spawn 4 Ending <gen>
        Set [COLOR="red"]regionArray[50][/COLOR] = Mob Spawn 5 <gen>
        Set [COLOR="red"]regionArray[51][/COLOR] = Spawn 5 A <gen>
        Set [COLOR="red"]regionArray[52][/COLOR] = Spawn 5 B <gen>
        Set [COLOR="red"]regionArray[53][/COLOR] = Spawn 5 C <gen>
        Set [COLOR="red"]regionArray[54][/COLOR] = Spawn 5 D <gen>
        Set [COLOR="red"]regionArray[55][/COLOR] = Spawn 5 Ending <gen>
        Set [COLOR="red"]regionArray[60][/COLOR] = Mob Spawn 6 <gen>
        Set [COLOR="red"]regionArray[61][/COLOR] = Spawn 6 A <gen>
        Set [COLOR="red"]regionArray[62][/COLOR] = Spawn 6 B <gen>
        Set [COLOR="red"]regionArray[63][/COLOR] = Spawn 6 C <gen>
        Set [COLOR="red"]regionArray[64][/COLOR] = Spawn 6 D <gen>
        Set [COLOR="red"]regionArray[65][/COLOR] = Spawn 6 Ending <gen>
        Set [COLOR="red"]regionArray[70][/COLOR] = Mob Spawn 7 <gen>
        Set [COLOR="red"]regionArray[71][/COLOR] = Spawn 7 A <gen>
        Set [COLOR="red"]regionArray[72][/COLOR] = Spawn 7 B <gen>
        Set [COLOR="red"]regionArray[73][/COLOR] = Spawn 7 C <gen>
        Set [COLOR="red"]regionArray[74][/COLOR] = Spawn 7 D <gen>
        Set [COLOR="red"]regionArray[75][/COLOR] = Spawn 7 Ending <gen>
        Set [COLOR="red"]regionArray[80][/COLOR] = Mob Spawn 8 <gen>
        Set [COLOR="red"]regionArray[81][/COLOR] = Spawn 8 A <gen>
        Set [COLOR="red"]regionArray[82][/COLOR] = Spawn 8 B <gen>
        Set [COLOR="red"]regionArray[83][/COLOR] = Spawn 8 C <gen>
        Set [COLOR="red"]regionArray[84][/COLOR] = Spawn 8 D <gen>
        Set [COLOR="red"]regionArray[85][/COLOR] = Spawn 8 Ending <gen>

Changed up the Region Array's to make them more simple (the numbers)

Code:
Region Spawn Path
    Events
        Unit - A unit enters Mob Spawn 1 <gen>
        Unit - A unit enters Spawn 1 A <gen>
        Unit - A unit enters Spawn 1 B <gen>
        Unit - A unit enters Spawn 1 C <gen>
        Unit - A unit enters Spawn 1 D <gen>
        Unit - A unit enters Spawn 1 Ending <gen>
        Unit - A unit enters Mob Spawn 2 <gen>
        Unit - A unit enters Spawn 2 A <gen>
        Unit - A unit enters Spawn 2 B <gen>
        Unit - A unit enters Spawn 2 C <gen>
        Unit - A unit enters Spawn 2 D <gen>
        Unit - A unit enters Spawn 2 Ending <gen>
        Unit - A unit enters Mob Spawn 3 <gen>
        Unit - A unit enters Spawn 3 A <gen>
        Unit - A unit enters Spawn 3 B <gen>
        Unit - A unit enters Spawn 3 C <gen>
        Unit - A unit enters Spawn 3 D <gen>
        Unit - A unit enters Spawn 3 Ending <gen>
        Unit - A unit enters Mob Spawn 4 <gen>
        Unit - A unit enters Spawn 4 A <gen>
        Unit - A unit enters Spawn 4 B <gen>
        Unit - A unit enters Spawn 4 C <gen>
        Unit - A unit enters Spawn 4 D <gen>
        Unit - A unit enters Spawn 4 Ending <gen>
        Unit - A unit enters Mob Spawn 5 <gen>
        Unit - A unit enters Spawn 5 A <gen>
        Unit - A unit enters Spawn 5 B <gen>
        Unit - A unit enters Spawn 5 C <gen>
        Unit - A unit enters Spawn 5 D <gen>
        Unit - A unit enters Spawn 5 Ending <gen>
        Unit - A unit enters Mob Spawn 6 <gen>
        Unit - A unit enters Spawn 6 A <gen>
        Unit - A unit enters Spawn 6 B <gen>
        Unit - A unit enters Spawn 6 C <gen>
        Unit - A unit enters Spawn 6 D <gen>
        Unit - A unit enters Spawn 6 Ending <gen>
        Unit - A unit enters Mob Spawn 7 <gen>
        Unit - A unit enters Spawn 7 A <gen>
        Unit - A unit enters Spawn 7 B <gen>
        Unit - A unit enters Spawn 7 C <gen>
        Unit - A unit enters Spawn 7 D <gen>
        Unit - A unit enters Spawn 7 Ending <gen>
        Unit - A unit enters Mob Spawn 8 <gen>
        Unit - A unit enters Spawn 8 A <gen>
        Unit - A unit enters Spawn 8 B <gen>
        Unit - A unit enters Spawn 8 C <gen>
        Unit - A unit enters Spawn 8 D <gen>
        Unit - A unit enters Spawn 8 Ending <gen>
    Conditions
        (Owner of (Triggering unit)) Equal to [COLOR="red"]hostileCreeps[/COLOR]
    Actions
        Unit - Set the custom value of (Triggering unit) to ((Custom value of (Triggering unit)) + 1)
        Set [COLOR="red"]tmpPoint[/COLOR] = (Center of [COLOR="red"]regionArray[/COLOR][(Custom value of (Triggering unit))])
        Unit - Order (Triggering unit) to Move To [COLOR="Red"]tmpPoint[/COLOR]
        [COLOR="SeaGreen"]Custom script: call RemoveLocation( udg_tmpPoint )[/COLOR]


Alright, pretty much here, I have 8 spawns (8 seperate regions) from the middle, and they have pathing points to go outwards toward the sides of the map (the Ending Regions (where you lose lives)) and there are A, B, C, and D regions between these 2 region points to keep them on the pathing.

My units all spawn from the 8 seperate regions, BUT, when they do, they only follow the path that was given to them in the Spawn 1 --> 1A --> 1B --> 1C --> 1D --> 1Ending, (all 8 spawn points),

the problem is that the spawns 2-8 are not following their own paths (Spawn 2 --> 2A --> 2B --> 2C --> 2D --> 2Ending (same w/ the other spawns 3-8))

any one understand why? possbily I should copy some of my variables? and set them differently?.

my guess is that it is somewhere in the Actions part in the Trigger 2, with the custom values, but im not sure how I'd fix it.

WHAT I WANT

WHAT I GET

Thanks in advance
 

GooS

Azrael
Reaction score
154
Well first of all I would just like to say, DAMN most events I've seen in my life.


Secondly, Why shouldn't they to the same point? I see nothing that prevents it or changes the point to which they should move.

Code:
Unit - Set the custom value of (Triggering unit) to ((Custom value of (Triggering unit)) + 1)

Probably always sets the custom value to 1

Code:
Set tmpPoint = (Center of regionArray[(Custom value of (Triggering unit))])

Hence all units will move to regionArray[1], being Spawn 1 A <gen>

This is atleast what I can see, I might be wrong but as the triggering units custom value does not increase as you want it to do. Theres always a new triggering unit without a custom value so it always equals 1
 
I

ilida76

Guest
ahh i see, any idea on how to fix it? lol. im gonna mess around w/ it n see what i can do, but if neone knows exactly, please tell :)
 

GooS

Azrael
Reaction score
154
Sry beats me with this kind of system.

Some sort of integer increment would be the first thought but that would probably freak after the first order.

Example:
Code:
Unit - Set the custom value of (Triggering unit) to ((NewMob) + 1)
Set NewMob = ((NewMob) + 1)

But I can't really think this through at the moment, my mind is in blur ;)
 
I

ilida76

Guest
btw, what u said was correct, i changed some things to test it, and ya, thats the frekin problem lol.
 
I

ilida76

Guest
bah, i cant get it to work, been messin w/ it for an hr or so now.... anyone know how to fix this crap?..
 

Somatic

You can change this now in User CP.
Reaction score
84
Custom Value on unit stays with the unit throught out until its removed from the unit. In actual fact there might not be much flaw i can point out here.

Try this instead. Use a seperate trigger to assign the custom value of the unit where the unit spawn. Like :
Code:
Event : A Unit has entered the Map
Condition : Owner of triggering unit is equal to hostile creep
Action : Loop Integer from 10 to 85 
              If
                 Triggering unit is in RegionArray[Integer] is equal to true
              then
                  Set triggering unit's custom value to [Integer]

Something like this will ensure that unit which just entered the map will be assigned the correct custom Value.

To test out your system. Just add 1 more line to your 2nd trigger you posted

Code:
Game - Display to All Players : [Triggering Unit] has entered RegionArray[Value] with Custom Value of [Triggering Unit]
 
I

ilida76

Guest
this right? and with this, i just add it, right? keeping all of the other things the same.

Code:
Untitled Trigger 001
    Events
        Unit - A unit enters (Playable map area)
    Conditions
        (Owner of (Triggering unit)) Equal to hostileCreeps
    Actions
        For each (Integer A) from 10 to 85, do (Actions)
            Loop - Actions
                If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    If - Conditions
                        ((Triggering unit) is in (Units in regionArray[10])) Equal to True
                    Then - Actions
                        Unit - Set the custom value of (Triggering unit) to 10
                    Else - Actions
 

Somatic

You can change this now in User CP.
Reaction score
84
Change this part

Code:
For each (Integer A) from 10 to 85, do (Actions)
            Loop - Actions
                If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    If - Conditions
                        ((Triggering unit) is in (Units in regionArray[[B]Integer A[/B]])) Equal to True
                    Then - Actions
                        Unit - Set the custom value of (Triggering unit) to [B]Integer A[/B]
                    Else - Actions
 
I

ilida76

Guest
woooooot it worked, but some reason only 2 mobs spawn rofl.. atm seein what it the problem might be, thanks a lot Somatic +rep to you lol:D
 
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