Section Production Progress

Well I think this is what you were initially trying to achieve, being that you work out which way you want to turn when you are looking in the opposite direction of the barrel.

if (DeltaRotator.Yaw > 180.f)
{
	Turret->Rotate(DeltaRotator.Yaw - 360.f);
}
else if (DeltaRotator.Yaw < -180.f)
{
	Turret->Rotate(DeltaRotator.Yaw + 360.f);
}
else
{
	Turret->Rotate(DeltaRotator.Yaw);
}

Iā€™m not sure itā€™s worth re-recording 3 videos again, the aiming was improved and any of the code above can be added back-in in the next few videos. Thanks for highlighting it.

EDIT: Iā€™ll also add this annotation to the aiming video, so people can go to a solution straight-away if they wish, without waiting a few videosā€¦

@DanM @ben Thanks for working though these as i have the kids home for summer so its a little hard for me to get on to any lectures. Hoping i might get one in a week until they go back to school.
It agree its useful to see how this progresses and the bumps in the road along the way as its all part of the learning process for us :slight_smile:

1 Like

Youā€™re welcome, itā€™s so much fun and @DanM is so on the ball itā€™s great.

AutoMortarā„¢ coming next, see Facebook here.

Iā€™ve not watched the mortar video yet but as Brock on Udemy said, shouldnā€™t we be using int32 or even better, uint32 instead of int.

Also, if you didnā€™t know, pressing the end key puts an object on the ground.

Hi Dan, thanks I was aware of End and have mentioned it but perhaps not explicitly enough.

Re integers, absolutely Iā€™ll correct this, thanks

I thought you did too but I always see you do it manually.

Yeah, guess Iā€™m scared that Mac users donā€™t have and End key and that Iā€™ll have to waffle over that bit. It often snaps to the floor well though when you first drag a blueprint in though.

I have been developing software for around three decades now when I finally decided to turn my sights on game programming with Unreal this last March. I feel like I decided to climb Mt Everest.

I am happy with the way this course is going with itā€™s warts and all. It feels like real programming time, not some polished, pie in the sky class. As someone who does a lot of plumbing coding with web services, I appreciate the architecture issues you bring up. I like that you are teaching the tools, not how to make a battle tank game. Itā€™s like back in college where they taught system architecture and business requirement gathering and COBOL was just one of the tools to get the business solution implemented.

The knowledge with integrating C++ classes and the blueprints along with being shown flashes of looking at the engine source is invaluable. In this business, when you know how to find the answers is when you know you are making critical progress in learning.

Thanks. This course is worth far more than what I paid for. It is literally the best money I have spent.

Keep up the good work.

Adam

1 Like

Thank you. Tomorrow weā€™ll be diving deep into particles systems.

Juicy content about the Reference Viewer, source control and particle systems inbound

Got sidetracked with Stardew Valley again, so regarding L180, instead of adding starter content, moving what you want then deleting the rest. Maybe have an empty project with the starter content and using the migrate asset feature?

Edit: nvm lol.

1 Like

So for the impact particle, wouldnā€™t you want to spawn the particle at the location of OnHit() using UGameplayStatics so you can then call Destroy() on the projectile after?

That is one of the options, have you seen lecture 185 yet where I lay-out 3 options?

Currently on 184 watching you demonstrate why people say you shouldnā€™t copy and paste code.

Edit: You missed a ā€˜cā€™ in the word ā€œschemeā€ and I guess Iā€™ll end up attempting the spawning option.

Not really getting the point of this, why would you need to convert to ints or clamp it for? Seems rather pointless

{
    int32 DamagePoints = FPlatformMath::RoundToInt(DamageAmount);
    int32 DamageToApply = FMath::Clamp(DamagePoints, 0, CurrentHealth);
    CurrentHealth -= DamageToApply;
    if (CurrentHealth <= 0)
    {
	UE_LOG(LogTemp, Warning, TEXT("Tank died"))
    }
    return DamageToApply;
}

As opposed to just

CurrentHealth -= DamageToApply;
if(CurrentHealth <= 0.f)
{
    //die
}

Itā€™s not like you are comparing if they are equal to, and if you really want to make it so that 0.0001 health is also death, then why not use FMath::IsNearlyZero so you would have

CurrentHealth -= DamageToApply;
if(CurrentHealth <= 0.f || FMath::IsNearlyZero(CurrentHealth, 0.0001f))
{
    //die
}

That does look simpler @DanM, Iā€™m sure we started here but donā€™t recall the subtle bug it caused. @sampattuzzi can you remember?

Also regarding to my earlier comment about spawning the particle, in the lecture you said it was more compilcated though in reality itā€™s less compilcated (IMO) as you just change UParticleSystemComponent to UParticleSystem, remove the code in the constructor regarding that particle and then in OnHit() just have UGameplayStatics::SpawnEmitterAtLocation(this, ImpactParticle, Hit.Location); then you are free to call Destroy() at the end of the function.

Thanks Dan, I wanted to overview the options and stick with the track were on. Depending on demand we may well add more than 100 lectures later once lots of peopleā€™s feedback is in making tweaks and showing alternative ways like this.

Well considering a decent amount of the lectures are showcasing pitfalls and such, going over that seems reasonable. Whatā€™s left of this section by the way? I figured there might be leaderboard and/or item pick ups, though not looking like that will be the case anymoreā€¦

Privacy & Terms