• 🏆 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!
  • 🏆 Hive's 6th HD Modeling Contest: Mechanical is now open! Design and model a mechanical creature, mechanized animal, a futuristic robotic being, or anything else your imagination can tinker with! 📅 Submissions close on June 30, 2024. Don't miss this opportunity to let your creativity shine! Enter now and show us your mechanical masterpiece! 🔗 Click here to enter!

Train Station for Real Life

Status
Not open for further replies.
Level 1
Joined
Aug 2, 2007
Messages
2
Hello, I am trying to make a train station in my map. I would like to have a pop up that has 3 buttons on what station to choose to go to. How could I do that?
 
Level 8
Joined
May 27, 2007
Messages
170
Hi there. What your talking about is a dialog box, and it is relatively easy to create with just a few simple triggers. First you need a trigger to set it up, which is best done when elapsed game time is 1 second or whatever, like so:

  • Set up dialog
    • Events
      • Time - Elapsed game time is 1.00 seconds
    • Conditions
    • Actions
      • Dialog - Clear StationDialog
      • Dialog - Change the title of StationDialog to What station do you...
      • Dialog - Create a dialog button for StationDialog labelled Station 1
      • Set Station1Button = (Last created dialog Button)
      • Dialog - Create a dialog button for StationDialog labelled Station 2
      • Set Station2Button = (Last created dialog Button)
      • Dialog - Create a dialog button for StationDialog labelled Station 3
      • Set Station3Button = (Last created dialog Button)
      • Dialog - Hide StationDialog for Player 1 (Red)

StationDialog is a Dialog variable, and it just helps identify that specific dialog if you have more than one dialog in your map. You still use it even if you have only the one dialog.
StationDialogButton is just a Dialog Button variable and helps identify which button is being pressed when acting on a Dialog Button is pressed event.

Next you need a simple event which will display the dialog when a unit enters a station or whatever, this event can be whatever you want, I used a simple region enter though:

  • Player triggers dialog
    • Events
      • Unit - A unit enters Station Platform <gen>
    • Conditions
    • Actions
      • Set TrainPassenger = (Entering unit)
      • Dialog - Show StationDialog for Player 1 (Red)

TrainPassenger is simply a unit variable which is set to the unit which activates the dialog, this just makes is easy to identify which unit is to be carried in the train later on.

Finally you need an event which will recognise when a player clicks on a button and is choosing a station, then send the hero or whatever unit to that station:

  • Choose station 1
    • Events
      • Dialog - A dialog button is clicked for StationDialog
    • Conditions
      • (Clicked dialog button) Equal to Station1Button
    • Actions
      • Dialog - Hide StationDialog for Player 1 (Red)
      • -------- Now add all your own actions such as moving units to different stations --------
      • -------- For example: --------
      • Unit - Move TrainPassenger instantly to (Center of Station 1 <gen>)
      • Camera - Pan camera for Player 1 (Red) to (Center of Station 1 <gen>) over 0.00 seconds

Hope this helps you out! Let me know if you need any more help
 
Status
Not open for further replies.
Top