[Log in / Register]
| News | Chat | Pastebin | Donations | Tutorials | Rules | Forums |
| Maps | Skins | Icons | Models | Spells | Tools | Jass | Packs | Hosted Projects | Starcraft II Modding | Starcraft II Resources | Galaxy Wiki |
(Keeps Hive Alive)
Go Back   The Hive Workshop > Warcraft III Modding > WarCraft III Tutorials > Trigger (GUI) Editor Tutorials


Trigger (GUI) Editor Tutorials Contains tutorials concerning the usage of GUI features.
Read the Rules before posting.

Reply
 
Thread Tools
Old 03-31-2012, 11:38 PM   #16 (permalink)
Registered User Ber352
User
 
Ber352's Avatar
 
Join Date: Jun 2011
Posts: 20
Ber352 has little to show at this moment (1)
I haven't read the whole tutorial, I just took a glance at it, but I didn't see the correction to another very common error, so I'll just post it here (feel free to add to the main post):

Error
Sometimes people make triggers which can be repeated, but the person doesn't know that, let's consider this example:

Anywhere = variable for any region

Error Trigger:
Any Trigger
Events
Unit - a unit enters Anywhere
Conditions
Actions
Do something

If the map is multiplayer, you see the error right away: If one player is near another and they both enter the region, the trigger will be executed twice, or the ammount of times equal to the number of units which entered the region.
Also, singleplayer maps get bugs too. If, for example, the map is too long and the person loses in the final boss. He wants to know what happens on the end, so he puts "Whosyourdaddy" and rushes to the final boss, not killing the creeps. The same error happens when his character and the creeps after him enter the region.

Now, for the fix. I found a way to deal with this ever since I began making maps, because I usually make multiplayer maps for my brother and I to play, so I had this problem a lot.

Fixed Trigger:
Any Trigger
Events
Unit - a unit enters Anywhere
Conditions
Actions
Trigger - Turn off (This trigger)
Do Something

Do this on every trigger you make, one more line won't kill you and you will avoid any future bug which you might spend hours trying to find the source. (note: this bug happens for any kind of action, but most commonly on units entering regions, that's why this is the example)
Do NOT put the "Turn off (This trigger)" at the end of the trigger, if your trigger lasts for some time, there could be enough time for another unit to get into that region, causing the same bug, so always put it on first line.

Also note that you can turn the trigger on anytime you want using the following:

Turn Trigger On:
Any Trigger 2
Events
Something happens
Conditions
Actions
Trigger - Turn on Any Trigger
__________________
Remember, always + rep those who help you. This gives people an incentive to help you (not to say you would get + rep if you helped someone too )
Ber352 is offline   Reply With Quote
Old 04-01-2012, 12:36 PM   #17 (permalink)
Registered User Hashjie
I salute you kind sir ಠ_ರ
 
Hashjie's Avatar
 
Join Date: Apr 2009
Posts: 1,495
Hashjie is just really nice (285)Hashjie is just really nice (285)Hashjie is just really nice (285)Hashjie is just really nice (285)Hashjie is just really nice (285)
@Ber352

Or... You set up some conditions instead of turning off the trigger.
Also this tutorial is about leak removal and optimization, which I suggest you should take a good look at.
It's got nothing to do with what you where saying.
__________________
Knowledge and patience is key to success.
Knowledge is acquired through a learning process either theoretically or practically.
The more you know and can keep your calm, the more successfull you will be in life.
Hashjie is offline   Reply With Quote
Old 04-04-2012, 03:20 AM   #18 (permalink)
Registered User Ber352
User
 
Ber352's Avatar
 
Join Date: Jun 2011
Posts: 20
Ber352 has little to show at this moment (1)
@Hashjie

Yeah, I was planning on looking at it soon, also, even if not added to the main post, one tip there won't hurt anyone, will it? Plus, it can be helpfull (and tbh I have no idea where to put it, I'm not gonna create a new thread just for one lil tip, it's kinda a waste of space)
Also, sometimes you don't want a condition on the trigger (ex: red player unit enters region), you want all the players to be able to start the trigger or something, making doing a condition way harder than simply putting a "Turn off (This trigger)"
__________________
Remember, always + rep those who help you. This gives people an incentive to help you (not to say you would get + rep if you helped someone too )
Ber352 is offline   Reply With Quote
Old 04-27-2012, 05:44 PM   #19 (permalink)
Registered User NOSAKIAS
Psi
 
NOSAKIAS's Avatar
 
Join Date: Apr 2009
Posts: 32
NOSAKIAS has little to show at this moment (3)
[CAPS]Thank you so much for this![/CAPS]
__________________
Check out my map!
NOSAKIAS is offline   Reply With Quote
Old 04-28-2012, 06:55 AM   #20 (permalink)
Forum Moderator -Kobas-
★ SotP Project Leader ★
 
-Kobas-'s Avatar
Resource Moderator
 
Join Date: Jan 2010
Posts: 6,075
-Kobas- has a reputation beyond repute (2303)-Kobas- has a reputation beyond repute (2303)-Kobas- has a reputation beyond repute (2303)-Kobas- has a reputation beyond repute (2303)-Kobas- has a reputation beyond repute (2303)
Hero Contest #6 - Winner: Alora, the Priestess of Moonlight was found to be the most succesful defender against the Armies of the Burning Legion! A hero by -Kobas-. Hero Contest #5 - Winner: Stormbringer was -Kobas-'s entry, who incorporated lightnings as the power of future weaponry. Despite the instability of lightnings, this entry was stable enough to be approved by judges and public. A hero by -Kobas-. Mini-Game Mapping Contest #4: -Kobas- has won the fourth edition of The Hive Workshop's Mini-Game Mapping Contest with his entry: "Hunted". Check out the Arena if you want to participate on competitions as well! 
If you turn trigger off it will disable actions for other players, but maybe you want to give +250 exp to each player hero that enter certain region.
I suggest boolean array in this case.

Code:
Events:
     -Unit Enter THIS region
Conditions:
Actions:
     If B[PlayerNumber] == false then
          set B[PlayerNumber] = true
          ---- Actions ----
     endif
I use this as raw example it really doesn't mater will you code it with GUI or script idea is same.
__________________

Shadows of the Past v0.9.3.0
Check it out -> ★ Shadows of the Past ★


SotP History Video

Offence of the Gods v1.0.0.0
Check it out -> ★ Offence of the Gods ★


New Project
-Kobas- is offline   Reply With Quote
Old 07-25-2012, 12:10 PM   #21 (permalink)
Registered User Losam
Clan Lunatics's Chieftain
 
Losam's Avatar
 
Join Date: Mar 2011
Posts: 286
Losam is on a distinguished road (67)Losam is on a distinguished road (67)
Dear Bribe, I have a question for you: On the way to remove that lightning is not correct (my World Edit Trigger blocks that has this script) you can explain?
Losam is offline   Reply With Quote
Old 07-25-2012, 08:03 PM   #22 (permalink)
Forum Moderator PurgeandFire
ʕ•͡ᴥ•ʔ
 
PurgeandFire's Avatar
Resource & Tutorial Moderator
 
Join Date: Nov 2006
Posts: 5,658
PurgeandFire has a reputation beyond repute (2036)PurgeandFire has a reputation beyond repute (2036)PurgeandFire has a reputation beyond repute (2036)PurgeandFire has a reputation beyond repute (2036)
Thank you for pointing that out. I have fixed it in the main post:
Set LightningVar = (Last created Lightning Effect)
Custom script: call DestroyLightning(udg_LightningVar)

It should be DestroyLightning() instead of RemoveLightning(), as shown above. (RemoveLightning() does not exist)
PurgeandFire is offline   Reply With Quote
Old 12-20-2012, 01:19 AM   #23 (permalink)
Registered User xn85d.2
User
 
Join Date: Dec 2012
Posts: 16
xn85d.2 has little to show at this moment (4)
Quote:
Originally Posted by PurgeandFire111 View Post
Thank you for pointing that out. I have fixed it in the main post:
Set LightningVar = (Last created Lightning Effect)
Custom script: call DestroyLightning(udg_LightningVar)

It should be DestroyLightning() instead of RemoveLightning(), as shown above. (RemoveLightning() does not exist)
Lightning - Destroy (Last created lightning effect)

exists as a GUI function, why do you need to JASS it?

Also, I found that (Triggering Player) does not correctly replace (Owner of Unit(Entering Unit)) for
Unit - A unit enters Region
xn85d.2 is offline   Reply With Quote
Old 12-20-2012, 01:58 AM   #24 (permalink)
Forum Moderator PurgeandFire
ʕ•͡ᴥ•ʔ
 
PurgeandFire's Avatar
Resource & Tutorial Moderator
 
Join Date: Nov 2006
Posts: 5,658
PurgeandFire has a reputation beyond repute (2036)PurgeandFire has a reputation beyond repute (2036)PurgeandFire has a reputation beyond repute (2036)PurgeandFire has a reputation beyond repute (2036)
Ah, I don't have the editor on this computer so I didn't know that. I will update it later. :)

Also, for (Triggering Player), it only works for PlayerUnitEvent/PlayerEvent (when converted to JASS) events. The region event isn't. But thanks for that, I see that the main post's statement was a bit broad so I will try to find time to update it for which GUI ones work and which ones don't.
PurgeandFire is offline   Reply With Quote
Reply

Bookmarks

Tags
gui, jass, simple, trigger

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off


All times are GMT. The time now is 04:59 AM.




Powered by vBulletin
Copyright 2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.5.1 PL2
Copyright © Ralle