Advertisement

I Know Nothing and I want to change that

Started by May 23, 2018 07:33 PM
43 comments, last by TheGreech 6 years, 6 months ago
4 minutes ago, Halpmelurngewd said:

So basically if I were to use this in code it would look like this

Yes. To explain.


Int A = 6; //Here you made a intiger it is called A and it has a value of 6
Int B=7; // Here you made a intiger it is called B and it has a value of 7

Cout (sum A+B)// Here you are telling the computer to write A+B = 13

//Instead of Cout lets use the Unity print() function instead
  
print(A+B) //This returns 13

 

Edit, corrected variable names.

1 minute ago, Scouting Ninja said:

Yes. To explain.



Int A = 6; //Here you made a intiger it is called A and it has a value of 6
Int B=7; // Here you made a intiger it is called B and it has a value of 7

Cout (sum a+b)// Here you are telling the computer to write A+B = 13

//Instead of Cout lets use the Unity print() function instead
  
print(a+b) //This returns 13

 

So now for my confusion ? if the gaming engine itself does all the programming for you ( unreal engine does most if I am not mistaken) then what are programmers used for. Most of the programming I have seen relates to the above. Basically being used as a calculator.

Advertisement
1 minute ago, Halpmelurngewd said:

then what are programmers used for

The game engine only does the things that you always need. Like it draws pictures and makes 3D models display correctly, plays sound and even adds physics.

In other words it does all the things that most games will have. The reason you need programmers is for all the stuff that makes your game unique to you.

OK, so now that you know how to make variables and use them. We could make a health system, like a HP bar.

 

1 minute ago, Scouting Ninja said:

The game engine only does the things that you always need. Like it draws pictures and makes 3D models display correctly, plays sound and even adds physics.

In other words it does all the things that most games will have. The reason you need programmers is for all the stuff that makes your game unique to you.

Okay. Is there some books you can recommend or website that will break it down for someone who is considered the equivalent to a 70 year old trying to use a touchscreen phone for the first time?

2 minutes ago, Halpmelurngewd said:

70 year old trying to use a touchscreen phone for the first time?

The Video @Rutin linked takes time to break down how programming works. It's a slow start but it is well made.

 

But honestly I think you should try programming, it looks like you already grasp the basics so learning from experience should work.

If you don't have Unity yet grab that and try some code; make simple stuff to start like health systems etc.

2 minutes ago, Scouting Ninja said:

The Video @Rutin linked takes time to break down how programming works. It's a slow start but it is well made.

 

But honestly I think you should try programming, it looks like you already grasp the basics so learning from experience should work.

If you don't have Unity yet grab that and try some code; make simple stuff to start like health systems etc.

Haha you say I grasp the basics that was memorization from previous learning materials. I am however dedicated to learning this so I will give headfirst into the videos and see if it makes any sense to me. I will also work on little bits of coding and post them on here for critiquing and criticism. Onward with my head held high maybe I can learn something new

Advertisement
8 minutes ago, Halpmelurngewd said:

I grasp the basics that was memorization from previous learning materials.

Programming is just that, or at least for me it is. Just remember the rules, then use to rules to reach your goal. Programming is the same as playing games in many ways.A example would be the health system, consider it a cheat sheet :) :

Spoiler

 



//Make a class to hold the system
Public Class Health{
  //Define the variables
  Public int maxHealth = 100;
  Public int currentHealth = 100;
  
  //Make the rules
  bool checkIfPlayerDied()
  {
    //If the player has less than 0 health he is dead
    if (currentHealth < 0)
    {
      //Yup, he dead.
      return true;
    }
    //Since the code made it here he isn't dead.
    return false;
  }
}

Feel free to ask how this works.

 

11 minutes ago, Scouting Ninja said:

Programming is just that, or at least for me it is. Just remember the rules, then use to rules to reach your goal. Programming is the same as playing games in many ways.A example would be the health system, consider it a cheat sheet :) :

  Hide contents

 




//Make a class to hold the system
Public Class Health{
  //Define the variables
  Public int maxHealth = 100;
  Public int currentHealth = 100;
  
  //Make the rules
  bool checkIfPlayerDied()
  {
    //If the player has less than 0 health he is dead
    if (currentHealth < 0)
    {
      //Yup, he dead.
      return true;
    }
    //Since the code made it here he isn't dead.
    return false;
  }
}

Feel free to ask how this works.

 

I think I grasp how it works. Correct me if I am wrong. This script runs constantly. Always checking the players health basically the script runs off what I call the "if" system. It checks the health value repeatedly to make sure the health doesn't reach 0 if it does the code quits running and refers to a different line of code that would state in code if health is less than or equal to 0 make the game flash game over or something along those lines. Correct?

19 minutes ago, Scouting Ninja said:

Programming is just that, or at least for me it is. Just remember the rules, then use to rules to reach your goal. Programming is the same as playing games in many ways.A example would be the health system, consider it a cheat sheet :) :

  Reveal hidden contents

 




//Make a class to hold the system
Public Class Health{
  //Define the variables
  Public int maxHealth = 100;
  Public int currentHealth = 100;
  
  //Make the rules
  bool checkIfPlayerDied()
  {
    //If the player has less than 0 health he is dead
    if (currentHealth < 0)
    {
      //Yup, he dead.
      return true;
    }
    //Since the code made it here he isn't dead.
    return false;
  }
}

Feel free to ask how this works.

 

Also the double // allow you to put a description in for future reference without the code actually acting on it. So it's pretty much ignored correct?

15 minutes ago, Halpmelurngewd said:

This script runs constantly. Always checking the players health basically the script runs off what I call the "if" system.

That would be very slow, if all your code kept running at the same time it would take too long.

The way that code works it returns a bool when called, it is known as a function, a small program if you want:


//This is how it is used
Health.checkIfPlayerDied();

Health.currentHealth -= 100;

//It is only called when we ask for it
if(Health.checkIfPlayerDied() == true){
  print("Sorry, you died");
}

 

9 minutes ago, Halpmelurngewd said:

Also the double // allow you to put a description in for future reference without the code actually acting on it

It is for commenting. It tells the computer to ignore this line because it is for humans to read.

This topic is closed to new replies.

Advertisement