Well, that's not entirely correct. Redconfusions example does work (see third post). The trigger he creates in this example only fires its actions once, I tried it with a test message, no matter how often you spam the button (until it is reset ofc).
Problem is I don't understand how to implement this in my setup using different buttons. My buttons call a trigger - and that is the problem I suppose, because there needs to be a trigger that checks if a specific button is pressed using variables (my problem) - and then fires the trigger (the trigger that does what you want the button to do) while the variable has disabled the button itself.
Locked Alliances - (All Players) Yes Premade Game - (All Players) Yes Teams [Premade] - (All Players) 5 v 5 Color: 1 - 10, Red through Dark Green Controller, 1 and 6 Computer, Everything else open. Participant Role: 1, 6, 11 none, Everything else Participant. Teams[Premade: 5v5]: 1-5, Team[1-5], 6-10, Team[6-10], 11 (none).
If you go by this setup, nothing should go wrong when you try to publish. Of course, do change team setups as you like - i.e. FFA instead x vs x players etc. As for the game speed, not sure if when you force disable this, the map will publish - but if it doesn't, just lock it using a trigger. It's called "Lock Game Speed".
Can you show me how you implemented this procedure into multiple buttons using multiple variables? I can't seem to be able to get this to work - only in the example provided in this thread, yes - but I can't seem to be able to disable each button seperately.
What I do is:
I create my buttons:
Dialog - Display button MDG_Selection_01_Player_01 of size (250, 60) with text "4 Hydralisk + 3 Roach" at Top Left of screen with offset (50, 140) (run No Trigger when button is clicked)
Dialog - Display button MDG_Selection_02_Player_01 of size (250, 60) with text "4 Marauder + 6 Marine" at Top Left of screen with offset (50, 210) (run No Trigger when button is clicked)
Dialog - Display button MDG_Selection_03_Player_01 of size (250, 60) with text "1 Immortal + 4 Stalker + 1 Sentry" at Top Left of screen with offset (50, 280) (run No Trigger when button is clicked)
The variables:
MDG_Selection_01_Player_01 = 17 <Integer>
MDG_Selection_02_Player_01 = 18 <Integer>
MDG_Selection_03_Player_01 = 19 <Integer>
As you can see, I am using the initial value to identify my button. But now when I try to implement the suggestion above:
Events
Dialog - (Screen button 17) is used by Player Any Player with event type Clicked
Conditions
MDG_Selection_01_Player_01 == 0
Actions
Variable - Set MDG_Selection_01_Player_01 = 1
TRIGGERSTUFF
General - Wait 1.0 Game Time seconds
Variable - Set MDG_Selection_01_Player_01 = 0
the game treats every pressed button the same and runs my trigger. I am not very good with variables, can you tell me what I am doing wrong?
"Wenn, dann, sonst" isn't something the German localization team came up with, it's a given standard in Germany - like it or not. Just fire up German Excel (or other localized programming environments) and you'll see what I mean. However, I agree that localized triggers can be pretty complicated, especially if you are used to english ones.
To answer your question:
You could force the localized editor strings into your client, but I wouldn't do that because you would need to modify the MPQ's - which is against the end user license agreement and Blizzard could close your account for hacking.
I suggest downloading the English client. You can install it along the German one, they won't interfere with each other. I am using the same setup (German/English GB).
Ok well, I'm trying to explain my setup here - it works perfectly, but every once in a while it fails - and I have absolutely no idea why it would do that:
I need to check if all units in a specific unitgroup are dead - if so, the player with the remaining units wins the match. So first, I put all my units into unitgroups:
Okay nice. I spawn my units in said regions, the players are starting to fight against each other - and the following trigger watches over what is going on to determine who won the match:
Player1_LosesEventsUnit-AnyUnitdiesLocalVariablesConditions((Triggeringunit)isinRegion_MindTheGap)==true(NumberofLivingunitsinMDG_Player1_Unitgroup)==0ActionsGeneral-Wait1.0RealTimeseconds------- PLAYER 2 WINS THE MATCHSound-PlayModUtilityVoiceModUtilityVoice00081for(Enemiesofplayer1)(at100.0%volume,skipthefirst0.0seconds)UI-Display"YOU HAVE WON THE MATCH"for(Enemiesofplayer1)toDirectivearea------- PLAYER 1 LOSES THE MATCHSound-PlayModUtilityVoiceModUtilityVoice00073for(Enemiesofplayer2)(at100.0%volume,skipthefirst0.0seconds)UI-Display"YOU HAVE LOST THE MATCH"for(Enemiesofplayer2)toDirectivearea------- Get rid of all remaining unitsGeneral-Wait4.0RealTimesecondsUnitGroup-PickeachunitinMDG_Player2_Unitgroupanddo(Actions)ActionsUnit-Remove(Pickedunit)fromthegameSound-PlayUI_ScrollButtonSelectfor(Allplayers)(at100.0%volume,skipthefirst0.0seconds)General-Wait0.3RealTimesecondsUnitGroup-RemoveallunitsfromMDG_Player2_UnitgroupUnitGroup-RemoveallunitsfromMDG_Player1_UnitgroupCinematics-FadeOutover1.0secondsusingcolor(0%,0%,0%)and0.0%transparency(Normalstyle,Waituntilitfinishes)Cinematics-FadeInover1.0secondsusingcolor(0%,0%,0%)and0.0%transparency(Normalstyle,Don't Wait until it finishes)Trigger-Runreset(CheckConditions,Don't Wait until it finishes)
Same code for Player2 btw (only reversed). This works PERFECTLY ... however sometimes in say 1 out of 20 tries, this fails - and no winner/loser is being determined. The game is stuck... but to make this even more curious - if the surviving player kills one of his own units (if he has more than one left), the trigger seems to resume and he wins the game just like he should have in the first place.
Does anybody get this? Is there any type of "security" measure you would put into this to prevent something like that from happening? Or did I get something wrong in my trigger?
I'm trying to figure this out and I'm completely out of ideas.
Say my units have already been added to a unitgroup called "MDG_Player1_Unitgroup". How do I detect if they are all dead? I got this setup, but it doesn't do anything:
Events:Unit-AnyUnitdiesLocalVariables:MDG_AllUnitsDead_Player1_Counter=0<Integer>Conditions:(Ownerof(Triggeringunit))==1Actions:UnitGroup-PickeachunitinMDG_Player1_Unitgroupanddo(Actions)Variable-SetMDG_AllUnitsDead_Player1_Counter=(+(1))General-If(Conditions)thendo(Actions)elsedo(Actions)If:(Abs(MDG_AllUnitsDead_Player1_Counter))==3Then:UI-Display"All Player1 units are dead!"for(Allplayers)toSubtitleareaElse:
By the way, if anybody is using another language editor and can't see the triggers, there's an easy solution for that. Just open up the map with an MPQ editor and copy all data inside /enGB/ or /enUS/ and create your own locale folder just like the english ones. German would be /deDE/localizeddata/yourstuff
Because trigger names are strings as well. When you load up the map now, it should show.
Exactly. Currently, I'm doing like a micro challenge map with selectable arenas. Figuring this out solved a lot of problems when showing the different arenas to the player wo is selecting it (and the players who are just looking over his shoulder).
Oh god, thanks man. It works... I'm not too much into scripting, but everytime I get something, it's like a new world opens up in front of me ;) Thanks again!
0
@maverck: Go
Well, that's not entirely correct. Redconfusions example does work (see third post). The trigger he creates in this example only fires its actions once, I tried it with a test message, no matter how often you spam the button (until it is reset ofc).
Problem is I don't understand how to implement this in my setup using different buttons. My buttons call a trigger - and that is the problem I suppose, because there needs to be a trigger that checks if a specific button is pressed using variables (my problem) - and then fires the trigger (the trigger that does what you want the button to do) while the variable has disabled the button itself.
0
Nope, doesn't work... as soon as it's live on battle.net the buttons are so laggy, i can even press them thrice. Totally out of ideas.
0
@ubermikeleet: Go
Hmm, I am trying this now - it's a global trigger that should prevent any button from being spammed:
Events
Dialog - Any Dialog Item is used by Player Any Player with event type Clicked
Conditions
Button pressed[0] == 0
Actions
Variable - Set Button pressed[0] = 1
Dialog - Disable (Used dialog item) for (All players)
UI - Display "button pressed" for (All players) to Subtitle area
General - Wait 1.0 Game Time seconds
Dialog - Enable (Used dialog item) for (All players)
Variable - Set Button pressed[0] = 0
But I am unsure if this will be rendered useless once published because of the battle.net lag... gotta try it first.
0
@GnaReffotsirk: Go
This is from KelvCM and it helped me a ton:
Locked Alliances - (All Players) Yes Premade Game - (All Players) Yes Teams [Premade] - (All Players) 5 v 5 Color: 1 - 10, Red through Dark Green Controller, 1 and 6 Computer, Everything else open. Participant Role: 1, 6, 11 none, Everything else Participant. Teams[Premade: 5v5]: 1-5, Team[1-5], 6-10, Team[6-10], 11 (none).
If you go by this setup, nothing should go wrong when you try to publish. Of course, do change team setups as you like - i.e. FFA instead x vs x players etc. As for the game speed, not sure if when you force disable this, the map will publish - but if it doesn't, just lock it using a trigger. It's called "Lock Game Speed".
Cheers,
0
Can you show me how you implemented this procedure into multiple buttons using multiple variables? I can't seem to be able to get this to work - only in the example provided in this thread, yes - but I can't seem to be able to disable each button seperately.
What I do is:
I create my buttons: Dialog - Display button MDG_Selection_01_Player_01 of size (250, 60) with text "4 Hydralisk + 3 Roach" at Top Left of screen with offset (50, 140) (run No Trigger when button is clicked)
Dialog - Display button MDG_Selection_02_Player_01 of size (250, 60) with text "4 Marauder + 6 Marine" at Top Left of screen with offset (50, 210) (run No Trigger when button is clicked)
Dialog - Display button MDG_Selection_03_Player_01 of size (250, 60) with text "1 Immortal + 4 Stalker + 1 Sentry" at Top Left of screen with offset (50, 280) (run No Trigger when button is clicked)
The variables: MDG_Selection_01_Player_01 = 17 <Integer>
MDG_Selection_02_Player_01 = 18 <Integer>
MDG_Selection_03_Player_01 = 19 <Integer>
As you can see, I am using the initial value to identify my button. But now when I try to implement the suggestion above:
Events
Dialog - (Screen button 17) is used by Player Any Player with event type Clicked
Conditions
MDG_Selection_01_Player_01 == 0
Actions
Variable - Set MDG_Selection_01_Player_01 = 1
TRIGGERSTUFF
General - Wait 1.0 Game Time seconds
Variable - Set MDG_Selection_01_Player_01 = 0
the game treats every pressed button the same and runs my trigger. I am not very good with variables, can you tell me what I am doing wrong?
0
@Helral: Go
Hmm, but that's why I set up conditions:
So even if in this case a unit owned by player 1 enters "MDG_UnitGroup_Player02", it wouldn't get added because of the condition, no?
0
@GurgelJ: Go
"Wenn, dann, sonst" isn't something the German localization team came up with, it's a given standard in Germany - like it or not. Just fire up German Excel (or other localized programming environments) and you'll see what I mean. However, I agree that localized triggers can be pretty complicated, especially if you are used to english ones.
To answer your question: You could force the localized editor strings into your client, but I wouldn't do that because you would need to modify the MPQ's - which is against the end user license agreement and Blizzard could close your account for hacking.
I suggest downloading the English client. You can install it along the German one, they won't interfere with each other. I am using the same setup (German/English GB).
0
Ok well, I'm trying to explain my setup here - it works perfectly, but every once in a while it fails - and I have absolutely no idea why it would do that:
I need to check if all units in a specific unitgroup are dead - if so, the player with the remaining units wins the match. So first, I put all my units into unitgroups:
Player1
And Player 2:
Okay nice. I spawn my units in said regions, the players are starting to fight against each other - and the following trigger watches over what is going on to determine who won the match:
Same code for Player2 btw (only reversed). This works PERFECTLY ... however sometimes in say 1 out of 20 tries, this fails - and no winner/loser is being determined. The game is stuck... but to make this even more curious - if the surviving player kills one of his own units (if he has more than one left), the trigger seems to resume and he wins the game just like he should have in the first place.
Does anybody get this? Is there any type of "security" measure you would put into this to prevent something like that from happening? Or did I get something wrong in my trigger?
0
@Molsterr: Go
Arrrgh! Thinking around 30 corners where only one was needed - fail. Thanks again for the insight, works :D
0
I'm trying to figure this out and I'm completely out of ideas.
Say my units have already been added to a unitgroup called "MDG_Player1_Unitgroup". How do I detect if they are all dead? I got this setup, but it doesn't do anything:
I guess I got it totally wrong *shrug*.
0
By the way, if anybody is using another language editor and can't see the triggers, there's an easy solution for that. Just open up the map with an MPQ editor and copy all data inside /enGB/ or /enUS/ and create your own locale folder just like the english ones. German would be /deDE/localizeddata/yourstuff
Because trigger names are strings as well. When you load up the map now, it should show.
0
@BacklitAvenger: Go
Hmm, you could use the +Add attachment button to attach the map directly to the thread. Like so...
0
Hey man, I'd really like to try this - but what's with the download link? Do I have to install this "Free Compressor" thingy?
0
@Molsterr: Go
Exactly. Currently, I'm doing like a micro challenge map with selectable arenas. Figuring this out solved a lot of problems when showing the different arenas to the player wo is selecting it (and the players who are just looking over his shoulder).
0
@Molsterr: Go
Oh god, thanks man. It works... I'm not too much into scripting, but everytime I get something, it's like a new world opens up in front of me ;) Thanks again!