I am having real trouble with the task here

Attempting to do the 10-15 min activity here. I feel like I understand (enough) how to write the code for this, but am really struggling with where it all goes. (i.e. where do I write a function or implement a statement)
Does anyone know a good way to recap this? ( one of the other lessons or somewhere new)
As I am keen not to keep simply following and try to learn this. I just find it really hard.
Thanks!

Itā€™s from Lesson 60. Booleans.

Do you understand the order of execution? That BeginPlay happens when the game starts or the actor is spawned. That statements are executed line by line?

If so could you share any thoughts you had on where you might place it?

Do you understand the order of execution? -Yes ( I think)
That statements are executed line by line? - I get this too
If so could you share any thoughts you had on where you might place it? Well this is where I think Iā€™m misunderstanding. I donā€™t understand how to know.
I am so bad with terminology, but how do I know where to declare or ā€œwriteā€ the code.
Iā€™m doing such a bad job at explaining thisā€¦

So to my (bad) understanding. You have functions, that, execute our code. But they only have scope within themselves unless written in.
We write ā€˜Declaration statementsā€™ (not sure if that the correct word for it) within our cartridge. But I dont get WHY we do this in a cartridge or in the code. I know I can only reference things that have already been ā€œreadā€ by the console but when I am asked to write all this, I am unsure why and where it all goes.

If you donā€™t understand my questions im super sorry. I am doing my best to describe it. Maybe it was a section I missed or forgot. But I just feel like the explanation of where to write each section of the code is a little too confusing for me.

Not quite sure what youā€™re trying to say here.

Declaration statements are just statements that introduce a name e.g.

int Variable;
void Function();
class Class;

Itā€™s meant to be treated as a black box. The course has set this up so you donā€™t have to know all thatā€™s involved in order to input text into a game object.

You can see all of the code that goes into that by looking in your Console directory within Source.

https://github.com/UnrealCourse2019/BullCowGame/tree/master/BullCowGame-starter-kit/Source/BullCowGame/Console

You can see that thereā€™s code to handle when the enter key is pressed

And that calls OnInput on the cartridge component with what was entered

Thank you for your time and reply. This is all going over my head really. I am trying to continue taking notes all the time. But each task is leaving me further behind. Hard being stupid.

Well my point was really itā€™s that way because the course made it that way, in regards to the cartridge component. You donā€™t need to know all of what itā€™s doing.

All you need to know is that OnInput gets called when you press enter.

The following sections do not use prewritten code by GameDev.tv.

1 Like

This topic was automatically closed 24 hours after the last reply. New replies are no longer allowed.

Privacy & Terms