Announcement

Collapse
No announcement yet.

Is this idea going to be too complex to pull off?

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

    Is this idea going to be too complex to pull off?

    I have this idea of two rooms connected with a corridor (green). The two rooms will have triggers. As you trigger one, it will cause the other room to shift, allowing the corridor to extend. So you keep going between the two rooms but each time the corridor is extending.

    So I'd need a trigger to not only move the pieces but also bring in another corridor out of nowhere AND move the triggers in the room (or spawn new ones). Is this an insane undertaking for someone with no coding experience?


    Click image for larger version

Name:	vPYzzPJ.png
Views:	1
Size:	84.1 KB
ID:	1140467

    #2
    I think this is perfectly do-able.

    You can move an actor or set of actors with "Set Actor Location". Simply get their current location, break the vector, then add the hallway segment's width to the "X" value, apply the result to the actors.

    As far as adding a new hallway segment, this can be made easier by always adding it in the same place. Run a "Spawn actor from class" at a set location.

    I'm gonna load up MSPaint and draw some stuff..




    Edits:

    Click image for larger version

Name:	AupbKFG.png
Views:	1
Size:	24.1 KB
ID:	1060625



    Ok so this is completely dependent on how you have the rest of your level set up, but it can be changed to accommodate whatever you have.

    I think it would be best if both trigger box A and B performed the exact same function, for simplicity.


    So in frame 1, the initial setup with all the rooms labeled. At this point, I would also create an array containing each hallway. At the moment, it will only have one hallway (Room 5).

    In frame 2, actors 3, 4, and every hallway piece will need to be shifted to the right. (Note: I didn't notice the doorway on the right room until after I made this, so it may be that you need to shift everything to the LEFT so it doesn't overlap other map contents.)
    This can be done be getting room 3, getting it's location, breaking the vector, adding the hallway's width to X (or Y, depending on your rotation), and setting it back as room 3's location.
    Then do the same for 4.
    Then, using the array containing each hallway, run a "For each" loop on it and do the same thing done for rooms 3 and 4.
    Now, all the appropriate rooms should be shifted to make room for a new hallway segment.

    In frame 3, a new hallway segment is added (Spawn Actor from Class) at the location just outside of Room 2 (green blob). For simplicity, you can always use the same location and keep shifting everything right. That hallway should then be added to the array containing the hallways.



    There are some downsides to this.
    1. Without a condition check, the hallway could extend infinitely and push the set of rooms infinitely in one direction. You will need to leave one side completely open to leave room for everything to shift.
    2. If the hallway segments are not identical, the player may notice exactly which hallways moved and which one was spawned, destroying the illusion.
    3. If the player can somehow be in the hallway when all this happens, it will again destroy the illusion.
    Last edited by Chumble; 11-05-2014, 01:40 PM.

    Comment


      #3
      Originally posted by Chumble View Post
      I'm gonna load up MSPaint and draw some stuff..
      You should be a novelty account.

      Comment


        #4
        Hello,
        as Chumble said, this is easily doable. For example with 3 blueprints : your static room , your moving room and your corridor. Each time you have your triggger event, you add an offset to the location of your moving room blueprint of a corridor length and you spawn a new corridor blueprint beetween new moved room position and last corridor.

        Comment


          #5
          Originally posted by Cobryis View Post
          You should be a novelty account.
          Haha well as I've said in other posts, I am TERRIBLE at explaining stuff and I'm a very visual person. Visuals help me explain stuff. And I'm at work and I don't wanna work and MSPaint is kinda fun.

          Comment


            #6
            This is fantastic, thanks so much Chumble. Noticed you using the word 'array' a few times, I better learn that. Actually, is there any particular aspect of blueprints that would be worth looking up for this task? Array, Spawn Actor from Class, For each (Not used those before)

            Comment


              #7
              cool draw Chumble ^^ Only things i would add is that it would be better to not have triggers on the corridor line to not see the move and spawn event and remeber that you'll have to move your character too when he activates the moving room trigger.

              Comment


                #8
                Stuff like this makes me wish for the return of UTPortals. It would be really cool to do something like this with disconnected hallway elements and simply changing the targets of the UTPortal entities; you could also make the hallway eventually change shape or other things, without ever actually changing the rooms themselves at all.

                Comment


                  #9
                  Originally posted by Adam Capone View Post
                  This is fantastic, thanks so much Chumble. Noticed you using the word 'array' a few times, I better learn that. Actually, is there any particular aspect of blueprints that would be worth looking up for this task? Array, Spawn Actor from Class, For each (Not used those before)
                  Uhh, only notable nodes I can think of
                  • Get Actor Location - This will be used for all actors that need to be shifted to the right.
                  • Set Actor Location - Feed the Get Actor Location + Offset into this to move an actor by an offset. Note: This will be an instantaneous move, not a smooth transition.
                  • For Each loop (Can't find a link for this one) - Feed in an array and it will perform a function on each element in the array. If you're not familiar with the concept of arrays, think of it as just a variable container holding multiple items of a type. So an "Int" variable will hold a single integer. An "Int" array can contain any number (I don't know what UE's limit on arrays is, but you probably don't need to worry about it) of Ints. So in your case, your array would contain a bunch of hallways. I got sidetracked. Anyways, the for each loop would get each hallway in the array and apply the Get/Set actor location for each one
                  • Spawn Actor from Class - Pretty straightforward. You select your class (hallway) from the drop-down menu and feed in the location (green blob). Note the return value here - this will contain the actor (in-game instance of the specified class) you spawned which you can feed into......
                  • Append Array - Just feed in your array and the actor from the Spawn Actor node and it will tack that actor onto the end of the array.

                  Think that's about it.



                  As far as the array goes, you can create it as a variable in the event graph of.. uhh.. I'd guess all this would be handled by the level blueprint. From there, you can add to it whenever you like.

                  Also, as Fen mentioned, when the player uses the right trigger box, they would need to be moved as well - I forgot that part. Fen also mentioned the player looking down the hallway when this whole process takes effect. If the player is looking, they will visibly see the opposite room get further away instantly. It should look the same from either side. If you're fine with them seeing this, no changes need to be made. If you want to kinda hide the change from the player, I would suggest adding some doors leading into the hallway or moving the triggers to another location.

                  I have tons of free time (my job is slow and boring) so if you ever need a hand with any of this stuff, feel free to send me a message. Only restriction I have is I can't load the engine at work, so screenshots and MSPaint are my friends.

                  Comment

                  Working...
                  X