Announcement

Collapse
No announcement yet.

Announcing Section #1 for Survival Game - Third-person Player Setup

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

    Originally posted by Wilq83 View Post
    Hi Tom
    Big thanks for such a big thread...
    I am still a newbie in UNREAL stuff...
    I was wondering...
    Could you describe a little more mechanics of UE4 ... I mean mostly whats is going on under C++ code... For example under your Scharacter.cpp at the beginning you have typed

    ASCharacter::ASCharacter(const class FObjectInitializer& ObjectInitializer)
    : Super(ObjectInitializer.SetDefaultSubobjectClass<USCharacterMovementComponent>(ACharacter::CharacterMovementComponentName))

    I have some notion about object programming , pointers , classes... BUt this still confuses me a lot...
    Could explain a little bit what for is it?
    Hi Wilq!

    That is a particularly odd one I agree! What I essentially do is make a change to the parent class (ACharacter) and tell it to use our own custom USCharacterMovementComponent instead of the default class that would otherwise be instantiated inside the constructor of ACharacter. It's something you don't commonly use (but can be quite helpful to know about when using lots of custom classes)

    I hope that answers your question!

    - Tom
    Game Developer @ LODZERO - My Twitter | tomlooman.com UE4 samples & tutorials | C++ Survival Game (Open-Source)

    Comment


      Originally posted by Tom Looman View Post
      The TimeRemaining node is built-in, I didn't do anything custom in C++. It will only be available if the state A (eg. Idle or Crouching state) has an animation to play so we can access this animation info when we want to check TimeRemaining on it.

      Any of the arrows you drag between states has the animation info from the state node it originates from (eg. where the arrow starts) so long as that state is playing an animation sequence, you should be able to get nodes specific to that animation, like the TimeRemaining node.

      Hope that made any sense.

      More info on State Machines and the Transition Rules: https://docs.unrealengine.com/latest...nes/index.html
      how to do this ? i still can't find it.

      Comment


        Originally posted by liXiang View Post
        how to do this ? i still can't find it.
        Are you sure you are in the right context? eg. in a state transition (where you need to return bool to tell the state machine yes/no to switch to a new state)

        Here is an example:

        State A
        -- State Transition (Arrow that points to B)
        State B

        State A must has the animation you want to check time remaining on.
        The node Time Remaining (with the animation included in the node name) will only be available in the state transition.

        Hope that helps clarify how things work with state machines!

        - Tom
        Game Developer @ LODZERO - My Twitter | tomlooman.com UE4 samples & tutorials | C++ Survival Game (Open-Source)

        Comment


          Hey, I'm really thankful for this tutorial, everything works so far, but I still got some questions.
          1st, compared to your code, Unreal's Default Player uses "check(InputComponent);" before binding the keys. Any thoughts about this, why are you not using it? <3
          2nd, why are you using "virtual" for the function "MoveForward". * I guess you are using subclasses that derive from SCharacter later and want to implement the MoveForward function for each of the subclasses? <3
          Last edited by Ninjin; 04-12-2016, 12:33 PM.
          https://twitter.com/Ninjin42

          Comment


            Originally posted by Ninjin View Post
            Hey, I'm really thankful for this tutorial, everything works so far, but I still got some questions.
            1st, compared to your code, Unreal's Default Player uses "check(InputComponent);" before binding the keys. Any thoughts about this, why are you not using it? <3
            2nd, why are you using "virtual" for the function "MoveForward". * I guess you are using subclasses that derive from SCharacter later and want to implement the MoveForward function for each of the subclasses? <3
            Hi Ninjin

            1st: It's just an extra safety check whether InputComponent is null or not, nothing major - we are calling the base function using Super::SetupPlayerInputComponent(InputComponent); so the check(...) will happen already.
            2st: Had a quick look, and doesn't look like this required to be virtual afterall!
            Game Developer @ LODZERO - My Twitter | tomlooman.com UE4 samples & tutorials | C++ Survival Game (Open-Source)

            Comment


              Hey, how can I see the way you connected your variables to the blueprints?

              Comment


                Originally posted by apfelnymous View Post
                Hey, how can I see the way you connected your variables to the blueprints?
                If you're looking to see how I exposed the variables in C++ so that Blueprint can make changes, have a look in the .h header files of the project. using UPROPERTY(...) gives several options for exposing these variables (eg. UPROPERTY(BlueprintReadWrite, Category = "General") )
                Game Developer @ LODZERO - My Twitter | tomlooman.com UE4 samples & tutorials | C++ Survival Game (Open-Source)

                Comment


                  Originally posted by Tom Looman View Post
                  If you're looking to see how I exposed the variables in C++ so that Blueprint can make changes, have a look in the .h header files of the project. using UPROPERTY(...) gives several options for exposing these variables (eg. UPROPERTY(BlueprintReadWrite, Category = "General") )
                  No, what I ment was, how you used these variables in your blueprints, you exposed them so you must have actually used them somehow?? I guess there must be some blueprint files to be found in your project?

                  Comment


                    Originally posted by apfelnymous View Post
                    No, what I ment was, how you used these variables in your blueprints, you exposed them so you must have actually used them somehow?? I guess there must be some blueprint files to be found in your project?
                    When exposed I only used them to tweak the variables, if at all. It's a 99% C++ project, so I barely did any implementation of blueprint graphs in the entire project.

                    So you will find a bunch of Blueprints in the project, like the ClassicBomb which doesn't have much blueprint logic (besides playing a sound on collision impact) but the Blueprint is necessary to assign content (mesh, FX, sounds)

                    Hope that helps,

                    Tom
                    Game Developer @ LODZERO - My Twitter | tomlooman.com UE4 samples & tutorials | C++ Survival Game (Open-Source)

                    Comment


                      Yes that is just what I wanted to know, thx. Finally a proper resource to learn unreal c++.

                      Comment


                        Hi Tom,

                        Thanks for the great learning resource. I just started this project and try to build it section by section referring to this project. But section branches I get from GitHub can't be opened. "project-name".dll needs to be rebuild and it always fail. If you have any idea how to fix it, that would be great. Thank you very much!

                        Comment


                          Originally posted by MaxISoP View Post
                          Hi Tom,

                          Thanks for the great learning resource. I just started this project and try to build it section by section referring to this project. But section branches I get from GitHub can't be opened. "project-name".dll needs to be rebuild and it always fail. If you have any idea how to fix it, that would be great. Thank you very much!
                          The section branches of Github are fairly old by now. The early ones were build against 4.7 and 4.8. I recommend using the latest Master which works with 4.12. Otherwise you'll need to open the project using Visual Studio and fix the compile errors (since the API of UE4 has changed from 4.7 to 4.12)
                          Game Developer @ LODZERO - My Twitter | tomlooman.com UE4 samples & tutorials | C++ Survival Game (Open-Source)

                          Comment


                            Im getting infinite jumping :/

                            Hey! Great work! But there is soemthing that is getting on my nerves and dont know how to fix it..its infinite jumping, if i spam backspace it jumps inifnite how much i want , how could i put a delay? noob question haha kinda new to UE4

                            Comment


                              Originally posted by Luc4m4rio View Post
                              Hey! Great work! But there is soemthing that is getting on my nerves and dont know how to fix it..its infinite jumping, if i spam backspace it jumps inifnite how much i want , how could i put a delay? noob question haha kinda new to UE4
                              Heard more people about this. Must be a bug introduced after upgrading to newer editions. I will look into this and update GitHub, thanks for pointing it out!

                              - Tom

                              Edit: Updated Github with the fix for infinite jumping.
                              Last edited by Tom Looman; 11-27-2016, 08:35 PM.
                              Game Developer @ LODZERO - My Twitter | tomlooman.com UE4 samples & tutorials | C++ Survival Game (Open-Source)

                              Comment


                                Hi Tom,

                                Thanks a lot for teaching me so much! THe Only thing I want to ask is how to create "STypes.h".(did it derive from something special?)
                                I am a newb.....

                                Comment

                                Working...
                                X