how do i Destroy a Trigger

C

CDR

Guest
http://www.thehelper.net/forums/showthread.php?t=27219
emjlr3 tutorial sez that if i do this custom script
and lastly, one good Custom Script to use is that when you have a trigger that will only run once, then is useless. In those cases, put this at the end of the trigger. It can greatly reduce lag in your maps.

Code:
Custom script:   call DestroyTrigger( GetTriggeringTrigger() )
it will destroy that trigget but it is not working win i try to save i get that window saying that sum thing is wrong with the script
Code:
Custom script:   call DestroyTrigger( GetTriggeringTrigger() )
so wut is the right script that duz this?
 

YourFace

<span style="color:#9C9C9C;"><strong>Runner Up - T
Reaction score
91
in the part where it says
GetTrigger()), you need to put the name of the trigger you want to be destroyed
like GetTrigger(Untitled_trigger_04)
i dont do jass so im guessing
 
C

CDR

Guest
nm i tried it ones more and it worked i must of typed it in wrong
sry about that all
 
C

CDR

Guest
in the part where it says
GetTrigger()), you need to put the name of the trigger you want to be destroyed
like GetTrigger(Untitled_trigger_04)
i dont do jass so im guessing
reading that made me realize that you can destroy what ever trigger you would like right? I tried it like yourface suggested and that did not work

Code:
Custom script:   call DestroyTrigger( GetTrigger(player_1) )

so what is the script to do that?
 

Flare

Stops copies me!
Reaction score
662
Are you destroying the trigger from within itself, e.g.
Code:
Events
...
Conditions
...
Actions
   Custom script: call DestroyTrigger (ThisTrigger)
or, are you trying to destroy it from another trigger e.g.
Code:
Events
...
Conditions
...
Actions
   Custom script: call DestroyTrigger (ThatTriggerOverThere)

For the first, you can use GetTriggeringTrigger () i.e.
Code:
Custom script: call DestroyTrigger ( GetTriggeringTrigger () )
You can also use the option below if you want, both options work just fine when you want the trigger to destroy itself

For the second, you must prefix the name of the trigger being destroyed with gg_trg_ and replace any spaces with underscores i.e.
Code:
Custom script: call DestroyTrigger (gg_trg_Another_trigger)
That will destroy a trigger called "Another trigger" (without the quotation marks, obviously :p)
 
C

CDR

Guest
You shouldn't be destroying triggers anyway, so don't worry about it.
i need to worry about it my map already has over 1000 trigger and will only use about 200 of the triggers in game play the rest wont evin run 1 time


emjlr3 tutorial sez

and lastly, one good Custom Script to use is that when you have a trigger that will only run once, then is useless. In those cases, put this at the end of the trigger. It can greatly reduce lag in your maps.


Code:
Custom script:   call DestroyTrigger( GetTriggeringTrigger() )
 

AceHart

Your Friendly Neighborhood Admin
Reaction score
1,495
> It can greatly reduce lag in your maps.

That's an old wives' tale...
If this is the kind of help your map needs, I'd suggest you think it over... you're seriously doomed.


> i need to worry ...

... about things like crappy spelling in tooltips and other descriptions.
Because if your map uses the same "style" as your posts, most of your players will start your map precisely once.
 
Reaction score
333
i need to worry about it my map already has over 1000 trigger and will only use about 200 of the triggers in game play the rest wont evin run 1 time


emjlr3 tutorial sez

So 80% of the triggers in your map serve no purpose other than to decorate the trigger editor? I seriously doubt that you have more than 1000 triggers in your map, but even if you did it would not be necessary to destroy them.
 
C

CDR

Guest
So 80% of the triggers in your map serve no purpose other than to decorate the trigger editor? I seriously doubt that you have more than 1000 triggers in your map, but even if you did it would not be necessary to destroy them.
fine here is a link to my map if you can think of a way to have less triggers good for you and pleas show me how it is possible http://epicwar.com/maps/72289
about things like crappy spelling in tooltips and other descriptions.
Because if your map uses the same "style" as your posts, most of your players will start your map precisely once.
wow wut a nice thing to say sry i cant spell but y do people feel the need to tell me i cant spell like i don't already know:eek: it's about like explaining that "wow wut a nice thing to say" is sarcasm:thup:
 

chopperpope

New Member
Reaction score
12
why do you want to destroy a trigger?

have you ever tried just turning the trigger off?

Code:
turn OFF Untitled_trigger_04

for example.
 
Reaction score
333
fine here is a link to my map if you can think of a way to have less triggers good for you and pleas show me how it is possible http://epicwar.com/maps/72289

After looking at your map, it seems that the spawning triggers for each unit type can be merged into one without too much trouble.

The archer spawn triggers could be replaced by something like this, for instance:

Code:
Spawn Archers
    Events
        Time - Every 20.00 seconds of game time
    Conditions
    Actions
        Player Group - Pick every player in (All players) and do (Actions)
            Loop - Actions
                If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    If - Conditions
                        (Current research level of Archer  for (Picked player)) Equal to 1
                        ((Picked player) Food used) Less than or equal to 100
                    Then - Actions
                        Set point = (Center of spawn_regions[(Player number of (Picked player))])
                        Unit - Create 1 units_night_elf[1] for (Picked player) at point facing Default building facing degrees
                        Custom script:   call RemoveLocation(udg_point)
                    Else - Actions

The spawn_regions variable is an array containing the spawning regions for each player. This might not be exactly equivalent - I am assuming you want archers to begin spawning once the player has researched "Archer".

Doing this for each unit type should save you something like 900 triggers.

wow wut a nice thing to say sry i cant spell but y do people feel the need to tell me i cant spell like i don't already know:eek: it's about like explaining that "wow wut a nice thing to say" is sarcasm:thup:

I assume it is in the hope that you will take the hint and improve the standard of English in your posts.
 
C

CDR

Guest
ya i have. i just figured if you destroy the trigger the game would not have to look threw so meny triggers to finde the one that is going to run
 
C

CDR

Guest
Code:
Spawn Archers
    Events
        Time - Every 20.00 seconds of game time
    Conditions
    Actions
        Player Group - Pick every player in (All players) and do (Actions)
            Loop - Actions
                If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    If - Conditions
                        (Current research level of Archer  for (Picked player)) Equal to 1
                        ((Picked player) Food used) Less than or equal to 100
                    Then - Actions
                        Set point = (Center of spawn_regions[(Player number of (Picked player))])
                        Unit - Create 1 units_night_elf[1] for (Picked player) at point facing Default building facing degrees
                        Custom script:   call RemoveLocation(udg_point)
                    Else - Actions
cool thank you:D ill fix that
 
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