Announcement

Collapse
No announcement yet.

Player text input as trigger/event

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    Player text input as trigger/event

    (this post may look similar to another post I left today, but it's a different question)
    Hello folks- I am not a programmer, so I'm trying to do as much of this in blueprint as possible...

    Essentially I have a sports stadium full of seats, and I need to be able to snap my camera/player to specific seats. I have set up a small proof-of-concept project which is working so far:


    The camera movement is triggered simply by pressing keys 1-4
    Click image for larger version

Name:	camera_control_bp.jpg
Views:	2
Size:	83.4 KB
ID:	1158855

    Would it be possible to have a text field (in the hud?) that the player can enter in a number between 1-4, then press ENTER to trigger this movement?


    As I said, I'm not a programmer, so I'm treading unfamiliar territory here. But I can consult the programmers I work with if the solution I'm looking for is over my head. Thanks for your time.

    #2
    Create an Event Dispatcher within the HUD and call it when your Player presses a button in the HUD to confirm what seat they wish to take. You will want to pass the seat number as a variable parameter in the Event Dispatcher. After that you need to bind a Custom Event to your Event Dispatcher you created so that the Custom Event will fire when the Event Dispatcher is called. You will need a reference to your HUD where you created the Event Dispatcher to be able to bind to it.
    Im an Moderator on UnrealSlackers Discord! Which is a Community driven group of likeminded people here to discuss UE4! Join UnrealSlackers on Discord!

    Comment


      #3
      Your question was a bit vague (or the title was wrong), but you could have some sort of text input, and then "switch on string" after they are done typing, depending on what they have typed, it will execute certain pins.
      Last edited by Jamendxman3; 08-06-2015, 01:08 AM.
      Marketplace Assets

      Advanced Mobile Input: Marketplace Page | Support Thread ――― Easy Input Remapping: Marketplace Page | Support Thread
      Multiplayer Blueprint Chat System: Marketplace Page | Support Thread ――― Closing Credits System: Marketplace Page | Support Thread
      Minesweeper Template: Marketplace Page | Support Thread ――― Maze Creator: Marketplace Page | Support Thread

      Comment


        #4
        Thank you for the replies, I will try those suggestions at work tomorrow. Sorry if my lingo was incorrect- sometimes I don't know the correct terminology when I'm trying to describe something I've never done before.

        How might I better describe what I'm looking for? Basically I just need text fields that the user can enter in search criteria, hit [Enter] and then search through data based on the text input.

        Comment


          #5
          So in other words, you want to teleport the player to the seat name they type in? How you should do this depends on tons of factors, do your seats have alphabetical letters in them (And from A-?) Are your seats actors?
          Marketplace Assets

          Advanced Mobile Input: Marketplace Page | Support Thread ――― Easy Input Remapping: Marketplace Page | Support Thread
          Multiplayer Blueprint Chat System: Marketplace Page | Support Thread ――― Closing Credits System: Marketplace Page | Support Thread
          Minesweeper Template: Marketplace Page | Support Thread ――― Maze Creator: Marketplace Page | Support Thread

          Comment


            #6
            Originally posted by Jamendxman3 View Post
            So in other words, you want to teleport the player to the seat name they type in?
            Yes, that is correct.

            There is likely to be letters involved, an example entry could be
            Section:205
            Row:G
            Seat: 12

            There will not be individual actors per seat, because our scenes are entire sports stadiums that can have 10s of thousands of seats. As such, an entire section of seats will be collapsed into a single static mesh. Seat coordinates will be stored in a separate file and we hope to be able to reference that file when naming the seats by the means I've described.

            So basically I'm trying to just proof-of-concept this idea one baby step at a time. I have a separate thread running regarding the communication between Unreal and referencing that external coordinate data. In this thread I'm trying to flesh out Text Input ability.

            Comment


              #7
              Originally posted by hypersapien View Post
              Yes, that is correct.

              There is likely to be letters involved, an example entry could be
              Section:205
              Row:G
              Seat: 12

              There will not be individual actors per seat, because our scenes are entire sports stadiums that can have 10s of thousands of seats. As such, an entire section of seats will be collapsed into a single static mesh. Seat coordinates will be stored in a separate file and we hope to be able to reference that file when naming the seats by the means I've described.

              So basically I'm trying to just proof-of-concept this idea one baby step at a time. I have a separate thread running regarding the communication between Unreal and referencing that external coordinate data. In this thread I'm trying to flesh out Text Input ability.
              Ok, you'll need to do some simple math to determine which mesh to spawn at, and what position along the mesh. It looks like it would be best if the section would be representing the mesh, the row would be representing the row, and the seat would be representing the seat. I am not sure of your ability to write simple algorithms, so you do know what sort of math you will need to be doing? If you don't, I'll need to get quite a few numbers from you to write an algorithm.
              Marketplace Assets

              Advanced Mobile Input: Marketplace Page | Support Thread ――― Easy Input Remapping: Marketplace Page | Support Thread
              Multiplayer Blueprint Chat System: Marketplace Page | Support Thread ――― Closing Credits System: Marketplace Page | Support Thread
              Minesweeper Template: Marketplace Page | Support Thread ――― Maze Creator: Marketplace Page | Support Thread

              Comment


                #8
                Originally posted by Jamendxman3 View Post
                Ok, you'll need to do some simple math to determine which mesh to spawn at, and what position along the mesh. It looks like it would be best if the section would be representing the mesh, the row would be representing the row, and the seat would be representing the seat. I am not sure of your ability to write simple algorithms, so you do know what sort of math you will need to be doing? If you don't, I'll need to get quite a few numbers from you to write an algorithm.
                I'm not sure why the math is necessary. I may have misspoke. We have all of the absolute seat coordinates (position and zrotation), as a script in 3DsMax would have generated this for us prior to collapsing the entire sections and exporting to FBX.

                For example, here is a sample .json file I am putting together containing the seat coordinates in the video above. As I am not a programmer, I may not have formatted this code perfectly, and I haven't played with Rama's blueprint nodes yet so I don't know how it handles File I/O yet. But just to show you what type of information we have to work with, here it is:

                "seats":[
                {"section":"100", "row":"1", "seat":"1", "xpos":"0", "ypos":"-291.4", "zpos":"112.8", "zrot":"90"},
                {"section":"100", "row":"1", "seat":"2", "xpos":"291", "ypos":"0", "zpos":"112.8", "zrot":"180"},
                {"section":"100", "row":"1", "seat":"3", "xpos":"0", "ypos":"291.4", "zpos":"112.8", "zrot":"270"},
                {"section":"100", "row":"1", "seat":"4", "xpos":"-291.4", "ypos":"0", "zpos":"112.8", "zrot":"0"}
                ]
                So for example, if a user enters "100" for Section, "1" for row, and "1" for seat, I am hoping Unreal would be able to reference the position and rotation information on the first entry of that code. Does this sound feasible?

                Comment


                  #9
                  Well, I haven't used Rama's plugin because I'd rather be creative on my part, and I don't want to have to deal with compiling issues, but as long as Rama's plugin can convert a .json into a string, it would be possible, but you would still need to use a few loops and branches to convert the .json into actual usable info. Just by looking at that file above, I can tell that it will likely not work, because why does seat 2 have 90 more degrees of rotation than seat 1? I'd imagine that it would be more accurate to say that seat 2 has 2 degrees of rotation while seat 1 has 1 degree, unless there were only 4 columns in the entire stadium.
                  Marketplace Assets

                  Advanced Mobile Input: Marketplace Page | Support Thread ――― Easy Input Remapping: Marketplace Page | Support Thread
                  Multiplayer Blueprint Chat System: Marketplace Page | Support Thread ――― Closing Credits System: Marketplace Page | Support Thread
                  Minesweeper Template: Marketplace Page | Support Thread ――― Maze Creator: Marketplace Page | Support Thread

                  Comment


                    #10
                    The values in the code I shared are for this example scene, which was in the first post

                    Comment


                      #11
                      Ok, then like I previously mentioned, it will work as long as Rama's plugin is able to load a .json into a string. If it does work, there may be an issue of performance when loading, so you have to choose between calculating locations at run-time, or loading them.
                      Marketplace Assets

                      Advanced Mobile Input: Marketplace Page | Support Thread ――― Easy Input Remapping: Marketplace Page | Support Thread
                      Multiplayer Blueprint Chat System: Marketplace Page | Support Thread ――― Closing Credits System: Marketplace Page | Support Thread
                      Minesweeper Template: Marketplace Page | Support Thread ――― Maze Creator: Marketplace Page | Support Thread

                      Comment


                        #12
                        Cool, thanks for your guidance. I'll play around with his plugin and report back if I make progress.

                        Comment

                        Working...
                        X