Clan TMMM
Would you like to react to this message? Create an account in a few clicks or log in to continue.


The official site of Clan TMMM
 
HomeHomeSearchLatest imagesRegisterLog in


Latest topics
» Kevkevqaz is back
Help Me With Locust ! I_icon_minitimeby Eat_bacon_daily Wed Feb 22, 2023 7:22 pm

» Hey whats up
Help Me With Locust ! I_icon_minitimeby seankly Tue Feb 04, 2020 10:32 pm

» Gotta click fast - WC3 Mazing #mildlyinteresting
Help Me With Locust ! I_icon_minitimeby hoffmann Wed Jun 21, 2017 10:28 pm

» I'm getting married and you guys are invited
Help Me With Locust ! I_icon_minitimeby Achilles.42 Wed Sep 07, 2016 11:00 am

» Server Photo Album 1
Help Me With Locust ! I_icon_minitimeby Pat1487 Sat Aug 06, 2016 5:28 pm

» Legacy of The Void Beta
Help Me With Locust ! I_icon_minitimeby Achilles.42 Sun Oct 18, 2015 3:21 am

» Hey guys!!!
Help Me With Locust ! I_icon_minitimeby Eat_bacon_daily Fri Oct 16, 2015 11:20 pm

SC2 Links
SC2 Challenge/Tourney Info

Official SC2 Forums

SC2 Curse

SC2Mapster

Team Liquid

SC2 Replayed

SC2 Strategy
WC3 Links
Clan_TMMM[Host] Info

WC3 Challenge/Tourny Rules

Epicwar
Poll
What game does everyone play now?
Starcraft 2
Help Me With Locust ! I_vote_lcap26%Help Me With Locust ! I_vote_rcap
 26% [ 8 ]
Warcraft 3
Help Me With Locust ! I_vote_lcap35%Help Me With Locust ! I_vote_rcap
 35% [ 11 ]
League of Legends
Help Me With Locust ! I_vote_lcap19%Help Me With Locust ! I_vote_rcap
 19% [ 6 ]
World of Warcraft
Help Me With Locust ! I_vote_lcap0%Help Me With Locust ! I_vote_rcap
 0% [ 0 ]
Diablo 2
Help Me With Locust ! I_vote_lcap0%Help Me With Locust ! I_vote_rcap
 0% [ 0 ]
No games at all
Help Me With Locust ! I_vote_lcap10%Help Me With Locust ! I_vote_rcap
 10% [ 3 ]
Other game not listed
Help Me With Locust ! I_vote_lcap10%Help Me With Locust ! I_vote_rcap
 10% [ 3 ]
Total Votes : 31
Transparency

 

 Help Me With Locust !

Go down 
+3
Pat1487
AmAzIn[G]
RKR.
7 posters
AuthorMessage
RKR.
Recruit
Recruit
RKR.



Help Me With Locust ! Empty
PostSubject: Help Me With Locust !   Help Me With Locust ! I_icon_minitimeSun May 02, 2010 2:28 pm

Help Me With Locust ! Icon_cry Help Me With Locust ! Icon_cry Hi ! I need some help with my map and i wanna create a really cool but nobody can't help me !

I am crying at the moment because i wanna do a popular maze ...

Answer Me Fast Please[b][u]
Back to top Go down
AmAzIn[G]
Commander
Commander
AmAzIn[G]



Help Me With Locust ! Empty
PostSubject: Re: Help Me With Locust !   Help Me With Locust ! I_icon_minitimeSun May 02, 2010 2:44 pm

Back to top Go down
Pat1487
Moderator
Moderator
Pat1487



Help Me With Locust ! Empty
PostSubject: Re: Help Me With Locust !   Help Me With Locust ! I_icon_minitimeMon May 03, 2010 7:46 pm

Code:
function locust takes nothing returns nothing
    call UnitAddAbilityBJ( 'Aloc', GetEnumUnit() )
    call ShowUnitHide( GetEnumUnit() )
    call ShowUnitShow( GetEnumUnit() )
    call UnitRemoveAbilityBJ( 'Aloc', GetEnumUnit() )
endfunction

function Trig_locust_Actions takes nothing returns nothing
    call ForGroupBJ( GetUnitsInRectAll(GetEntireMapRect()), function locust )
endfunction

function InitTrig_locust takes nothing returns nothing
    set gg_trg_locust = CreateTrigger(  )
    call TriggerRegisterTimerEventSingle( gg_trg_locust, 0.01 )
    call TriggerAddAction( gg_trg_locust, function Trig_locust_Actions )
endfunction


That will give every unit on the map locust, including demonhunters

If you have units that spawn you have to do
Code:
call UnitAddAbilityBJ( 'Aloc', GetLastCreatedUnit() )
call ShowUnitHide( GetLastCreatedUnit() )
call ShowUnitShow( GetLastCreatedUnit() )

Right after you spawn the unit
I recommend making that into a function and just calling that function when you need to do it to save time

Hiding and showing them will allow you to use regular collision triggers instead of immolation for killing
This will only work in TFT
ROC requires more effort that im not going to get into

You might also want to add auto selection of units at the start and on revive
Back to top Go down
FaMoUs
Recruit
Recruit




Help Me With Locust ! Empty
PostSubject: Re: Help Me With Locust !   Help Me With Locust ! I_icon_minitimeTue May 04, 2010 8:08 pm

Import:
Download AbilityData.slk for free on uploading.com

Make sure you change the path name to Units\AbilityData.slk
Back to top Go down
RKR.
Recruit
Recruit
RKR.



Help Me With Locust ! Empty
PostSubject: Re: Help Me With Locust !   Help Me With Locust ! I_icon_minitimeTue May 04, 2010 8:14 pm

Thanks ALot
Back to top Go down
Serenity09
Moderator
Moderator
Serenity09



Help Me With Locust ! Empty
PostSubject: Re: Help Me With Locust !   Help Me With Locust ! I_icon_minitimeTue Jul 13, 2010 3:49 am

Pat1487 wrote:
Code:
function locust takes nothing returns nothing
    call UnitAddAbilityBJ( 'Aloc', GetEnumUnit() )
    call ShowUnitHide( GetEnumUnit() )
    call ShowUnitShow( GetEnumUnit() )
    call UnitRemoveAbilityBJ( 'Aloc', GetEnumUnit() )
endfunction

function Trig_locust_Actions takes nothing returns nothing
    call ForGroupBJ( GetUnitsInRectAll(GetEntireMapRect()), function locust )
endfunction

function InitTrig_locust takes nothing returns nothing
    set gg_trg_locust = CreateTrigger(  )
    call TriggerRegisterTimerEventSingle( gg_trg_locust, 0.01 )
    call TriggerAddAction( gg_trg_locust, function Trig_locust_Actions )
endfunction

Literally copy and pasted that. Throwing an error in the last function at set gg_trg_locust = CreateTrigger( ). error: expected variable name.
Created a new map just to see if WE wasn't just being crazy and got the same error. I cant think of a reason it wouldnt work, but i never learned jass im just making a good guess from c/java.
Back to top Go down
Pat1487
Moderator
Moderator
Pat1487



Help Me With Locust ! Empty
PostSubject: Re: Help Me With Locust !   Help Me With Locust ! I_icon_minitimeTue Jul 13, 2010 12:35 pm

It should be in a trigger called locust
Make a new trigger called locust, convert it to custom text, erase everything in there, and paste this
Back to top Go down
Fermee
Recruit
Recruit
Fermee



Help Me With Locust ! Empty
PostSubject: Re: Help Me With Locust !   Help Me With Locust ! I_icon_minitimeFri Nov 19, 2010 9:30 am

damn famous the link is broken
Back to top Go down
Serenity09
Moderator
Moderator
Serenity09



Help Me With Locust ! Empty
PostSubject: Re: Help Me With Locust !   Help Me With Locust ! I_icon_minitimeSat Jun 04, 2011 9:55 am

well now that i actually know somewhat how jass works

as brilliant as it is, pat's trigger leaks like a whore on her period

you should use this (the exact same thing but slightly reworded)

Code:
function locust takes nothing returns nothing
    local unit u = GetEnumUnit()

    call UnitAddAbilityBJ( 'Aloc', u )
    call ShowUnitHide(u)
    call ShowUnitShow(u)
    call UnitRemoveAbilityBJ( 'Aloc', u)

    set u = null
endfunction

function Trig_locust_Actions takes nothing returns nothing
    local group g = GetUnitsInRectAll(GetEntireMapRect())

    call ForGroup( g, function locust )

    call DestroyGroup(g)
    set g = null
endfunction

function InitTrig_locust takes nothing returns nothing
    set gg_trg_locust = CreateTrigger(  )
    call TriggerRegisterTimerEventSingle( gg_trg_locust, 0.01 )
    call TriggerAddAction( gg_trg_locust, function Trig_locust_Actions )
endfunction

im not sure if giving enumunit a var in the first part is necessary, but it also helps performance (a lil tiny bit)
i am sure that ForGroupbj leaks like aforementioned whore
should also probably destroy the trigger afterwards as well since it only runs once (im not sure if this is correct though)

slight difference:
Back to top Go down
AmAzIn[G]232
Corporal
Corporal
AmAzIn[G]232



Help Me With Locust ! Empty
PostSubject: Re: Help Me With Locust !   Help Me With Locust ! I_icon_minitimeSat Jun 04, 2011 10:17 am

ooo seren the big dawg is taking lead as gamer intellectual of jass.
(lets wait for pats retort)
This may actually get interesting.
(remember you can only see it here folks on clan tmmm)
Back to top Go down
Pat1487
Moderator
Moderator
Pat1487



Help Me With Locust ! Empty
PostSubject: Re: Help Me With Locust !   Help Me With Locust ! I_icon_minitimeSat Jun 04, 2011 11:33 am

It doesnt leak that badly, and since the part that leaks only runs once i didnt care to optimize it

Functions with BJ in their name dont leak any more then non-BJ functions (like ForGroup and ForGroupBJ)
The difference is that most BJ functions just call the non-BJ function, adding an extra step when you use the BJ version (blizzard actually wrote functions that have no other purpose then to call 1 other function)

The part that runs more then once (the locust function itself) is the part that should be optimized

Code:
function locust takes nothing returns nothing
    local unit u = GetEnumUnit()

    call UnitAddAbility(u, 'Aloc')
    call ShowUnit(u, false)
    call ShowUnit(u, true)
    call UnitRemoveAbility(u, 'Aloc')

    set u = null
endfunction

function Trig_locust_Actions takes nothing returns nothing
    local group g = GetUnitsInRectAll(GetEntireMapRect())

    call ForGroup( g, function locust )

    call DestroyGroup(g)
    set g = null
endfunction

function InitTrig_locust takes nothing returns nothing
    set gg_trg_locust = CreateTrigger(  )
    call TriggerRegisterTimerEventSingle( gg_trg_locust, 0.01 )
    call TriggerAddAction( gg_trg_locust, function Trig_locust_Actions )
endfunction

But even with all that, you probably wont notice a difference in performance between the original and these
Back to top Go down
Serenity09
Moderator
Moderator
Serenity09



Help Me With Locust ! Empty
PostSubject: Re: Help Me With Locust !   Help Me With Locust ! I_icon_minitimeSat Jun 04, 2011 11:46 am

im not totally sure how groups work
but my guess is they're like a array list of (pointers to) every unit in the group
so if you leak a group of every unit on the map then its a pretty big leak

when you call ForGroupbj, it calls ForGroup but then after that you leak the group that's passed to ForGroup from ForGroupbj
i guess whether its a big deal depends on whether the group thats never nulled in ForGroupbj is a 4 bit pointer or a n bit array list of units (a full copy of the group)
either way the group passed to ForGroup should be destroyed

but sometimes JASS does things weirdly

like i'd set a local variable to be equal to an element of a global array for convenience, but then instead of it being a pointer to that element it'd just be a copy of it.
it took me like 30 minutes to figure that out too, it just seemed so stupid that it'd work that way
Back to top Go down
Pat1487
Moderator
Moderator
Pat1487



Help Me With Locust ! Empty
PostSubject: Re: Help Me With Locust !   Help Me With Locust ! I_icon_minitimeSat Jun 04, 2011 12:01 pm

The group gets leaked either way unless you null it, you still have to null it even for ForGroup (like you did) so it leaks the same since it runs once

The group is like an array, but all the units get added to it once, so it only runs once, pulling stuff from it later (during the locust function) doesnt make more groups or any more group leaks
Back to top Go down
Serenity09
Moderator
Moderator
Serenity09



Help Me With Locust ! Empty
PostSubject: Re: Help Me With Locust !   Help Me With Locust ! I_icon_minitimeSat Jun 04, 2011 12:11 pm

what i was saying is that for something like

ForGroup(g) jumps right into the loop but

ForGroupbj(g)

calls function ForGroupbj(g)

which basically just calls ForGroup(g)
but never nulls group

you can null the group passed to ForGroupbj but not the group inside of that function
Back to top Go down
Pat1487
Moderator
Moderator
Pat1487



Help Me With Locust ! Empty
PostSubject: Re: Help Me With Locust !   Help Me With Locust ! I_icon_minitimeSat Jun 04, 2011 12:57 pm

I dont think it makes a copy every time
Everything made in GUI would leak if that were the case, and i know WE can be retarded, but theres no way it would be designed that poorly

ShowUnitHide and ShowUnitShow both call ShowUnit and pass the unit just like ForGroupBJ and ForGroup does with groups
Same with UnitAddAbility/RemoveAbility and UnitAddAbilityBJ/RemoveAbilityBJ

So by your logic those would leak worse then groups
All total my original triger would be 4 leaks for every unit on the map that you didnt null in your trigger, plus the group leak that you did null

If it were that bad you would see a massive improvement in performance with the last trigger i posted
I havent actually tested it, but im willing to bet you see little to no performance increase at all, where the increase you do get would just be the removal of the extra step by calling a function directly, instead of calling a function that calls the function

I only optimize code when you can see a difference in performance, like if this trigger ran more then once
I dont go for 100% efficiency
Back to top Go down
AmAzIn[G]232
Corporal
Corporal
AmAzIn[G]232



Help Me With Locust ! Empty
PostSubject: Re: Help Me With Locust !   Help Me With Locust ! I_icon_minitimeSat Jun 04, 2011 1:02 pm

Pat1487 wrote:
I dont go for 100% efficiency

Stupid broken robot.
Back to top Go down
Serenity09
Moderator
Moderator
Serenity09



Help Me With Locust ! Empty
PostSubject: Re: Help Me With Locust !   Help Me With Locust ! I_icon_minitimeSat Jun 04, 2011 2:50 pm

its only for blizzard jass
like stuff blizzard wrote using their own jass (bj's)

every bj that can leak does leak. they literally didn't null a single handle in everyone of their triggers

stuff that aren't bj's are fine

the reason they didn't care about that stuff is cuz they never used or had any need for periodics so a few leaks here and there was nbd
basically what your reasons for not doing it except it ended up coming back to screw everyone else
Back to top Go down
Pat1487
Moderator
Moderator
Pat1487



Help Me With Locust ! Empty
PostSubject: Re: Help Me With Locust !   Help Me With Locust ! I_icon_minitimeSun Jun 05, 2011 1:31 am

Everything in GUI uses functions from blizzard.j (BJ functions, some dont have BJ in the name, like ShowUnitHide/ShowUnitShow for example)
So it all leaks

There's a difference between my thing and blizzards
Mine is for a 1 time thing that is used 1 very specific way
Theirs is for a many time thing and is used many non-specific ways (like periodics and what not)

In blizzards case it shouldve been optimized
Back to top Go down
Serenity09
Moderator
Moderator
Serenity09



Help Me With Locust ! Empty
PostSubject: Re: Help Me With Locust !   Help Me With Locust ! I_icon_minitimeSun Jun 05, 2011 12:04 pm

a lot of that sounds very similar to what i said
Back to top Go down
Sponsored content





Help Me With Locust ! Empty
PostSubject: Re: Help Me With Locust !   Help Me With Locust ! I_icon_minitime

Back to top Go down
 
Help Me With Locust !
Back to top 
Page 1 of 1
 Similar topics
-
» Locust Help
» Locust
» Locust in RoC ?
» Locust Trigger
» Demon Hunter Locust

Permissions in this forum:You cannot reply to topics in this forum
Clan TMMM :: Warcraft 3 :: WC3 Tutorials and Help-
Jump to: