Announcement

Collapse
No announcement yet.

HELP - Trigger Box Not Effected By All Weapons

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

    #16
    i suspect that in the engine they work in editor lots of featured dont yet
    Join the community Facebook page
    https://www.facebook.com/pages/Unreal-Tournament-4-Community/302380673298678

    Comment


      #17
      How do you make a button into a Blueprint anyway? And I still can't see any option in Blueprint or for the actor itself that let all weapons effect the trigger box.

      Attached Files
      Win 10
      iMac (27-inch, Late 2013)
      3.5 GHz Intel Core i7
      32 GB 1600 MHz DDR3
      NVIDIA GeForce GTX 780M 4096 MB

      Maps:
      DM-RadioActive (Work In progress) DM-Ethos (WIP) DM-QWERTY (WIP) DM-TwinFalls(WIP)
      2k4 DM-MoonGames, DM-Abrenabba, DM-Aphelion, DM-Pyrimid-Of-Gold, DM-UPH-Hexed, Dm-Saint, DM-LethalAdixion, DM-C4-Ariza, Dm-C4-SleepyTomb,

      Comment


        #18
        OK I'm doing this as a test so it's more clear to me.

        I would like to set up a BluePrint like so.

        When u walk into the trigger box (green cube) it activates the PainCausingVolume (pink cube) and plays an alarm sound, the pain volume needs to be active for 6 seconds at 20% damage per second . It should also reward the player with a kill if triggered when another actor is inside, once the 6 seconds is up it needs to reset. It would need to be setup without any replication issues. What would be the necessary steps I need to take to make this happen?

        Oh, and the trigger needs to be triggered by all weapons.

        Attached Files
        Win 10
        iMac (27-inch, Late 2013)
        3.5 GHz Intel Core i7
        32 GB 1600 MHz DDR3
        NVIDIA GeForce GTX 780M 4096 MB

        Maps:
        DM-RadioActive (Work In progress) DM-Ethos (WIP) DM-QWERTY (WIP) DM-TwinFalls(WIP)
        2k4 DM-MoonGames, DM-Abrenabba, DM-Aphelion, DM-Pyrimid-Of-Gold, DM-UPH-Hexed, Dm-Saint, DM-LethalAdixion, DM-C4-Ariza, Dm-C4-SleepyTomb,

        Comment


          #19
          Hey effects, I've started working on some example Blueprints for people to use (similar to the generic lift) that can serve as re-usable assets or just examples to learn from. So far I've just got a basic all-purpose button, but I'm aiming to have a couple of trap setups added to the example map in next build, and then we'll add more things like doors and such over time. In the mean time I'll get back to this thread later with screenshots of the BP script once I've got more done.

          I know this stuff is overwhelming at first, especially when you factor in network replication, but once you've got a grasp of how Blueprints work the possibilities for what you can make are pretty huge.

          Comment


            #20
            That's awesome Thomas, and it will be a great help Once I figure it all out, and how to really work in Blueprint, mapping should become a lot easier that's for sure. I have so may ideas that would require me doing so.

            I look forward to the examples!

            Originally posted by [Epic]Thomas Browett View Post
            Hey effects, I've started working on some example Blueprints for people to use (similar to the generic lift) that can serve as re-usable assets or just examples to learn from. So far I've just got a basic all-purpose button, but I'm aiming to have a couple of trap setups added to the example map in next build, and then we'll add more things like doors and such over time. In the mean time I'll get back to this thread later with screenshots of the BP script once I've got more done.

            I know this stuff is overwhelming at first, especially when you factor in network replication, but once you've got a grasp of how Blueprints work the possibilities for what you can make are pretty huge.
            Win 10
            iMac (27-inch, Late 2013)
            3.5 GHz Intel Core i7
            32 GB 1600 MHz DDR3
            NVIDIA GeForce GTX 780M 4096 MB

            Maps:
            DM-RadioActive (Work In progress) DM-Ethos (WIP) DM-QWERTY (WIP) DM-TwinFalls(WIP)
            2k4 DM-MoonGames, DM-Abrenabba, DM-Aphelion, DM-Pyrimid-Of-Gold, DM-UPH-Hexed, Dm-Saint, DM-LethalAdixion, DM-C4-Ariza, Dm-C4-SleepyTomb,

            Comment


              #21
              Okay, in the next build the example map will include an all-purpose button Blueprint and a trap room with a slamming door and damage volume inside it. There are also two simple door Blueprints (one opens by proximity, the other by damage) that jayoplus put together for us, based on the ones in DM-Overlord. These will all be set up with various parameters for people to customize like the lift and jump pad Blueprints that we have already.

              I'll give a quick guide for how I made the button and trap room for you, but since there will be in-editor examples for you to use and pick apart I won't go over every detail. Plus there are lots of different ways to structure these kinds of things, and mine might not necessarily be the best one for your map.

              In this case the button is a self-contained Blueprint because I want people to be able to re-use it for different things, or be able to easily hook up multiple buttons to one or more traps within the same level. This makes it easier to use but more complex to set up initially, so in your case it might be easier to just make the button, door and damage volume all part of a single Blueprint.



              So, as you can see above, the button mesh has a small box trigger over it. This is only for detecting player overlaps, and should have its collision presets set to ignore everything except pawns, which it should overlap. The actual button mesh itself should be set to BlockAllDynamic, as this is the component that will detect hits from weapons.

              Here's the script for triggering the button by overlaps and by damage:



              Hopefully the comments give a good idea of what's going on, but to put it all into context, these are the basic goals:

              1. Make sure that this script only occurs on the server's instance of the BP, not the clients'. As a rule you want the server to hold all the information and control everything gameplay-related, while the client instances of the BP only do the cosmetic stuff like visuals and audio. We manage that by having the sever instance call "Multicast" custom events (these are labelled "ButtonFX" in the screenshot) that will fire for all clients
              2. Get a reference to the controller of the character that damaged or overlapped the button, so we can give that person credit for any damage the trap outputs
              3. Block further button interactions by setting the "Button pressed" bool
              4. Start a cooldown timer, which counts down in the background until the button becomes usable again and the trap can deactivate

              If you haven't used it before, the "Set Timer" function there will find the custom event that matches the name you type in (in this case, it's "CooldownFinished"), and then fire that event when the timer completes. If you ever need them, there are also functions that can pause or cancel a timer too.

              Here's the multicast "ButtonFX" event being called above, and the sequence for animating the button:



              Timelines are for animating things in a similar way to Matinee, but are much more versatile at the cost of requiring a bit more manual setup. If you need examples you can try looking at the lift Blueprint or the doors in DM-Overlord. In this case, I'm using this sequence to move the button inward and also to flash the brightness of the button material before fading it out so it's clear that it can't be interacted with anymore. Animating a material in this way also requires some setup with construction script and the material editor, but it should be pretty easy to find tutorials or examples of how to do that.

              One thing this doesn't account for is what happens if a player joins the server after the button has been pressed, but before the cooldown finishes. Since they weren't there to receive the "ButtonFX" event, the button will still be glowing and sticking out for them even though for everyone else it's dark and pressed in. There's a solution for this in the version of the button in the next build, but I've left it out here for the sake of keeping things simple. If you want to learn more, though, there are some good video tutorials about replication here: https://wiki.unrealengine.com/Videos...eo=TbaOyvWfJE0

              The next step is triggering the trap. I'm guessing you already have a door figured out, but if not there's a good example to copy from in DM-Overlord. If you're making the button and door part of the same Blueprint, you can even use the button timeline for moving the door too and save a bit of work. Any extras like lights and additional sounds can be added to that portion of the script as well.

              Unfortunately it looks like you can't add a pain volume to a Blueprint, but it's pretty easy to create some script that does the same thing using a generic box volume. Here's what I did:



              This should only happen on the server, since damage events automatically affect clients. The "Damage Volume" component is just a box component I added to the Blueprint, with its collision presets set to ignore everything except pawns, just like the small box on the button. This bit of script basically gets a list of all pawns overlapping the box every 0.5 seconds and then applies 20 damage to them, giving credit to the player who activated the trap.

              Since this is where damage portion of the trap is being turned on, the "Set Timer" function can be connected to the top wire going off the right side of the screenshot of the button script above. In this case the timer is set to loop, which means it will repeatedly call the "VolumeDamage" event until the "Clear Timer" function at the bottom is called, when you want to deactivate the trap.

              That should be everything. The version of this in the example map includes more cosmetic effects like lights, sounds and particles when the trap is active, as well as some screen effects for the person taking damage, but this is already pretty long so I'll leave those out for now. Let me know if you have any questions or if I've missed anything important.
              Attached Files
              Last edited by EGTomB; 05-16-2015, 10:45 PM. Reason: Forum removed my original attachments

              Comment


                #22
                Thanks so much for the help Thomas, I really appreciate it. I will give that a go and see if I can work it out.

                Originally posted by [Epic]Thomas Browett View Post
                Okay, in the next build the example map will include an all-purpose button Blueprint and a trap room with a slamming door and damage volume inside it. There are also two simple door Blueprints (one opens by proximity, the other by damage) that jayoplus put together for us, based on the ones in DM-Overlord. These will all be set up with various parameters for people to customize like the lift and jump pad Blueprints that we have already.

                I'll give a quick guide for how I made the button and trap room for you, but since there will be in-editor examples for you to use and pick apart I won't go over every detail. Plus there are lots of different ways to structure these kinds of things, and mine might not necessarily be the best one for your map.

                In this case the button is a self-contained Blueprint because I want people to be able to re-use it for different things, or be able to easily hook up multiple buttons to one or more traps within the same level. This makes it easier to use but more complex to set up initially, so in your case it might be easier to just make the button, door and damage volume all part of a single Blueprint.



                So, as you can see above, the button mesh has a small box trigger over it. This is only for detecting player overlaps, and should have its collision presets set to ignore everything except pawns, which it should overlap. The actual button mesh itself should be set to BlockAllDynamic, as this is the component that will detect hits from weapons.

                Here's the script for triggering the button by overlaps and by damage:



                Hopefully the comments give a good idea of what's going on, but to put it all into context, these are the basic goals:

                1. Make sure that this script only occurs on the server's instance of the BP, not the clients'. As a rule you want the server to hold all the information and control everything gameplay-related, while the client instances of the BP only do the cosmetic stuff like visuals and audio. We manage that by having the sever instance call "Multicast" custom events (these are labelled "ButtonFX" in the screenshot) that will fire for all clients
                2. Get a reference to the controller of the character that damaged or overlapped the button, so we can give that person credit for any damage the trap outputs
                3. Block further button interactions by setting the "Button pressed" bool
                4. Start a cooldown timer, which counts down in the background until the button becomes usable again and the trap can deactivate

                If you haven't used it before, the "Set Timer" function there will find the custom event that matches the name you type in (in this case, it's "CooldownFinished"), and then fire that event when the timer completes. If you ever need them, there are also functions that can pause or cancel a timer too.

                Here's the multicast "ButtonFX" event being called above, and the sequence for animating the button:



                Timelines are for animating things in a similar way to Matinee, but are much more versatile at the cost of requiring a bit more manual setup. If you need examples you can try looking at the lift Blueprint or the doors in DM-Overlord. In this case, I'm using this sequence to move the button inward and also to flash the brightness of the button material before fading it out so it's clear that it can't be interacted with anymore. Animating a material in this way also requires some setup with construction script and the material editor, but it should be pretty easy to find tutorials or examples of how to do that.

                One thing this doesn't account for is what happens if a player joins the server after the button has been pressed, but before the cooldown finishes. Since they weren't there to receive the "ButtonFX" event, the button will still be glowing and sticking out for them even though for everyone else it's dark and pressed in. There's a solution for this in the version of the button in the next build, but I've left it out here for the sake of keeping things simple. If you want to learn more, though, there are some good video tutorials about replication here: https://wiki.unrealengine.com/Videos...eo=TbaOyvWfJE0

                The next step is triggering the trap. I'm guessing you already have a door figured out, but if not there's a good example to copy from in DM-Overlord. If you're making the button and door part of the same Blueprint, you can even use the button timeline for moving the door too and save a bit of work. Any extras like lights and additional sounds can be added to that portion of the script as well.

                Unfortunately it looks like you can't add a pain volume to a Blueprint, but it's pretty easy to create some script that does the same thing using a generic box volume. Here's what I did:



                This should only happen on the server, since damage events automatically affect clients. The "Damage Volume" component is just a box component I added to the Blueprint, with its collision presets set to ignore everything except pawns, just like the small box on the button. This bit of script basically gets a list of all pawns overlapping the box every 0.5 seconds and then applies 20 damage to them, giving credit to the player who activated the trap.

                Since this is where damage portion of the trap is being turned on, the "Set Timer" function can be connected to the top wire going off the right side of the screenshot of the button script above. In this case the timer is set to loop, which means it will repeatedly call the "VolumeDamage" event until the "Clear Timer" function at the bottom is called, when you want to deactivate the trap.

                That should be everything. The version of this in the example map includes more cosmetic effects like lights, sounds and particles when the trap is active, as well as some screen effects for the person taking damage, but this is already pretty long so I'll leave those out for now. Let me know if you have any questions or if I've missed anything important.
                Win 10
                iMac (27-inch, Late 2013)
                3.5 GHz Intel Core i7
                32 GB 1600 MHz DDR3
                NVIDIA GeForce GTX 780M 4096 MB

                Maps:
                DM-RadioActive (Work In progress) DM-Ethos (WIP) DM-QWERTY (WIP) DM-TwinFalls(WIP)
                2k4 DM-MoonGames, DM-Abrenabba, DM-Aphelion, DM-Pyrimid-Of-Gold, DM-UPH-Hexed, Dm-Saint, DM-LethalAdixion, DM-C4-Ariza, Dm-C4-SleepyTomb,

                Comment


                  #23
                  Be sure to uncheck "Can Ever Affect Navigation" in the door's advanced collision settings.

                  It will allow pathing through the doorway. (Coret)



                  ~Rich
                  Portfolio / DM-Morpheus / CTF-Coret

                  Comment


                    #24
                    Good call, thanks

                    Originally posted by ~SPECTRE~ View Post
                    Be sure to uncheck "Can Ever Affect Navigation" in the door's advanced collision settings.

                    It will allow pathing through the doorway. (Coret)



                    ~Rich
                    Win 10
                    iMac (27-inch, Late 2013)
                    3.5 GHz Intel Core i7
                    32 GB 1600 MHz DDR3
                    NVIDIA GeForce GTX 780M 4096 MB

                    Maps:
                    DM-RadioActive (Work In progress) DM-Ethos (WIP) DM-QWERTY (WIP) DM-TwinFalls(WIP)
                    2k4 DM-MoonGames, DM-Abrenabba, DM-Aphelion, DM-Pyrimid-Of-Gold, DM-UPH-Hexed, Dm-Saint, DM-LethalAdixion, DM-C4-Ariza, Dm-C4-SleepyTomb,

                    Comment


                      #25
                      One crucial step I forgot - if you're making a Blueprint from scratch, make sure you go into its "Class defaults" properties and, under networking, enable the "Replicates" checkbox. Without that none of the networking stuff in the script above will work right

                      To test all this, you can click the dropdown arrow next to the play in editor button and enable "Run dedicated server", which simulates you playing as a client. Alternatively, you can use the same dropdown to increase the number of players to 2 so you'll spawn two players in separate windows, then trigger the trap while both players are looking at it to make sure everything syncs up correctly.
                      Last edited by EGTomB; 05-17-2015, 10:00 AM.

                      Comment


                        #26
                        Hey Thomas, did you managed to get the trap map ready for the last build?


                        Originally posted by [Epic]Thomas Browett View Post
                        One crucial step I forgot - if you're making a Blueprint from scratch, make sure you go into its "Class defaults" properties and, under networking, enable the "Replicates" checkbox. Without that none of the networking stuff in the script above will work right

                        To test all this, you can click the dropdown arrow next to the play in editor button and enable "Run dedicated server", which simulates you playing as a client. Alternatively, you can use the same dropdown to increase the number of players to 2 so you'll spawn two players in separate windows, then trigger the trap while both players are looking at it to make sure everything syncs up correctly.
                        Win 10
                        iMac (27-inch, Late 2013)
                        3.5 GHz Intel Core i7
                        32 GB 1600 MHz DDR3
                        NVIDIA GeForce GTX 780M 4096 MB

                        Maps:
                        DM-RadioActive (Work In progress) DM-Ethos (WIP) DM-QWERTY (WIP) DM-TwinFalls(WIP)
                        2k4 DM-MoonGames, DM-Abrenabba, DM-Aphelion, DM-Pyrimid-Of-Gold, DM-UPH-Hexed, Dm-Saint, DM-LethalAdixion, DM-C4-Ariza, Dm-C4-SleepyTomb,

                        Comment


                          #27
                          Yep, it's there in the Example Map, which should be the default level that opens when you launch the editor. The button and trap room are separate Blueprints, so to connect them up you need to place both in your level, then select the button, look at the details panel and add the trap room to the list of things it will activate (click the + icon to add to the array, then use the eyedropper tool to select the trap room in your level).

                          I added a lot of settings to the details panel that you can customize, like colors, trap duration, trap damage, etc, but if you want to customize further by swapping out the meshes or effects I suggest just making your own copies of the Blueprints. I've added comments to everything in there so it should be fairly easy to work out how to make changes.

                          Comment


                            #28
                            Originally posted by [Epic]Thomas Browett View Post
                            I added a lot of settings to the details panel that you can customize, like colors, trap duration, trap damage, etc, but if you want to customize further by swapping out the meshes or effects I suggest just making your own copies of the Blueprints. I've added comments to everything in there so it should be fairly easy to work out how to make changes.
                            I'd actually suggest making Blueprints based on the existing ones (children) instead. That way any updates/fixes we make to functionality will propagate to the custom version. If there is anything that currently can't be customized that should be (within reason) we'll add that functionality to the base BPs.

                            Comment


                              #29
                              That's awesome! Thanks man!

                              Originally posted by [Epic]Thomas Browett View Post
                              Yep, it's there in the Example Map, which should be the default level that opens when you launch the editor. The button and trap room are separate Blueprints, so to connect them up you need to place both in your level, then select the button, look at the details panel and add the trap room to the list of things it will activate (click the + icon to add to the array, then use the eyedropper tool to select the trap room in your level).

                              I added a lot of settings to the details panel that you can customize, like colors, trap duration, trap damage, etc, but if you want to customize further by swapping out the meshes or effects I suggest just making your own copies of the Blueprints. I've added comments to everything in there so it should be fairly easy to work out how to make changes.
                              Win 10
                              iMac (27-inch, Late 2013)
                              3.5 GHz Intel Core i7
                              32 GB 1600 MHz DDR3
                              NVIDIA GeForce GTX 780M 4096 MB

                              Maps:
                              DM-RadioActive (Work In progress) DM-Ethos (WIP) DM-QWERTY (WIP) DM-TwinFalls(WIP)
                              2k4 DM-MoonGames, DM-Abrenabba, DM-Aphelion, DM-Pyrimid-Of-Gold, DM-UPH-Hexed, Dm-Saint, DM-LethalAdixion, DM-C4-Ariza, Dm-C4-SleepyTomb,

                              Comment


                                #30
                                Question. How do I add to the damage volume if I make a copy of your trap? My damage volume is bigger and a T shape + I have 2 doors that slide upwards.
                                Win 10
                                iMac (27-inch, Late 2013)
                                3.5 GHz Intel Core i7
                                32 GB 1600 MHz DDR3
                                NVIDIA GeForce GTX 780M 4096 MB

                                Maps:
                                DM-RadioActive (Work In progress) DM-Ethos (WIP) DM-QWERTY (WIP) DM-TwinFalls(WIP)
                                2k4 DM-MoonGames, DM-Abrenabba, DM-Aphelion, DM-Pyrimid-Of-Gold, DM-UPH-Hexed, Dm-Saint, DM-LethalAdixion, DM-C4-Ariza, Dm-C4-SleepyTomb,

                                Comment

                                Working...
                                X