Announcement

Collapse
No announcement yet.

Training Stream - Tanks vs. Zombies, p.3 - May 17th

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

    #16
    Which header file would we add this change? Would it be the Turret.h one or some other header file? This is regarding the reply you made to Freedom911.
    Last edited by InferniousRuler; 06-28-2016, 01:30 AM. Reason: Clarification

    Comment


      #17
      I have strange error after editing top of Tank.h it is sometimes fixable by:

      https://answers.unrealengine.com/que...***-error.html

      but sometimes this solution do not workand I have to try random combination of it to work. Can anyone help?

      Comment


        #18
        Worst tutorial ever

        Comment


          #19
          Thanks for the tutorial, I know I am really late to the party but I'm hoping someone can still remember and help me get through my bottleneck. I am struggling to spawn a shell. In particular I can't figure out where the shell sprite was added.

          On the video at 1:14 there doesn't seem to be any shell sprite in the blueprint but I have downloaded the C++ code and it is not in the Missile class either? I tried to add one in the construction script of RegularMissileBP and a few other things but none have worked.

          Also at 1:14 there is a paper flipbook. I can make the flipbook but if I right click on the Blueprint then the only flipbook node available is AddPaperFlibookComponent. There is no SetFlipbook etc.

          Thanks!
           

          Comment


            #20
            I've been following this series on Youtube (using 4.18.2) and have encountered a scenario I can't quite figure out yet.

            It seems my Projectile check is always returning negative and hence my UE_LOG for the fire event isn't firing.

            My turret.h contains the following:
            Code:
            protected:
            
            // Maximum turn rate in degrees/second for the turret.
            UPROPERTY(EditAnywhere, BlueprintReadOnly, Category = "Turret")
            float YawSpeed;
            
            // Tank that owns this turret.
            UPROPERTY(VisibleAnywhere, BlueprintReadOnly, Category = "Turret")
            ATank* Tank;
            
            // Projectile to spawn when firing.
            UPROPERTY(EditAnywhere, BlueprintReadOnly, Category = "Turret")
            TSubclassOf<AActor> Projectile;
            And turret.cpp has the following code for the the fire action:
            Code:
            const FTankInput& CurrentInput = Tank->GetCurrentInput();
            
                    if (CurrentInput.bFire1)
            
                    {
            
                        UE_LOG(LogTemp, Warning, TEXT("FIRE! 1"));
            
                    }
            
            if (CurrentInput.bFire1 && Projectile)
            
            { 
            
            UE_LOG(LogTemp, Warning, TEXT("FIRE! 2"));
            
            if (UWorld* World = GetWorld())
            
            {
            
            UE_LOG(LogTemp, Warning, TEXT("FIRE! 3"));
            
            if (AActor* NewProjectile = World->SpawnActor(Projectile))
            
            {
            
            FVector Loc = TurretSprite->GetSocketLocation("Muzzle");
            
            FRotator Rot = TurretDirection->GetComponentRotation();
            
            
            NewProjectile->SetActorLocation(Loc);
            
            NewProjectile->SetActorRotation(Rot);
            
            }
            
            
            }
            
            }
            However FIRE! 1 is working fine, and shows in my logs. But Fire! 2 is not, implying the check on Projectile is failing, and I can't figure why that would be the case here. Any ideas?

            Comment


              #21
              Solved, needed to go into RegularTurretBP and select the Missile from the dropdown under Projectiles. I swear that wasn't mentioned in the video.

              Comment

              Working...
              X