How do i clear all an array.

Evote

New Member
Reaction score
4
I have an array with like 50 varables and i wana clear all them but clearing them all one by one is annoying and pisses me off anyway to clear all of them?
PHP:
call RemoveLocation(udg_Ultie[6])
like i want
PHP:
call RemoveLocation(udg_Ultie[all of them])
Any way to do that.
 
L

lordpredator

Guest
PSEUDO CODE:
for loop integer A 1 to 50 do actions
LOOP
call RemoveLocation(udg_Ultie[Integer A])
 

Evote

New Member
Reaction score
4
Thanks mate i gota ask one more think though
Code:
Sliding
    Events
        Time - Every 0.01 seconds of game time
        Unit - A unit Is issued an order targeting a point
    Conditions
    Actions
        Unit - Make (Triggering unit) face (Target point of issued order) over 0.00 seconds
        Unit Group - Pick every unit in All_Units and do (Set L[(Player number of (Owner of (Picked unit)))] = (Position of (Picked unit)))
        Unit Group - Pick every unit in All_Units and do (Actions)
            Loop - Actions
                If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    If - Conditions
                    Then - Actions
                        Animation - Change (Picked unit)'s animation speed to 200.00% of its original speed
                        Set L[(Player number of (Owner of (Picked unit)))] = (Position of (Picked unit))
                        If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                            If - Conditions
                                And - All (Conditions) are true
                                    Conditions
                                        (Unit-type of (Picked unit)) Equal to Arrgh Shit My Head's on Fire.
                                        (Terrain type at L[(Player number of (Owner of (Picked unit)))]) Equal to Northrend - Snow
                            Then - Actions
                                Unit - Kill (Picked unit)
                            Else - Actions
                                Do nothing
                        Set SLIDE[(Player number of (Owner of (Picked unit)))] = (L[(Player number of (Owner of (Picked unit)))] offset by Frame_Rate[(Player number of (Owner of (Picked unit)))] towards (Facing of (Picked unit)) degrees)
                        If (((Unit-type of (Picked unit)) Equal to Arrgh Shit My Head's on Fire.) and ((Terrain type at L[(Player number of (Owner of (Picked unit)))]) Equal to Northrend - Ice)) then do (Unit - Move (Picked unit) instantly to SLIDE[(Player number of (Owner of (Picked unit)))]) else do (Do nothing)
                        For each (Integer A) from 1 to 12, do (Actions)
                            Loop - Actions
                                Custom script:   call RemoveLocation(udg_L[GetForLoopIndexA()])
                                Custom script:   call RemoveLocation(udg_SLIDE[GetForLoopIndexA()])
                    Else - Actions
                        Do nothing

Ok leak Check says that i haven't removed the varable L But i have i think?? how i fix?
 
L

lordpredator

Guest
well this code is confusing, made it with code tags to make readable... anyway... i see a lot of errors... for example:

1)
why do you have 2 "pick every unit" action of the same group... one with a single action and the other with multiple actions...
Code:
Unit Group - Pick every unit in All_Units and do (Set L[(Player number of (Owner of (Picked unit)))] = (Position of (Picked unit)))
Unit Group - Pick every unit in All_Units and do (Actions)
delete the first one... and set the location inside the loop of the second

2)
Code:
 If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
Then - Actions
WTF this means?.... why you make a conditional without conditions???!

3)
Code:
 Set L[(Player number of (Owner of (Picked unit)))] = (Position of (Picked unit))
you repeat the set location inside the loop... so you are leaking twice... and making the trigger slower too...

4)
Code:
 If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
And - All (Conditions) are true
Conditions
A conditional without conditions again??... anyway... the and for the condition is the default... so any condition you put in the condition part of the if... will be "and", you only have to use OR if you need a condition of that type.

5)
well i will finish there because the code without TABS is so confusing... maybe im wrong with some error...

LP
 

Evote

New Member
Reaction score
4
i need to remove the varable ay L but i have??
Btw the trigger speed does not lagg even a pentium 3 can easly do it without lagg pentium 1's can prosess fast enough but they carn't run warcraft.
Thanks m8

wow i really stuffed that one up it was an edit ... of my old one i added stuff forgot to remove so +rep :) for U

Leak Check Still Says i hapent removed the varable L.

Whats up with that?
 

Chocobo

White-Flower
Reaction score
409
i need to remove the varable ay L but i have??
Btw the trigger speed does not lagg even a pentium 3 can easly do it without lagg pentium 1's can prosess fast enough but they carn't run warcraft.
Thanks m8

wow i really stuffed that one up it was an edit ... of my old one i added stuff forgot to remove so +rep :) for U

Leak Check Still Says i hapent removed the varable L.

Whats up with that?

A reason for your problem : http://www.thehelper.net/forums/showthread.php?t=34380
 

Chocobo

White-Flower
Reaction score
409
which page??

Post 52 :

SFilip said:
> it was not made for the advanced mapper.
Yet it makes the people rely on it far too much.
"Its ok, this is 100% leakless, LeakCheck says so"
"This trigger is bad, LeakCheck says 'Location variable has not been removed'...well I trust it, I'll just create a new trigger"
If a bug suddenly comes up someone would think a trigger perhaps leaks. Someone might just think that a multiboard position leaks and even dump the trigger.

No, I'm not saying that its bad. Its great until you get the hang of leaks. But a lot of people continue using it even when they do.

> what are the other many reasons that make this program worthless?
The very fact that you would let a computer program judge something like this instead of you.

I'm sorry for demoting it like this, I'm aware it probably took a lot of work and time to make this.
And you might want to consider releasing the source since you stopped developing it. Someone might just want to take over...
 

Evote

New Member
Reaction score
4
humm btw all things remain stored in a game till the end thats what a leak is but some really stuff things up the game thats what the program checks for...
Dam soz double post
 

Chocobo

White-Flower
Reaction score
409
any way to fix that?

Code:
 Set SLIDE[(Player number of (Owner of (Picked unit)))] = (L[(Player number of (Owner of (Picked unit)))] offset by Frame_Rate[(Player number of (Owner of (Picked unit)))] towards (Facing of (Picked unit)) degrees)

put this instead :

Code:
set udg_SLIDE[GetConvertedPlayerId(GetOwningPlayer(GetEnumUnit()))] = Location(GetLocationX(udg_L[GetConvertedPlayerId(GetOwningPlayer(GetEnumUnit()))]) + udg_Frame_Rate[GetConvertedPlayerId(GetOwningPlayer(GetEnumUnit()))] * Cos(GetUnitFacing(GetEnumUnit())*3.14159/180.0) , GetLocationY(Location(udg_L[GetConvertedPlayerId(GetOwningPlayer(GetEnumUnit()))]) + udg_Frame_Rate[GetConvertedPlayerId(GetOwningPlayer(GetEnumUnit()))] * Sin(GetUnitFacing(GetEnumUnit())*3.14159/180.0)

does it work? No idea.

nvm, bracket ) errror. ignore the problem.
 

Evote

New Member
Reaction score
4
thanks for help but now world edit crashed lol i brb i try fix it.
i'll try build a calculater for it if that doesn't work.
 
L

lordpredator

Guest
polar offset makes a new point, so it leaks, but you can solve it simply by making a temp_point and then remove it. The array you can have it until the end of the match... but if at some moment you change a value of one of the index... you have to remove the old location first... if not it will leak.
 

Evote

New Member
Reaction score
4
lol thatnk but i already build a calculater it works extremely smooth i'd say better that polar escape.
 
General chit-chat
Help Users
  • No one is chatting at the moment.

      The Helper Discord

      Members online

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials

      Network Sponsors

      Apex Steel Pipe - Buys and sells Steel Pipe.
      Top