Help: Variables are not properly marked

I first noticed it when we were first initialized the Lives variable to 4 in SetupGame(). I double checked and although my code seemed to be in working order, the variable wasn’t properly marked.

And again when using HiddenWord.Len(). As i typed Hidden word and added the “.”; the variable remained white and there was no list of options as demonstrated in the video. I manually typed out the rest of the line and it worked despite not being properly marked so been able to progress with no real issue.

Now in the Formatting FStrings lesson and we’ve been told to press Ctrl and click the asterisk and it will take us to the UnrealString.h.

I have been unable to do this and I’m thinking it might be connected. Can anyone help?

I also installed the UE 4 intellisense fixes 2.4.0 as instructed in an earlier lesson and attempted looking at the quick fix, however the red squiggles are still present, not sure if that’s related.

Capture4

Capture

My game seems to compile and play as expected but I thought since I can’t get to the UnrealString.h file now, I might miss something else later.

Have you installed and enabled the IntelliSense fixes extension?

Yes, I believe so

Could you show its output by selecting it from the drop down menu of the output window?

Sure, slight overlap where I tried to make sure it was clear where the second screenshot was continuing from.

Also as of loading up my project to take those shots as requested, I noticed that there are “Problems” that weren’t present before. I thought I should include that, just in case.

I checked and my game still compiles and runs as expected.

Could you show what you have in the .c_cpp_properties.json that’s within your .vscode folder?

c_cpp_properties.json

That looks ok. The problem might be due to the path length.

Could you try move the contents of “BullCowGame-starter-kit” up one directory as well as a shorter name for the folder for the course projects? e.g.
the contents being in

D:\Unreal Udemy\BullCowGame\

I changed the folder name as advised however I didn’t move it up one directory. I don’t think it’s particularly deep, however this was the best way I could think to organize the materials from the course.

I’ve also started getting an error regarding the new path, once again I check unreal and it seems to work with no issue.

I will try updating the path inside c_cpp_properties.json to see if it resolves this

Updating c_cpp_properties.json seems to have cleared some of the issues. However there are a few that remain.

Update:

I opened BullCowCartridge.cpp to see a similar error.

I’m not sure if this is an issue that will cause more serious problems if I continue to work on my code so I’ve paused working on the course for the time being. Please could you advise with regards to this, as I would like to continue making changes but I don’t want to complicate things.

The red underlining is purely cosmetic It should have no effect on your project. If you can compile then there’s nothing actually wrong.

Have you tried reinstalling the IntelliSense Fixes extension, I suggest redownloading it as well just in case there’s a newer version.

The VSIX I had downloaded was fairly new as I have only recently started the course, however I have redownloaded and installed version 2.4.0 again. It doesn’t seem to of fixed the red underlines but if I can continue with no worries, I will.

Do you think this extension could be the fix I’m looking for?

Edit:
I’m seeing various things telling me there’s an issue with the path now that I’ve changed the file name. Is there a way to reset/change the path it’s looking for?

You should run File > Refresh VS Code project from within Unreal. Sorry, I forgot to mention that part.

I’m not sure if the extension will run automatically afterwards so I suggest closing VS Code before doing that.

Thanks, I refreshed VS Code from Unreal and it seems to of gotten rid of the red underlines. I did however get a compiler issue which had me add a semi-colon to something that didn’t need it previously in order to successfully compile.

Not sure if this is an error or due to something I’m yet to understand.

Refreshing VS Code fixed my issue with red underlines and also with the variables being properly noted.

Also previous post about the semi-colon has been resolved. There was a semi-colon missing at the end of my HiddenWordList.h. As it was included above, it was telling me that the issue was at the start of BullCowCartridge.cpp

Code works as intended as far as Lesson TArray Functions .Num().

1 Like

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

Privacy & Terms