Cant get the dialog box to work

Status
Not open for further replies.
Level 3
Joined
May 28, 2015
Messages
41
Massacria's Arena: General development help

Hey there again...

I cant get the dialog box to work properly for my map...
the thing is it works greatly and allows to select race...but only to one player and that player is the one that will press the " select " button first...to all the others it would just show the last dialog box that player have seen though before the actual selection event dialog boxes for all the players works just fine. How can i fix that?
 
Last edited:
Level 3
Joined
May 28, 2015
Messages
41
yep now its an array of 18 buttons...and it all works fine just before anybody hits the " select " button which should create the selected race units at a certain location for a player
 
Last edited:
Level 3
Joined
May 28, 2015
Messages
41
ok guys...now i'm seriously in need of help o_O if someone can explain the "stupid me" what am i doing wrong that would be much much much appreciated

in the begining players have to choose one of 6 races to play for...i wanna do that with dialog boxes...
i got 2 dialog variables raceSelection and raceApproval...and an array of dialogButtons[18] prepared for that...what i need to do is:

first to create a dialog box with 6 buttons with races (raceSelection)...after the player press one of the buttons he gets a second dialog box (raceApproval) with the short description of strengths and weaknesses of the race and 2 buttons "select" and "back"...if the player presses "back" he obviously gets the 1st dialog shown and start all over again...but if the player press "select" button i need to create 2(later on 4) upgrade stores for tht player at a certain location in his base...

i got the creation of the shops via "create units for triggering player at triggering players start location with offset" and that works just fine...the 1st dialog is also pretty "workable" though i'm sure it might be done much easier with just a little bit more complicated trigger...so my guess is that's the second dialog window that's giving me the butthurt...the "back" button is working...but the selection button is screwed up...as soon as anybody press it the dialogs for all the res of the players gets frozen with the last window shown for the "lucky one" and you can't do anything but press "alt+F4" to exit that mess...

what should the trigger for the dialog boxes look like? i've seen several totorials and i think i got it though not completely but firmly...what might be the source of the problem? how can i solve it? if needed i'll do a screenshot of my trigger but my WE is mostly in russian

pls...that dialog problem's been eating my asshole for couple of day now and i really dont want to turn to " tavern selection " system for i think that it would not suit my map 8'(

p.s. Hope i described the problem completely and understandably
 
Level 3
Joined
May 28, 2015
Messages
41
Set the array of dialog to number of dialogs that will be shown.
Post the triggers using tags, so I can see what the hell are you doing :D

aw damn array of dialogs! sure thing xD

i don't know how to use those tags so here's an image of those triggers 8)

i think the problem might be with to whom i show the damn dialog but i've tried many different ways over those days...some of them work but still for just one
 

Attachments

  • raceSelect.png
    raceSelect.png
    25.1 KB · Views: 169
  • raceSelect1.png
    raceSelect1.png
    27.3 KB · Views: 127

Dr Super Good

Spell Reviewer
Level 64
Joined
Jan 18, 2005
Messages
27,241
Might be a good idea to post the map, or at least also the JASS version of the GUI triggers. Many people here can only read English GUI.

The problem is that for every player you re-create the dialog discarding the content used for the previous player. You should create both dialogs only once (above the player group loop in the 10 second elapsed trigger) and then show the selection one for all players (using the player group loop). In the selection response trigger you then show the approval dialog to triggering player.

Think of each dialog as an object with a life time. Before showing it to anyone you need to create it, setting its title, adding buttons etc. After it is created you then can show it to one or more players. While those players are viewing it (single player pauses, multiplayer does not) you must not modify or destroy the dialog object. When no players are viewing it then you are free to modify it again.

With dialog button press event response it is important to note that "invisible" buttons can be pressed by players. This is especially the case in multiplayer where the button press event is delayed by synchronization lag allowing one or more buttons to be pressed multiple times. Each press will run a button press event, even though after one press the dialog should become hidden and so no press is possible. As such third party tools could in theory be used to force button presses for buttons in dialogs that should not be able to be pressed at that time (dialog object lingers) or that should never be pressed by that player (never shown to them).

The solution is to simply keep track of dialog visibility and reject all event responses which occur when "invisible". Since WC3 does not keep track of dialog visibility for you, you need to use a boolean array to do so. This maps player slot ID (array index) to dialog visibility (boolean value). When creating dialog all elements in the array for all 16 players are initialized to false. When you show it to a player you set their corresponding index to true. When you receive a button press event response you only process it if the visibility for the triggering player is true, otherwise it was a "miss fire" and so should not really have happened. When the actions is run in response to a button press you set the triggering player's visibility value to false so that no further button presses can be processed for that player. If the dialog gets shown again you set it true for that player and the trigger will work.

Dialog lag exploits are very common in both WC3 and SC2. People never realise they exist because they test in singleplayer where dialog presses occur instantly and the game is paused until the dialog is resolved.
 
Level 3
Joined
May 28, 2015
Messages
41
People never realise they exist because they test in singleplayer .

yep...that's why after i encountered this issue for the first time i thought the map was ready for a public test to find out what they think i should work on i started to test it in multiplayer

though i not completely understood your explanation...i get it that i recreate the dialog for all 12 players i have but...how is it done in other maps with voting systems? or race shoosing systems? for example we have another rus map (which should have been translated into english as the creator team claims) called Key to Life...and in the beggining there is a dialog box choise to have a new hero or to load one...if you press load then the box dissapears allowing you to type the load code...and if you press the new hero button you get a new window with 12-13 heroes to choose from...is it done by creating the dialogs for all 12 players separetely? or he just tracks the visibility in a manner you described? How should the trigger look like in that case?

i mean what players should i pick to the group and what conditions should there be? what variables to use aside from dialogs and buttons arrays?

p.s. i thought i create separete dialog boxes for each player as i loop actions for picked players. and then everyone just navigate round their own dialog box so i could not understand how it is possible that one player can ruin other's choice...silly me 8)
 

Dr Super Good

Spell Reviewer
Level 64
Joined
Jan 18, 2005
Messages
27,241
though i not completely understood your explanation...i get it that i recreate the dialog for all 12 players i have but...how is it done in other maps with voting systems? or race shoosing systems? for example we have another rus map (which should have been translated into english as the creator team claims) called Key to Life...and in the beggining there is a dialog box choise to have a new hero or to load one...if you press load then the box dissapears allowing you to type the load code...and if you press the new hero button you get a new window with 12-13 heroes to choose from...is it done by creating the dialogs for all 12 players separetely? or he just tracks the visibility in a manner you described? How should the trigger look like in that case?

There are two approaches.
1. Give each player his own dialog which you change to whatever you want to show him.
2. Create "standard" dialogs which you show when needed to players.
 
Level 3
Joined
May 28, 2015
Messages
41
Okay guys... i figured out the dialog boxes for race selections...now i can move on to unit creation and further map development.

So here's another question:

I have 2 upgrade shops for each race which should be paused during the fight and unpaused when the round is over...at the moment i use the trigger to pause all units of certain type (lets say shop1 and shop2) but the problem is i have 3 lvls for each shop...with 6 races that would be 36 types of units i should pause...mby i can add all those shops to a unit group and pause that group? or that would be the same amount of triggers? I would do it anyway so i'm just wondering

p.s. Can i have some of the moderators to rename that thread to " Massacria's Arena:General development help" so i would not cr8 new threads for each stupid question i have but ask all them in this one? please?
 
Level 3
Joined
May 28, 2015
Messages
41
okay guys 8) i got the map to first really playable version...now i need to make some skills for the units...so here's the question:

as the player cannot control units on the arena i need units to cast abilities by themselves...so the best way i see is make skills with a chance to work like bash or crit...the problem is i need em to be more complicated than just that. For example i have a poisoned arrow skill on a undead archer which should be smth like that

17% chance to deal 30 bonus dmg on attack and poison the target for 2 seconds dealing 25 dmg/sec

what shall i do to achieve that?
 
Level 11
Joined
Jun 2, 2013
Messages
613
okay guys 8) i got the map to first really playable version...now i need to make some skills for the units...so here's the question:

as the player cannot control units on the arena i need units to cast abilities by themselves...so the best way i see is make skills with a chance to work like bash or crit...the problem is i need em to be more complicated than just that. For example i have a poisoned arrow skill on a undead archer which should be smth like that

17% chance to deal 30 bonus dmg on attack and poison the target for 2 seconds dealing 25 dmg/sec

what shall i do to achieve that?

Make a 'unit is attacked' event with the attacking unit condition of your unit type. In your actions set a variable to a random integer between 1-100. (Probably want to use an Array so it can be MUI)

If the integer is less than or equal to 17 then deal 30 damage to target from source your unit, Then make a dummy unit that will cast your slow poison spell, otherwise do nothing.
 
Level 12
Joined
Sep 11, 2011
Messages
1,176
okay...i made the dummy unit but how can i order it to cast the second part of the spell? i mean there's no option to order a unit to use an ability


EDIT : oopss.. wrong one.. i thought it's slow.. so you should make the ability based of shadow strike and use this
  • Unit - Order yourdummyunit to Night Elf Warden - Shadow Strike yourtarget
and this action is from Unit - Issue Order Targeting A Unit
 
Last edited:
Level 12
Joined
Sep 11, 2011
Messages
1,176
So it is possible to order to use ability if it base on a certain default spell? does it matter based on which ability i base my custom spell?

you should check if the action Unit - Issue order Targeting Unit have that ability you based of.. if there is none, you can't order them to use that ability.. hence I told you to based the ability of the ability that exists on the list of Unit - Issue Order Targeting Unit.. In your case, Shadow Strike is your best bet, because it causes poison to the target.
 
Level 3
Joined
May 28, 2015
Messages
41
i already made that ability differently, but thx. i'm trying to make an ability that would make a unit make a second attack immediately now. I thought to make that through a dummy that would cast a thunderbolt with the animation of a simple attack of a unit but cant understand how...any thoughts?
 
Level 3
Joined
May 28, 2015
Messages
41
the ability should make a unit attack twice (without interrupting the attack cooldown)
so i thought to make that ability with a dummy that would be casting an ability based on a thunderbolt...

should it be smth like this?
  • Unit - a unit is attacked
  • Conditions
  • level of ability more than 0
  • random intenger between 1 and 100 less than 17
  • mana of attacking unit equals or more than 10
  • Actions
  • Unit - create dummy at attacking unit
  • Unit - issue order thundebolt at attacked unit
  • Unit - destroy dummy
 
Level 12
Joined
Sep 11, 2011
Messages
1,176
the ability should make a unit attack twice (without interrupting the attack cooldown)
so i thought to make that ability with a dummy that would be casting an ability based on a thunderbolt...

should it be smth like this?
  • Unit - a unit is attacked
  • Conditions
  • level of ability more than 0
  • random intenger between 1 and 100 less than 17
  • mana of attacking unit equals or more than 10
  • Actions
  • Unit - create dummy at attacking unit
  • Unit - issue order thundebolt at attacked unit
  • Unit - destroy dummy

yeah, but I don't think it's possible to start a new attack without intterupting the first attack cooldown though..

EDIT: my suggestion is to create an exact copy of your unit and order them to attack.. give expiration timer to that unit, prevent the unit from being selected and you're done..
 
Level 3
Joined
May 28, 2015
Messages
41
yeah, but I don't think it's possible to start a new attack without intterupting the first attack cooldown though..

yep i think that's impossible too...so i did as a spell...now i got the dummy to cast an empty thunderbolt spell at the attacked enemy and i gave the spell animation of attacking unit basic attack so it looks like a unit is attacking twice without iinterruption (though without playing unit attack animation) the only issue i got is when i set thunderbolt ability "stun" to 0 it makes it permanent 8(
 
Level 12
Joined
Sep 11, 2011
Messages
1,176
yep i think that's impossible too...so i did as a spell...now i got the dummy to cast an empty thunderbolt spell at the attacked enemy and i gave the spell animation of attacking unit basic attack so it looks like a unit is attacking twice without iinterruption (though without playing unit attack animation) the only issue i got is when i set thunderbolt ability "stun" to 0 it makes it permanent 8(

here if you happen to not read my last post..
my suggestion is to create an exact copy of your unit and order them to attack.. give expiration timer to that unit, prevent the unit from being selected and you're done..

try 0.01 instead of 0, it does the same thing but won't make it permanent.
 
Level 3
Joined
May 28, 2015
Messages
41
try 0.01 instead of 0, it does the same thing but won't make it permanent.

yep it works and i kinda like that extra 0.01 sec microstun as an indication of successful spell cast 8)

i've read it though wouldn't it make 2 units at the same place playing two animations? i mean you could see that there is another unit? i've made it in trigger so it forces attacking unit to play attack animation with some delay now i just need to figure out those delays so it would be casted at the time of the second animation
 
Level 12
Joined
Sep 11, 2011
Messages
1,176
yep it works and i kinda like that extra 0.01 sec microstun as an indication of successful spell cast 8)

i've read it though wouldn't it make 2 units at the same place playing two animations? i mean you could see that there is another unit? i've made it in trigger so it forces attacking unit to play attack animation with some delay now i just need to figure out those delays so it would be casted at the time of the second animation

I think you can go to Object Editor and see the unit's attack delay, I'm not sure if that's what you mean though.. I'm just going to say good luck and hope you could finish that.. It's 2:28 AM here, and I'm going to bed.. XD
 
Status
Not open for further replies.
Top