Dialog with all players

futeki

Active Member
Reaction score
4
How would create a dialog with buttons for all 9 players minus the player it's showing the dialog too?

Edit: Just to make sure I'm clear, I'm trying to get the names of each player on those buttons. Not show a dialog to all players.
 

Aniconic

I am the very model of a modern major general!
Reaction score
3
I tried doing it just now :] Seems to work just fine.

This is the dialog set up. I used 2 for loops and a 2d Array. Integer A represents the player number of the Dialog's owner, and Integer B represents the player number of the players that will be displayed on the Dialog. The If, Then, Else statement makes sure that the player that will be displayed the dialog will not be shown his own name.

Trigger:
  • Dialog
    • Events
      • Time - Elapsed game time is 1.00 seconds
    • Conditions
    • Actions
      • For each (Integer A) from 1 to 9, do (Actions)
        • Loop - Actions
          • Dialog - Clear Player_Dialog[(Integer A)]
          • Dialog - Change the title of Player_Dialog[(Integer A)] to (Player + ((String((Integer A))) + Dialog))
          • For each (Integer B) from 1 to 9, do (Actions)
            • Loop - Actions
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • (Integer B) Not equal to (Integer A)
                • Then - Actions
                  • Dialog - Create a dialog button for Player_Dialog[(Integer A)] labelled (Player + (String((Integer B))))
                  • Set Player_Dialog_Button[((Integer B) + ((Integer A) x 8))] = (Last created dialog Button)
                • Else - Actions
      • For each (Integer A) from 1 to 9, do (Actions)
        • Loop - Actions
          • Dialog - Show Player_Dialog[(Integer A)] for (Player((Integer A)))


Here is the Dialog Clicked Trigger :D Basically, in the event that any one of the 9 players clicks a dialog button, the trigger will search for the clicked dialog button and catch the player numbers of the players involved.

The player number of the triggering player is List.

The selected player by the triggering player is Integer A :]

Trigger:
  • Clicked
    • Events
      • Dialog - A dialog button is clicked for Player_Dialog[1]
      • Dialog - A dialog button is clicked for Player_Dialog[2]
      • Dialog - A dialog button is clicked for Player_Dialog[3]
      • Dialog - A dialog button is clicked for Player_Dialog[4]
      • Dialog - A dialog button is clicked for Player_Dialog[5]
      • Dialog - A dialog button is clicked for Player_Dialog[6]
      • Dialog - A dialog button is clicked for Player_Dialog[7]
      • Dialog - A dialog button is clicked for Player_Dialog[8]
      • Dialog - A dialog button is clicked for Player_Dialog[9]
    • Conditions
    • Actions
      • Set List = (Player number of (Triggering player))
      • For each (Integer A) from 1 to 9, do (Actions)
        • Loop - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Clicked dialog button) Equal to Player_Dialog_Button[((Integer A) + (List x 8))]
            • Then - Actions
              • Game - Display to (All players) the text: ((Name of (Player(List))) + ( has selected + (Name of (Player((Integer A))))))
            • Else - Actions


I put a DL of the trigger work at the bottom of the post. Feel free to DL it! :D

EDIT: if you have any more issues, feel free to drop me a private message
 

Attachments

  • Player_Dialogs.w3x
    17 KB · Views: 129

Aniconic

I am the very model of a modern major general!
Reaction score
3
Not a problem, man.

You might need to tweak it a bit later down the road if and when you decide to optimize your code, but at least the logic is there.
 

futeki

Active Member
Reaction score
4
Will do. My map is so nasty right now it's not even funny. But I can do cleanup and optimization later.

Just trying to get the content and overall functionality in there.
 

Sjaakje

New Member
Reaction score
9
Aniconic, since you seem to be loving saving time by using integers, you could even make it shorter by adding to the first trigger in the final loop the action
Trigger:
  • Trigger - Add to Clicked the event Dialog - A dialog button is clicked for Player_Dialog[(Integer A)]


saves you from having to make the same event nine times in the Clicked trigger.
 

futeki

Active Member
Reaction score
4
Aniconic, since you seem to be loving saving time by using integers, you could even make it shorter by adding to the first trigger in the final loop the action
Trigger:
  • Trigger - Add to Clicked the event Dialog - A dialog button is clicked for Player_Dialog[(Integer A)]


saves you from having to make the same event nine times in the Clicked trigger.

And what function does that use?
 

Aniconic

I am the very model of a modern major general!
Reaction score
3
Aniconic, since you seem to be loving saving time by using integers, you could even make it shorter by adding to the first trigger in the final loop the action
Trigger:
  • Trigger - Add to Clicked the event Dialog - A dialog button is clicked for Player_Dialog[(Integer A)]


saves you from having to make the same event nine times in the Clicked trigger.

True, you could replace it with a periodic event every 1 second that detected when 1 of the 9 dialogs was clicked by using a for loop and a If, Then, Else statement, but I preferred to try and make it as simplified as possible. Sometimes I am paranoid about my code being hard to read, esspecially when I am trying to help someone.


Besides, it still works, and I only have to type out the array names once. :p
 

Sjaakje

New Member
Reaction score
9
I find it hard to get how both you and futeki failed to understand what I typed in that post.

INSTEAD of having 9 events in the second trigger, you make that action in the first trigger at the end of it (inside the final loop) which CREATES the 9 events for the second trigger in ONE action instead of 9. So it saves time. All it does is save time, nothing else. It works the same.

No periodic event...
 

futeki

Active Member
Reaction score
4
I find it hard to get how both you and futeki failed to understand what I typed in that post.

INSTEAD of having 9 events in the second trigger, you make that action in the first trigger at the end of it (inside the final loop) which CREATES the 9 events for the second trigger in ONE action instead of 9. So it saves time. All it does is save time, nothing else. It works the same.

No periodic event...

Based on what you've typed, I still am not following you. Looking at your first reply by the words "Add to Clicked the event Dialog" stick out. Now you're saying add it to the first trigger, perhaps you can copy/paste the triggers and adjust them reflecting your change.
 

HeX.16

Isn't Trollin You Right Now
Reaction score
131
@Sjaakje I dont understand what your saying =/ If you mean by the event, you cannot have a for each integer (check/call/whatever you call it) in an event. If you wouldnt mind show us what you mean.
 

Aniconic

I am the very model of a modern major general!
Reaction score
3
In retrospect, any number of methods would have worked...


Its all based on preference/what you deem appropriate. I chose the method I posted because it was straightforward and it worked. If you have a better method, then by all means, explain it! I'm all eyes/ears/whatever. but whats important is that the question in this topic was answered lol.
 

futeki

Active Member
Reaction score
4
In retrospect, any number of methods would have worked...


Its all based on preference/what you deem appropriate. I chose the method I posted because it was straightforward and it worked. If you have a better method, then by all means, explain it! I'm all eyes/ears/whatever. but whats important is that the question in this topic was answered lol.

I just want him to explain it, I sometimes am not very attention detailed, but I've read his post 13 times and the words that are being used to compose the sentence don't match up with what is available as functions inside of the WE.

In fact "Add to Clicked the event Dialog" is what sticks out the most. The problem is when I try to add that function to the Clicked Event, I don't even see the function. Perhaps someone else can clarify?
 

Aniconic

I am the very model of a modern major general!
Reaction score
3
I see what he is saying now, He is talking about "Trigger - Add new event"

Yeah, that works, Took me awhile to sift through your choice of words, but that makes perfect sense now.
 

futeki

Active Member
Reaction score
4
I see what he is saying now, He is talking about "Trigger - Add new event"

Yeah, that works, Took me awhile to sift through your choice of words, but that makes perfect sense now.

Yea, I finally figured it out. Took a bit of testing.
 
General chit-chat
Help Users
  • No one is chatting at the moment.
  • Ghan Ghan:
    Howdy
  • Ghan Ghan:
    Still lurking
    +3
  • The Helper The Helper:
    I am great and it is fantastic to see you my friend!
    +1
  • The Helper The Helper:
    If you are new to the site please check out the Recipe and Food Forum https://www.thehelper.net/forums/recipes-and-food.220/
  • Monovertex Monovertex:
    How come you're so into recipes lately? Never saw this much interest in this topic in the old days of TH.net
  • Monovertex Monovertex:
    Hmm, how do I change my signature?
  • tom_mai78101 tom_mai78101:
    Signatures can be edit in your account profile. As for the old stuffs, I'm thinking it's because Blizzard is now under Microsoft, and because of Microsoft Xbox going the way it is, it's dreadful.
  • The Helper The Helper:
    I am not big on the recipes I am just promoting them - I use the site as a practice place promoting stuff
    +2
  • Monovertex Monovertex:
    @tom_mai78101 I must be blind. If I go on my profile I don't see any area to edit the signature; If I go to account details (settings) I don't see any signature area either.
  • The Helper The Helper:
    You can get there if you click the bell icon (alerts) and choose preferences from the bottom, signature will be in the menu on the left there https://www.thehelper.net/account/preferences
  • The Helper The Helper:
    I think I need to split the Sci/Tech news forum into 2 one for Science and one for Tech but I am hating all the moving of posts I would have to do
  • The Helper The Helper:
    What is up Old Mountain Shadow?
  • The Helper The Helper:
    Happy Thursday!
    +1
  • Varine Varine:
    Crazy how much 3d printing has come in the last few years. Sad that it's not as easily modifiable though
  • Varine Varine:
    I bought an Ender 3 during the pandemic and tinkered with it all the time. Just bought a Sovol, not as easy. I'm trying to make it use a different nozzle because I have a fuck ton of Volcanos, and they use what is basically a modified volcano that is just a smidge longer, and almost every part on this thing needs to be redone to make it work
  • Varine Varine:
    Luckily I have a 3d printer for that, I guess. But it's ridiculous. The regular volcanos are 21mm, these Sovol versions are about 23.5mm
  • Varine Varine:
    So, 2.5mm longer. But the thing that measures the bed is about 1.5mm above the nozzle, so if I swap it with a volcano then I'm 1mm behind it. So cool, new bracket to swap that, but THEN the fan shroud to direct air at the part is ALSO going to be .5mm to low, and so I need to redo that, but by doing that it is a little bit off where it should be blowing and it's throwing it at the heating block instead of the part, and fuck man
  • Varine Varine:
    I didn't realize they designed this entire thing to NOT be modded. I would have just got a fucking Bambu if I knew that, the whole point was I could fuck with this. And no one else makes shit for Sovol so I have to go through them, and they have... interesting pricing models. So I have a new extruder altogether that I'm taking apart and going to just design a whole new one to use my nozzles. Dumb design.
  • Varine Varine:
    Can't just buy a new heatblock, you need to get a whole hotend - so block, heater cartridge, thermistor, heatbreak, and nozzle. And they put this fucking paste in there so I can't take the thermistor or cartridge out with any ease, that's 30 dollars. Or you can get the whole extrudor with the direct driver AND that heatblock for like 50, but you still can't get any of it to come apart
  • Varine Varine:
    Partsbuilt has individual parts I found but they're expensive. I think I can get bits swapped around and make this work with generic shit though
  • Ghan Ghan:
    Heard Houston got hit pretty bad by storms last night. Hope all is well with TH.
  • The Helper The Helper:
    Power back on finally - all is good here no damage
    +1
  • V-SNES V-SNES:
    Happy Friday!
    +1

      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