Announcement

Collapse
No announcement yet.

Ongoing C++ Gameplay Example Series: Making a Survival Game

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

    Originally posted by GuilhermeB View Post
    To what extent can we use this as a base for our projects?

    And is there a way to rename the project/files from SurvivalGame to our name?
    Hi, I have renamed some code projects using FAR before, works fine.
    see:
    https://forums.unrealengine.com/show...t-step-by-step
    and:
    https://unrealxeditor.wordpress.com/...-your-project/
    Outer Planet Studios
    http://outerplanet.webflow.io/

    Comment


      Hello everyone,

      I'll probably look like the biggest newbie ever but... after spending tons of time opening and checking every things, I was unable to find where the "Main Menu" Widgets is managed... is it me who are really blind or it's hardcoded somewhere ?
      I had a memory that I found it before, but now unable to retrive where it's managed...

      Thank you in advance !
      Sincerely.

      Comment


        Originally posted by QQZeroQQ View Post
        Hello everyone,

        I'll probably look like the biggest newbie ever but... after spending tons of time opening and checking every things, I was unable to find where the "Main Menu" Widgets is managed... is it me who are really blind or it's hardcoded somewhere ?
        I had a memory that I found it before, but now unable to retrive where it's managed...

        Thank you in advance !
        Sincerely.
        If I recall correctly this is added through the Level Blueprint of the main menu map.
        Game Developer @ LODZERO - My Twitter | tomlooman.com UE4 samples & tutorials | C++ Survival Game (Open-Source)

        Comment


          After checking again, I found where the widget was... sorry for disturbing...

          Great job for your work !

          Comment


            hello, I start on EU4, let me know how it is to add to project my project. a simple video'll be fine? thx

            Comment


              how do we project to add the survival game on Unreal 4 engine?

              Comment


                Links are not working.

                Comment


                  Originally posted by Prometheus88 View Post
                  Links are not working.
                  I just checked the links in the OP and they all work fine. What's not working on your end?
                  Game Developer @ LODZERO - My Twitter | tomlooman.com UE4 samples & tutorials | C++ Survival Game (Open-Source)

                  Comment


                    Hi Tom,
                    Do you have any plan for another tutorial ?
                    ABC Augmented Reality by UE4
                    GooglePlay

                    ArchVis VR

                    Comment


                      Originally posted by Vahid View Post
                      Hi Tom,
                      Do you have any plan for another tutorial ?
                      Yes I do.

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

                      Comment


                        is this project still alive ? i checked it couple of times and it seem a great Resource since i want to learn co-op on 4.10 :ٍD
                        Game Designer @ Masked Pharaohs ..
                        I'm Providing Arabic Support For Any One ..

                        Comment


                          Originally posted by Andrew Bedier View Post
                          is this project still alive ? i checked it couple of times and it seem a great Resource since i want to learn co-op on 4.10 :ٍD
                          The latest source on GitHub is updated for 4.10, so yep it's still alive but currently no new sections planned.
                          Game Developer @ LODZERO - My Twitter | tomlooman.com UE4 samples & tutorials | C++ Survival Game (Open-Source)

                          Comment


                            thank you for share!!!

                            Comment


                              So I am trying to learn C++ and I am using your Survival game but I have hit two issues that are confusing me.

                              1) I have been able to implement semi-auto fire by adding a check in the CanFire(); function,

                              Code:
                              bool ASWeapon::CanFire() const
                              {
                              	bool bPawnCanFire = MyPawn && MyPawn->CanFire();
                              	bool bStateOK = CurrentState == EWeaponState::Idle || CurrentState == EWeaponState::Firing;
                              	bool bSFire;
                              	if (SemiAuto)
                              	{
                              		bSFire = SemiFire;
                              	}
                              	else
                              	{
                              		bSFire = false;
                              	}
                              	return bPawnCanFire && bStateOK && !bPendingReload && !bSFire;
                              }
                              and the SetWeaponState Function

                              Code:
                              void ASWeapon::SetWeaponState(EWeaponState NewState)
                              {
                              	const EWeaponState PrevState = CurrentState;
                              
                              	if (PrevState == EWeaponState::Firing && NewState == EWeaponState::Firing && !CanFire())
                              	{
                              		OnBurstFinished();
                              	}
                              	
                              	if (PrevState == EWeaponState::Firing && NewState != EWeaponState::Firing)
                              	{
                              		OnBurstFinished();
                              	}
                              
                              	CurrentState = NewState;
                              
                              	if (PrevState != EWeaponState::Firing && NewState == EWeaponState::Firing && CanFire())
                              	{
                              		OnBurstStarted();
                              	}
                              }
                              and it works if I set the the SemiFire variable true and false in the right places. The problem is the fire animation either continuously plays, or, if I add an && CanFire() to the IsFiring bool in the SCharacter.cpp, wont play at all.

                              Any thoughts on how to better implement semi-fire or allow the fire animation to only play once?

                              2) I am trying to take the reserve ammo off of the gun itself and put it into a repository. For testing purposes I created HeldAmmo and MaxHeldAmo variable on the SCharacter class but I am having a hell of a time passing that information to the SWeapon.cpp. The bolded is how I am trying to do this

                              Code:
                              ASWeapon::ASWeapon(const class FObjectInitializer& PCIP)
                              : Super(PCIP)
                              {
                              	Mesh = PCIP.CreateDefaultSubobject<USkeletalMeshComponent>(this, TEXT("WeaponMesh3P"));
                              	Mesh->MeshComponentUpdateFlag = EMeshComponentUpdateFlag::OnlyTickPoseWhenRendered;
                              	Mesh->bReceivesDecals = true;
                              	Mesh->CastShadow = true;
                              	Mesh->SetCollisionObjectType(ECC_WorldDynamic);
                              	Mesh->SetCollisionEnabled(ECollisionEnabled::NoCollision);
                              	Mesh->SetCollisionResponseToAllChannels(ECR_Ignore);
                              	Mesh->SetCollisionResponseToChannel(ECC_Visibility, ECR_Block);
                              	RootComponent = Mesh;
                              	bIsEquipped = false;
                              	CurrentState = EWeaponState::Idle;
                              	AmmoType = EAmmoType::Rifle;
                              	PrimaryActorTick.bCanEverTick = true;
                              	PrimaryActorTick.TickGroup = TG_PrePhysics;
                              
                              	SetReplicates(true);
                              	bNetUseOwnerRelevancy = true;
                              
                              	MuzzleAttachPoint = TEXT("MuzzleFlashSocket");
                              	StorageSlot = EInventorySlot::Primary;
                              	
                              	
                              	ShotsPerMinute = 700;
                              	
                              	if (MyPawn)
                              	{
                              		StartAmmo = MyPawn->HeldAmmo;
                              		MaxAmmo = MyPawn->MaxAmmo;
                              	}
                              
                              	
                              	
                              	
                              	MaxAmmoPerClip = 30;
                              	NoAnimReloadDuration = 1.5f;
                              	NoEquipAnimDuration = 0.5f;
                              	SemiAuto = false;
                              	SemiFire = false;
                              	
                              }
                              The issue is that MyPawn doesn't seem to get called and if I remove the if(MyPawn) {} it crashes the engine. Is there a better way to do this? The reason why I want to remove the ammo from the Gun is to not allow dropping and pickup up a weapon to reset your held ammo.
                              Heavy Diesel Softworks, LLC - Owner

                              Comment


                                Hi, I was looking at building something using your code as a base.
                                But I don't really need everything you've got, are the Sections updated to a newer engine?
                                (for example if I took Section 4 branch) or will I need to migrate them myself?
                                Survival Game Dev Blog

                                Comment

                                Working...
                                X