Jump to content


Check out our Community Blogs

CommittedC0der

Member Since 13 Nov 2009
Offline Last Active Apr 07 2016 04:17 PM
-----

#538305 Making Terrain In UDK Part 2 Texture.

Posted by CommittedC0der on 24 January 2010 - 11:18 AM

hi, all today I going to show you how to texture your terrain UDK. If you haven't read the tutorial on make and editing the terrain you can read it hear http://forum.codecal...errain-udk.html


OK so lets get started.:)

So since this is continuing from the last tut you should have a terrain with a light on it already.

So the first thing we have to do is open our terrain editor which I showed you how to do in the last tut and right click in the gray area and make a new terrain setup layer and name it our_sand (yes the pics says sand but name in our_sand)
Posted Image

Now a new bar will pop up under the HeightMap bar named our_sand, left click and it should turn yellow then right click it and add a New Terrain Martial and name it sand_texture.
Posted Image

Now open your content browser with ctrl + shift + F and you should see you terrain textures, right click sand_texture and click properties.
Posted Image

Now in your Content Browser go to the Cool Materials folder and scroll to the very bottom and select M_Sand_Master_VertPaint then press the little green arrow in the material section of your sand_textures properties.
Posted Image

OK so now you can exit out of the Content Browser and sand_texture and your terrain should look like this.
Posted Image

OK so there you go you have a texture on you terrain.

Now to if you repeat the process you can just select the new texture bar and paint the texture on with the paint brush tool.(ctrl + left-click paints and ctrl + right erases texture )
Posted Image

One last thing how to add some grass go to you Content Browser and find your texture(in this case sand_texture) and open up it's properties again then search foliage in the search bar at the top of the Content Browser and find one you want then add a new item in the foliage section of sand_texture properties and click the little black arrow to open it all up then press the little green arrow again to add you grass then just change the density and you have grass.
Posted Image

Well hope you enjoyed this tutorial, as always +rep and comments/questions welcome.:)
  • 1


#537788 C# Tutorial: Generating Random Numbers.

Posted by CommittedC0der on 21 January 2010 - 02:24 PM

Hello, Today I'm going to show how to generate random numbers in C#.

OK so there are a couple different ways to generate random numbers.

The first way we can do this is to add this code:
Random randnum = new Random();
            int num = randnum.Next();

So what that did was make a new random number named randnum then assigned a new variable named num equal to the random number.(we do this so we can print the number if we want.)

Now what you may have noticed is that will make a random number but you probably want your number to have a limit to do this we change the code to:
Random random = new Random();
 int num = random.Next(100);

So this will generate a positive number up to 100 including 0, which is good but in some case you won't want 0 to be picked like if you where picking a raffle winner or something to that effect.

So the last and most used way is to change the code to:
Random random = new Random();
            int num = random.Next(1, 100);
So now it generates a number between 1 and 100.

OK so now that your know how to generate a random number lets make a dice roller to demonstrate how to use it.

So first make a new project and add a label and a button to your form.
Now double click the button and add this code:
Random random = new Random();
            int num = random.Next(1, 6);
            label1.Text = Convert.ToString(num);
then try it out.

So the code label1.Text = Convert.ToString(num); takes are variable that's equal to the random number and converts it to a string and prints it out in the label.

So there you go, now you know how to generate and print random numbers.
Hope you enjoyed this tutorial, if you have any questions just ask.:)
  • 1


#537515 Creating A Simple Web Browser.

Posted by CommittedC0der on 19 January 2010 - 06:10 PM

Today I'm going to show you how to make a simple web browser with all the basic features like home back forward refresh ect...

So to get started you with our web browser make a new windows forms application and name it MyWebBrowser or whatever you want.

OK now add a new Tool Strip to the top of the form(Tool Strip can be found in the tool box in the menu and toolbars tab) OK now add a Web Browser to the center of the form and size it to the size you want.(Web Browser is at the very bottom of the common controls tab in the tool box)

OK now we need some buttons for our form so click on the Tool Strip you placed on the top of the form and there should be a little blue box that pops up left click it and a picture button will pop up do this intel you have 5 picture buttons. Now click the little arrow on the Tool Strip add thing and select text box then add one more picture button.

Now right click the text box and goto properties and change the name to URLBox and the text to URL then scroll down and find the size setting and change the width to a size according to your form.

So now your form should look like this:
Posted Image

Now right click one of your picture buttons and goto properties and find the image setting and change the image to what you want. Repeat for the rest and you'll have:
Posted Image

Now right click the web browser and goto properties and set it's name to webBrowser and it's URL to a web site like Google or something.

OK now for some actual code.:)

Double click the back button on the tool strip and add this code.
webBrowser.GoBack();
That does exactly what you would think it does.

OK double click the forward button on the tool strip and add this code.
webBrowser.GoForward();

Now double click the home button on the tool strip and add this code.
webBrowser.GoHome();


Now double click the stop button on the tool strip and add this code.
webBrowser.Stop();

Then double click the refresh button on the tool strip and add this code.
webBrowser.Refresh();

Now the last thing we need to do is make our address bars text usable for the web browser to navigate with.

So what we do is add code to our Go button.
webBrowser.Navigate(URLBox.Text);
(tip don't forget http:// when typing in the address bar)

Congratulations you just made your own web browser.:)
I hope you enjoyed this tutorial, as always +rep and comments/questions are welcome.:)
  • -1


#537163 Making Terrain In UDK.

Posted by CommittedC0der on 17 January 2010 - 04:22 PM

Making Terrain In UDK.

Today I'm going to show you how to make and edit your own terrain in UDK.

So to get started you need a new project.

Now click the tools button from the top menu then click new terrain and leave the setting as is and click next.
Posted Image

OK it might take a few seconds but a new terrain should appear.

Now for editing our terrain.

First click the edit terrain button(the one with mountains on it) and a terrain editing window should pop up, now toggle on the wireframe view and increases the tessellation two times and it should look like this.
Posted Image

Now to edit the terrain we must select the paint brush tool and select the one of the sizes, now put your cursor on the terrain in the 3D window there should be a red circle thing, now hold ctrl+leftclick to make the terrain go up and ctrl+rightclick to make it go down.
Posted Image

OK so I don't have time to go through all the tools but don't be afraid to play with them, test'em out ands see what happens.

Now toggle off the wireframe view and click the X on the terrain editor and you have your very firsts terrain.

Another thing that you'll want to now how to do is add a light like the sun, to do so right click the terrain and add a actor but instead of, Add Light (Point) choose Add Light(DominantDirectionalLight) and select the rotate tool and rotate the light and you should come up with something like this.
Posted Image

So now you now how to make a terrain in UDK

Well I hoped you enjoyed this tutorial, +rep and comments always welcome.:)
  • 1


#536499 What is the HTML tag for a code text box ?

Posted by CommittedC0der on 16 January 2010 - 07:01 AM

This is how you would make a text area
<textarea rows="10" col="30">type here</textarea>
is that what your looking for?
  • -1


#535510 Your First Project In UDK Part 2.

Posted by CommittedC0der on 09 January 2010 - 09:37 PM

OK so to continue from last time, I'm going to show how to add walls to your room with textures and also how to add objects into your game, OK lets get started.:)

The first thing we need to do is add some walls, so right click the the cube button and change the setting like so and move the wall over.
Posted Image
Press biuld then close and press the same button as last time to make it solid.


OK now do that again for the wall on other side of the room then switch the X Y settings and make walls for the front and back sides.

OK once you've got that done it should look like this.
Posted Image

OK now for some textures and some objects.

First we need to open the content browser with all of are textures so press Ctrl+Shift+F or click view>Browser window>content browser. Once you have it up click the Cool Materials folder like shown and select a texture and drag it to your wall or floor.
Posted Image

Once you have your walls and floor textured it should come out like this depending on the textures you chose.
Posted Image

Now you may test your game like I showed you in the first tut if you wish to see your new textures.

OK so now for a couple objects, lets add a little plane thing.

Once again open the content browser, now click the All Assets button and check the All Types and Vehicle tags as shown then drag it to the room.
Posted Image

OK well now you have a basic knowledge of the Unreal Engine just play around in the content browser and see what you can do.
Any problems or comment post um, play around and have fun Cya.:)

PS: If you had a hard time following this tut watchmy video tutorial on.http://forum.codecal...html#post235292
  • 1


#533790 Guess The Number VS. Computer Opponent.

Posted by CommittedC0der on 27 December 2009 - 03:51 PM

OK I’m going to show you how to make a little game where you and the computer take turns guessing at a random number between 1-100. I’ll do my best to explain everything. :)

OK the first thing we do is add this.
#include<iostream>
#include<cstdlib>
#include<ctime>
using namespace std;

OK #include<iostream> includes the file to take user input and output it on the console window.

#include<cstdlib> this includes file that deal with generating random numbers.

#include<ctime> allows us to seed our random number or in other words allows us to make the number random.

using namespace std; this lets us call any function in the std namespace without having to prefix it so std::cout can now be writhen cout which will save you lots of time.

Next we add.
int main()
{
	srand(time(NULL));

	char playagain = 'y';
	while (playagain == 'y')
	{
}
}
In side Int main()s braces is where all of our code is executed by the complier.(for this tutorial.)

srand(time(NULL)); This seeds our random number

char playagain = 'y'; This sets playagain to a char value which is a character value then set it == or equal to ‘y’

while (playagain == 'y')This is or main loop where the program is ran so while playagain is equal to ‘y’ execute whatever’s in these braces( this make sure the user selected y to play the game again.)
{
}

Ok now we define our main variables in our while loop.
int comguessHigh  =  100;
		int comguessLow  =  1;
		int thenumber = rand() % 100 + 1;
		int tries = 0, guess;
int comguessHigh = 100; and int comguessLow = 1; Are the variables used to tell the computer not to guess higher or lower than the high or low guess.

int thenumber = rand() % 100 + 1; this sets the variable thenumber to a random number between 1-100.

Int tries = 0,guess; This sets the variable tries and guess equal to 0.

Now comes the guessing the number part.
for(;;)
		{
			cout << "Enter guess: ";
		    cin >> guess;
			tries += 1;

			if (guess < thenumber)
			{
				cout << "\nThat's to low.\n" << endl;
			}
			else if (guess > thenumber)
			{
				cout << "\nThat's to high.\n" << endl;
			}
			else
			{
				cout << "That's it! You guessed it in " << tries << " tries." << endl;
				break;
			}
cout << "Enter guess: This asks the user to enter a number

cin >> guess; This takes the user input and sets guesses value equal to the number entered.

tries += 1; This sets tries plus 1 which will later be used to tell the user how many tries it took them to guess the number.

if (guess < thenumber) if guess is smaller than thenumber tell the user it to low then move on to the next operation.(which will do in a minute)
{
cout << "\nThat's to low.\n" << endl;
}
else if (guess > thenumber) if guess is larger than thenumber tell the user it to high then move on to the next operation.(which will do in a minute)
{
cout << "\nThat's to high.\n" << endl;
}
else [If the users guess is not to high or low tell the user how many tries it took to guess it in then exit the for(;;) loop with the break; statement.]
{
cout << "That's it! You guessed it in " << tries << " tries." << endl;
break;
}

OK so now the player can guess at the number but now we need to make the computer take a guess.
int comguess = rand() % (comguessHigh - comguessLow + 1) + comguessLow;
			cout << "Computer guess's: " << comguess << endl;

			if (comguess < thenumber)
			{
				cout << "\nThe computers guess was to low.\n" << endl;
				comguessLow = comguess;
			}
			else if (comguess > thenumber)
			{
				cout << "\nThe computers guess was to high.\n" << endl;
				comguessHigh = comguess;
			}
			else
			{
				cout << "\nSorry the computer guessed it." << endl;
				break;
			}
int comguess = rand() % (comguessHigh - comguessLow + 1) + comguessLow; This changes comguess which is the computers guess so it can only be lower than its highest guess and higher than its lowest guess.

The rest of that code checks to see if the computers guess to high or low just like we did a minute ago when the player guessed.

Now the last thing we have to do is when the player or computer guesses the number we need to ask if we want to play again.
}
			
		       cout << "\nDo you want to play again? (y/n)" << endl;
		       cin >> playagain;
	}
	
	           cout << "\nOk mabye next time." << endl;

	cin.get();
	return 0;
}
}
cout << "\nDo you want to play again? (y/n)" << endl;
cin >> playagain;
}
Asks the user if they want to play again if a letter is entered that is not y the while loop is not executed because again is not equal to y.

cin.get(); This keeps the console window open intel the program is done running.

return 0;This exits the program.

I know that that migh be a little hard to tell where every thing go's so heres the whole code.
#include<iostream>
#include<cstdlib>
#include<ctime>
using namespace std;


int main()
{
	srand(time(NULL));

	char playagain = 'y';
	while (playagain == 'y')
	{

		int comguessHigh = 100;
		int comguessLow = 1;
		int thenumber = rand() % 100 + 1;
		int tries = 0, guess;

		for(;;)
		{
			cout << "Enter guess: ";
		    cin >> guess;
			tries += 1;

			if (guess < thenumber)
			{
				cout << "\nThat's to low.\n" << endl;
			}
			else if (guess > thenumber)
			{
				cout << "\nThat's to high.\n" << endl;
			}
			else
			{
				cout << "That's it! You guessed it in " << tries << " tries." << endl;
				break;
			}

			int comguess = rand() % (comguessHigh - comguessLow + 1) + comguessLow;
			cout << "Computer guess's: " << comguess << endl;

			if (comguess < thenumber)
			{
				cout << "\nThe computers guess was to low.\n" << endl;
				comguessLow = comguess;
			}
			else if (comguess > thenumber)
			{
				cout << "\nThe computers guess was to high.\n" << endl;
				comguessHigh = comguess;
			}
			else
			{
				cout << "\nSorry the computer guessed it." << endl;
				break;
			}
	    
		}
			
		       cout << "\nDo you want to play again? (y/n)" << endl;
		       cin >> playagain;
	}
	
	           cout << "\nOk mabye next time." << endl;

	cin.get();
	return 0;
}

Well there you have it hope you learned somthing if you have any questions or problems feel free to ask.(leave comments on how to make my next tut better :)
  • 1


#532327 Wants to say hello, new to the forum!

Posted by CommittedC0der on 16 December 2009 - 01:04 PM

Hello and welcome to CodeCall.:) BTW there's a forum for introducing your self near the bottom of the forums page.
  • 1


#531736 What is wrong with this code?

Posted by CommittedC0der on 13 December 2009 - 06:27 PM

No Prob.:)
  • -1


#531380 C++ Tutorial(1) "Hello World".

Posted by CommittedC0der on 11 December 2009 - 10:23 PM

OK I can't stop the tradition so are first program in C++ will be of course "Hello World".
OK let's get started.
#include<iostream> [COLOR="green"]// This includes the files for input and output.[/COLOR]

int main() [COLOR="green"]//Inside this is where the computer executes the code.[/COLOR]
{
	std::cout << "Hello World" << std::endl; [COLOR="green"]//This prints Hello World, cout pronounced C out sends Hello World to the console window.[/COLOR]
	                                         [COLOR="green"]//endl which stands for endline puts us on the beginning of the next line if you want to stay on the same line then just don't add std::endl just the ";" after your text.
	                                         // std stands for standard which just tells the computer that this is a standard operation.[/COLOR]
	
	system("PAUSE");[COLOR="green"]//This makes the window stay up without this the window would open and shut in a flash.(This is not a good way to do that I'll show you how to fix it next.)[/COLOR]
	return 0;[COLOR="green"]//This ends the program.[/COLOR]
}
Hope that was easy enough.
Now I'm going to show you how to save some time righting a story or paragraph and a better way to keep the window open.
#include<iostream> [COLOR="green"]// This includes the files for input and output.[/COLOR]
[COLOR="red"]using namespace std;[/COLOR][COLOR="green"] //This now includes the standard files(I think:{)so in are Hello World line we don't have to type std:: before cout and endl.[/COLOR]

int main() [COLOR="green"]//Inside this is where the computer executes the code.[/COLOR]
{
	cout << "Hello World" << endl; [COLOR="green"]//This prints Hello World, cout pronounced C out sends Hello World to the console window.[/COLOR]
	                                         [COLOR="green"]//endl  which stands for endline and puts us on the beginning of the next line if you want to stay on the same line then just don't add endl just the ";" after your text.
	                                         [/COLOR]
	
	[COLOR="Red"]cin.get();[/COLOR][COLOR="green"]//This is a better way to make the window stay up(Note this only works if you include namespace std;[/COLOR]
	return 0;[COLOR="green"]//This ends the program.[/COLOR]
}
At first I didn't want to use the namespace std thing because I thought it was bad programming but it will save you a lot of work if you have a lot of sentences to type.

Well I hope this tutorial helped you.:)
(if you have any problems PM me or leave a visitor message sorry but I don't know how to make the code windows bigger)
  • -2




Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download