• 🏆 Texturing Contest #33 is OPEN! Contestants must re-texture a SD unit model found in-game (Warcraft 3 Classic), recreating the unit into a peaceful NPC version. 🔗Click here to enter!
  • It's time for the first HD Modeling Contest of 2024. Join the theme discussion for Hive's HD Modeling Contest #6! Click here to post your idea!

Hello, need help with trigger/dialog for spawning 1 of 3 different units depending on the players' choice

Status
Not open for further replies.
Level 2
Joined
Jul 12, 2021
Messages
6
I am trying to create a dialog of three choice buttons at the start of the game for every player. So far I've only made it to actually spawn a unit for red (tried multiplayer with blue, and it didn't work).


I hope you can see clearly the attached images.
So works for red, but not for blue.
 

Attachments

  • Capture1.PNG
    Capture1.PNG
    22.1 KB · Views: 17
  • Capture2.PNG
    Capture2.PNG
    14.5 KB · Views: 18
  • Capture3.PNG
    Capture3.PNG
    16.4 KB · Views: 17
  • Capture4.PNG
    Capture4.PNG
    15.5 KB · Views: 16
  • Capture5.PNG
    Capture5.PNG
    16.9 KB · Views: 17
  • Capture6.PNG
    Capture6.PNG
    24.7 KB · Views: 23
Level 2
Joined
Jul 12, 2021
Messages
6
Thank you very much.
Instead of having 10 different triggers to show the diaolog for each player (and checking for unit slot status (which I heard might cause desync?)) I instead made one trigger that had a loop at the end ((Integer A) from 1 to 10)) Although should I have a check for each of the 10 slots if they are filled with players or not?

I also changed it to be triggering player and it worked! :D

And for spawning enemy units mid, and getting them to attack, is it okay with just selecting some of the units (like every 30 secs or something) and have them attack-move to a random point in the playable map area, or is there something else one should add?
 

Attachments

  • Capture7.PNG
    Capture7.PNG
    16.7 KB · Views: 19
  • Capture8.PNG
    Capture8.PNG
    16.9 KB · Views: 14
  • Capture9.PNG
    Capture9.PNG
    3.4 KB · Views: 13

Uncle

Warcraft Moderator
Level 64
Joined
Aug 10, 2018
Messages
6,537
Checking for slot status can cause desyncs during Map Initialization (loading screen) but there's nothing wrong with doing it once everyone has loaded into the game, say after a 1.00 second Elapsed Time Event.

It's smart to organize your players into multiple Player Groups near the start of the game so you can easily reference them throughout your triggers.

I usually have a few Player Groups to keep track of everyone:
  • Users (every user player, leaving players will remain in this group)
  • ActiveUsers (same as Users but leavers will be removed from the group)
  • Leavers (everyone that has left the game)
  • ComputerPlayers (computer players, excluding neutrals)
  • NeutralPlayers (neutral hostile, passive, extra, victim)
And whatever else you might need. Once you have these Player Groups setup and a trigger that manages leaving players you'll be all set.
Then you can do something like:

Pick every player in ActivePlayers -> Show Dialog for picked player
 
Last edited:
Status
Not open for further replies.
Top