All GameDev.tv Unreal Courses

Type ‘hello’ in the terminal

Hello, I’m taking the Unreal c++ course right now, I think I’m doing fine but. Every time I compile my code I get this.

cl : Command line warning D9024 : unrecognized source file type ‘triplex’, object file assumed

Am I doing something wrong??
I’ve also noticed that std is red instead of white, did I mess something up? I’m just following what Gavin is doing.

I just realized i forgot a ; at the end of int a = 4, thought after compiling and trying to run triplex 4 isn’t in a separate line, and i still get this cl warning message. I am very confused…

NVM, I fixed it by doing “cl triplex.cpp” instead of just “cl triplex”

New learner here! I’m currently in the TripleX unit and wanted to share my ASCII implementation.

1 Like

Hello there. My name is Pieter. I am an engineer/software developer. Just started with the “Unreal Engine C++ Developer: Learn C++ and Make Video Games” course on Udemy. This is my first go at using unreal. I have been developing software in C++ for the last 4 years, mainly focusing on engineering and research applications. I am interested in the potential of using unreal as a tool for scientific visualization, and also look forward to having some fun along the way.

2 Likes

can anyone help, i can run it but i get I get this message when i compile it

Hey all!

Just beginning my journey in code! The course suggested I post my work thus far (as fantastic as it is) so you guys could see it, so here goes!

#include

int main()

{

// Display intro to the game

std::cout << "Your cat has been kidnapped by the group of booger eaters that stand about and fart on the corner!" << std::endl;

std::cout << "The cat's yowling leads you to their lair. They have your cat locked in a vault behind a series of metal gates! " << std::endl;

std::cout << "You see that the gates and the vault are protected by a devious keypad entry system! " << std::endl;

std::cout << "You must enter the correct codes at each barrier to get in and save your cat!" << std::endl;

std::cout << std::endl;

std::cout << "Rushing to the first keypad you see there are 3 numbers in the code." << std::endl;

std::cout << "Your protective instinct kicks in as you examine the keypad." << std::endl;

std::cout << std::endl;

// Declare 3 number code

const int CodeA = 2;

const int CodeB = 4;

const int CodeC = 6;

int CodeSum = CodeA + CodeB + CodeC;

int CodeProduct = CodeA * CodeB * CodeC;



// Display hints

std::cout << "     + Your gut tells you the 3 digit code adds up to: " << CodeSum << std::endl;

std::cout << "     + And multiplied together equals: " << CodeProduct <<std::endl;

// Store Player inputs

int GuessA, GuessB, GuessC;

std::cout << std::endl;

std::cout << "1st Keypad entry:";

std::cin >> GuessA;

std::cout << "2nd Keypad entry:";

std::cin >> GuessB;

std::cout << "3rd Keypad entry:";

std::cin >> GuessC;

// Declare sum and product of player guesses

int GuessSum = GuessA + GuessB + GuessC;

int GuessProduct = GuessA * GuessB * GuessC;

// Display the players input

std::cout << std::endl;

std::cout << "You quickly punch in: ";

std::cout << GuessA;

std::cout << " ";

std::cout << GuessB;

std::cout << " ";

std::cout << GuessC;

std::cout << std::endl << std::endl;

std::cout << "You realize that the numbers you punched in add up to: " << GuessSum;

std::cout << ", and multiply together to equal: " << GuessProduct;

std::cout << std::endl;



if (GuessSum == CodeSum && GuessProduct == CodeProduct)

{

    std::cout << "With a satisfying 'click' the lock pops open!";

}

else

{

    std::cout << std::endl;

    std::cout << "The keypad beeps angrily and flashes red indicating you punched in the wrong code!";

}

return 0;     

}

I also wrote this on discord
hey guys I could use some help. I’m following the unreal 4 + C++ tutorial. I’m in section 1 part 8 “also install visual studio code”. For the life of me, I can’t figure out how to keep the cmd terminal as the default terminal instead of powershell.

I open the 2019 dev command prompt. type “code” and hit enter. POWERSHELL IS THE TERMINAL. I have pressed ctrl + shift + P to get to “terminal: select default profile” and changed it to cmd. But every time I run visual studio code (through the dev command prompt and the visual studio code application) it ALWAYS becomes powershell. Plz help. I installed visual studio code awhile ago (not following the video) so idk if I need to reinstall and add anything. Thank you

It is strange, but I also have this happening.

You can totally work around it though by pressing the drop down in the top right of the terminal next to where it shows powershell and selecting cmd (just in case you are stuck). It will open the cmd line terminal where you can work with the code. Hope this helps!

image

@OAwanted seems normal? Does the program run?

So I can type “code” in the dev command prompt, switch powershell to cmd, and it will still properly compile/work correctly with the following lessons?

2 Likes

remeber to run comand prompt from VisualStudio


and write code and hit enter, then should work normaly

Yep it should. At least that’s how I’ve been doing it.

Moving right along in the TripleX module. Here’s my progress so far for those of you perusing the forums:
#include

void TitleIntro()

{

          // Display intro to the game

        std::cout << "==================================================\n";

        std::cout << "|   |  ^\\         |         |           |       |\n";

        std::cout << "|   |  |  \\       |         |__,,,--,,__|       |\n";

        std::cout << "|   |  /   -',    | __ : '''|        \\  |_;;,   |\n";

        std::cout << "|   | /   ,    \\/ |         |     -__   |   ' __|'\n";

        std::cout << "|   ||  , 4-,     |    ) __ |       .;.(|       |\n";

        std::cout << "|  ;|__ __ __ ' ' |(__/ .__)|-- '  (__\\_|_)     |\n";

        std::cout << "==================================================\n\n";

        std::cout << "Your cat has been kidnapped by the group of booger eaters that stand about and fart on the corner!\n";

        std::cout << "The cat's yowling leads you to their lair. They have your cat locked in a cage behind a series of metal gates! \n";

        std::cout << "You see that the cage and the gates are protected by a devious keypad entry system! \n";

        std::cout << "You must enter the correct codes at each barrier to get in and save your cat! \n\nBut first you rage kick in the first gate!\n";   

}

bool PlayGame(int Difficulty)

{        

    // Declare 3 number code

    const int CodeA = 2;

    const int CodeB = 4;

    const int CodeC = 6;

    int CodeSum = CodeA + CodeB + CodeC;

    int CodeProduct = CodeA * CodeB * CodeC;

    // Display hints

    std::cout << "\nRushing to the next keypad you see it is a level " << Difficulty;

    std::cout << " lock!\n\n";

    std::cout << "There are 3 numbers in the code.\n";

    std::cout << "\n     + Your gut tells you the 3 digit code adds up to: " << CodeSum;

    std::cout << " and multiplied together equals: " << CodeProduct;

        

    // Store Player inputs

    int GuessA, GuessB, GuessC;

    std::cout << "\n\n1st Keypad entry:";

    std::cin >> GuessA;

    std::cout << "2nd Keypad entry:";

    std::cin >> GuessB;

    std::cout << "3rd Keypad entry:";

    std::cin >> GuessC;

    // Declare sum and product of player guesses

    int GuessSum = GuessA + GuessB + GuessC;

    int GuessProduct = GuessA * GuessB * GuessC;

    // Display the players input

    std::cout << "\nYou quickly punch in: ";

    std::cout << GuessA;

    std::cout << " ";

    std::cout << GuessB;

    std::cout << " ";

    std::cout << GuessC;

    std::cout << "\n\nYou realize that the numbers you punched in add up to: " << GuessSum;

    std::cout << ", and multiply together to equal: " << GuessProduct;

        

    // Check players guess

    if (GuessSum == CodeSum && GuessProduct == CodeProduct)

        {

            std::cout << "\n\nWith a satisfying 'click' the lock pops open!\n";

            return true;

        }

        else

        {

            std::cout << "\n\nOH NO! The keypad beeps angrily and flashes red indicating you punched in the wrong code!";

            return false;

        }       

}

int main()

{

TitleIntro();

int LevelDifficulty = 2;

const int MaxLevel = 6;

while (LevelDifficulty <= MaxLevel) //Loop the game until all levels are completed

    {

        bool bLevelComplete = PlayGame(LevelDifficulty);

        std::cin.clear(); //Clears any errors

        std::cin.ignore(); //Discards the buffer

        if (bLevelComplete)

        {

            //Increase difficulty

            ++LevelDifficulty;

        }

    }

std::cout << "\nYou've done it! You reach inside the cage and claim your cat. Now run home before the Booger Eaters find out you snuck in!\n";

std::cout << "Good job! Thanks for playing!";

return 0;     

}

Hi All! Just doing my first challenge here, “Try to explain what I think the difficulty function does”…

I think it allows the player to set the difficult somewhere between 2 and 10 and then if the player clears the challenge at that difficulty it prints the message “WOW - You’re a master hacker!\n”

1 Like

Hi All,

Attempting to explain what is going on in this screenshot:

1 Instructs the program to include the iostream library
3 initializes the main function

5 defines a string to be printed
6 defines the end of a line of strings
7 defines another string to be printed

10 declares and initializes a constant variable
11 declares and initializes a constant variable
12 declares and initializes a constant variable

14 declares and initializes a constant sum of the previously declared variables
15 declares and initializes a constant product of the previously declared variables

18 expresses the end of a lone of strings
19 expresses the sum and ends a line of stings
20 expresses the product and ends a line of strings

22 closes the loop of the function and ends it

1 Like

Hello… I Have a Problem in vs code…it Can’t identifier the include and functions and even auto complete Doesn’t show them . but in Unreal Engine I can Compile With no error and the game works fine .


This is awesome! This sets a cookie on your browser that sets all Udemy courses to discount. Thank You Bena and GameDev.tv!

Ciao Ben, istruttore mi sono appena iscritta al vostro corso, unreal c++ …ho gia’ creato due app con programmazione blueprint in unreal engine ed esportato il packaging per windows, ma non riesco a caricarli in oculus store e neanche microsoft store, perche’ quando apro in unreal il c++ class per visula studio lo apre ma dal menu progetto non mi esce la voce “public” come normalmente esce con un progetto uwp. Potete aiutarmi? grazie

Privacy & Terms