Hard Light Productions Forums

Modding, Mission Design, and Coding => FS2 Open Coding - The Source Code Project (SCP) => Topic started by: takashi on March 12, 2007, 05:58:02 pm

Title: uncompiled source code?
Post by: takashi on March 12, 2007, 05:58:02 pm
where might i find the uncompiled 3.6.9 source code? im learning code and need something to mess around with.
Title: Re: uncompiled source code?
Post by: Turey on March 12, 2007, 06:03:49 pm
where might i find the uncompiled 3.6.9 source code? im learning code and need something to mess around with.

In CVS.
Title: Re: uncompiled source code?
Post by: takashi on March 12, 2007, 06:33:51 pm
all i can see is a compiled .exe.
Title: Re: uncompiled source code?
Post by: Turey on March 12, 2007, 06:55:33 pm
all i can see is a compiled .exe.

Then you're obviously not looking hard enough.  :P
Title: Re: uncompiled source code?
Post by: takashi on March 12, 2007, 07:06:50 pm
i check every topic in the "recent builds" forum, where i think the CVS is located.
Title: Re: uncompiled source code?
Post by: Turey on March 12, 2007, 07:10:20 pm
i check every topic in the "recent builds" forum, where i think the CVS is located.

That's not where CVS is located.
Title: Re: uncompiled source code?
Post by: Shade on March 12, 2007, 07:43:09 pm
You can either get it with a CVS client as explained admirably by Karajorma in This Post (http://www.hard-light.net/forums/index.php/topic,41234.msg842224.html#msg842224), or you can view it in your browser Here (http://fs2source.warpcore.org/cgi-bin/cvsweb/cvsweb.cgi/).
Title: Re: uncompiled source code?
Post by: Turey on March 12, 2007, 07:48:27 pm
You can either get it with a CVS client as explained admirably by Karajorma in This Post (http://www.hard-light.net/forums/index.php/topic,41234.msg842224.html#msg842224), or you can view it in your browser Here (http://fs2source.warpcore.org/cgi-bin/cvsweb/cvsweb.cgi/).

(http://image.space.rakuten.co.jp/lg01/57/0000128357/09/imgddbdbe62j98csw.jpeg)
Oh, you're no fun anymore!  :doubt:
Title: Re: uncompiled source code?
Post by: takashi on March 12, 2007, 08:06:48 pm
i see i can view it. but i cant dowlaod it. :\
Title: Re: uncompiled source code?
Post by: WMCoolmon on March 12, 2007, 09:23:06 pm
You can either get it with a CVS client as explained admirably by Karajorma in This Post (http://www.hard-light.net/forums/index.php/topic,41234.msg842224.html#msg842224)...
Title: Re: uncompiled source code?
Post by: Shade on March 12, 2007, 09:45:29 pm
Well... getting started can certainly be a bit overwhelming, and I'm in a helpful mood tonight, so here you go: http://www.badongo.com/file/2450909 (http://www.badongo.com/file/2450909). Unless I accidentally opened up the wrong workspace at some point recently, that should be a clean and unmodified 3.6.9 code tree. Just unzip it to a directory of your choice and you should be good to go.
Title: Re: uncompiled source code?
Post by: takashi on March 12, 2007, 10:39:40 pm
thanks! looking at this code is realy helping me learn how to do stuff...

}


int i;
void Shootstuff();

for(i = 0; i < 42; i++)
{
   shootStuff();
}

//Declare some functions
void shootshivans();
void shootntf();
void shootwingmen();

//Give ourselves a variable
int a = 2;

switch(a)
{
   case 0:              //If a is 0...
      shootshivans();   //...shoot down shivans!
      break;      //We're done, jump to the end of the code block.
   case 1:              //If a is 1...
      shootNTF();   //...now ya gotta shoot down NTF ships!
      break;
   default:      //If none of the above match...
      shootwingmen();   //...shoot yur wingmen....0_0.
            //Since a IS 2, we'll be shooting down alpha 1's wingmen
      break;
}

----this is part of nether code blocks, but put in the post for distinction------------


struct ship
{
   ship name[alpha 1];   
   unsinged int shields;   
   unsned int weight;   

};

intkaamosshootship (ship alpha_1)
{
   for(alpha_1.shields > 0; alpha_1.shields--);

}

kaamosshootship (terranship);

int kaamosshoot ship (ship *alpha_1)
{
   for (;alpha_1->shields > 0; alpha_1->shields--);

}

did i mess up?
Title: Re: uncompiled source code?
Post by: Hippo on March 13, 2007, 12:12:54 am
thanks! looking at this code is realy helping me learn how to do stuff...

}


int i;
void Shootstuff();

for(i = 0; i < 42; i++)
{
   shootStuff();
}

//Declare some functions
void shootshivans();
void shootntf();
void shootwingmen();

//Give ourselves a variable
int a = 2;

switch(a)
{
   case 0:              //If a is 0...
      shootshivans();   //...shoot down shivans!
      break;      //We're done, jump to the end of the code block.
   case 1:              //If a is 1...
      shootNTF();   //...now ya gotta shoot down NTF ships!
      break;
   default:      //If none of the above match...
      shootwingmen();   //...shoot yur wingmen....0_0.
            //Since a IS 2, we'll be shooting down alpha 1's wingmen
      break;
}

----this is part of nether code blocks, but put in the post for distinction------------


struct ship
{
   ship name[alpha 1];   
   unsinged int shields;   
   unsned int weight;   

};

intkaamosshootship (ship alpha_1)
{
   for(alpha_1.shields > 0; alpha_1.shields--);

}

kaamosshootship (terranship);

int kaamosshoot ship (ship *alpha_1)
{
   for (;alpha_1->shields > 0; alpha_1->shields--);

}

did i mess up?


you have a for loop which increments i a total of 41 times, but i is not referenced in the loop. you can also declare i in the for itself:

Code: [Select]
for(int i = 0; i < 42; i++){}
but either way, all you've managed to do could be done with

Code: [Select]
int i = 41;
your compiler is probably going to scream at 'unsned' and 'unsinged' being undeclared identifiers, might want to add some letters/rearrange them :p


the last 2 functions would be more clear as while or do-while loops instead of a for, though the for loop does work

oh, and you don't need a break after the default of the switch
Title: Re: uncompiled source code?
Post by: WMCoolmon on March 13, 2007, 02:04:35 am
http://www.hard-light.net/wiki/index.php/Coding_In_C
Title: Re: uncompiled source code?
Post by: phreak on March 13, 2007, 02:10:52 pm
Quote
0. Thou shalt not dereference a null pointer.
1. Thou shalt not dereference a null pointer, in any case whatsoever.
2. dmr cannot stress this enough: thou shalt not dereference a null pointer.
3. Thou shalt not dereference a null pointer.  We really do mean it.
4. We cannot tell thee enough how important it is that thee not dereference a null pointer.
5. Under no circumstance shalt thee dereference a null pointer.
6. Move not all null pointer, for great justice.
7. www.thoushaltnotdereferenceanullpointer.com
8. When we tell thee not to dereference a null pointer, thou shalt do it.  I mean not do it.  I mean ... I knoweth what I mean.
9. Steve Ballmer will ****ing kill you if you so much as think about hiring someone who dereferences a null pointer.
10. There shall be no eleventh commandment.
Title: Re: uncompiled source code?
Post by: takashi on March 13, 2007, 06:11:09 pm
#include <iostream>
using namespace std;

int main ()
{
  int a;
  cout << "USERNAME GENERAOR. ";
  cout << "follow onscreen intructions and recieve a username. ";
  cout << "Please enter a number: ";
  cin >> a;
  cout << "you entered: " << a;
  int b;
  cout << " enter a noun: ";
  cin >> b;
  cout << "the noun you entered is: " << b;
  int c;
  cout << "please enter your age: ";
  cin >> c;
  cout << "the entered age is: << b;

// declaring variables:
  int a, b, c;
  int result;

  // process:
  a = a;
  b = b;
  c = c
  a = a + c;
    result = b + a;

  // print out the result:
  cout << result;
  cout << "this is your username ";


  return 0;
}
Title: Re: uncompiled source code?
Post by: Hippo on March 13, 2007, 08:28:47 pm
:wtf:

Did you try compiling that before posting it? You tried to put a noun (word) into an int variable, which just won't work the way you want. You need to make a, b, and c strings (because you can still put an int into a string), and not redeclare the same variable names later on, because all you do is confuse the compiler. You're also missing 2 semicolons.

Code: [Select]
#include <iostream>
#include <string>
using namespace std;

int main(){
string a,b,c;
cout << "USERNAME GENERATOR.\nFollow the onscreen instructions and recieve a username."
<< "\nPease enter a number: ";
cin >> a;
cout << "You entered: " << a
<< "\nEnter a noun: ";
cin >> b;
cout << "The noun you entered is " << b
<< "\nPlease enter your age: ";
cin >> c;
cout << "The entered age is: " << c << endl;

string result;
result = a + b + c;

cout << "Your username is " << result << endl;

return 0;
}
Title: Re: uncompiled source code?
Post by: abosch on March 13, 2007, 09:32:53 pm
age has to be multiplied by number, and then noun+(age+number)

your fix ruined it.
Title: Re: uncompiled source code?
Post by: Hippo on March 13, 2007, 10:43:34 pm
nowhere is multiplication used, and you've contradicted yourself
Title: Re: uncompiled source code?
Post by: Flipside on March 13, 2007, 11:07:47 pm
You cannot assign a String an Int value, Int values are signed Integer, usually 2 Bytes long, which allows you to hold a number between 32767 and -32768, but that's all. Assigning a variable to it will either result in an error or a bogus result.
Title: Re: uncompiled source code?
Post by: Hippo on March 13, 2007, 11:51:04 pm
you can stream numbers into a string, but you can't perform math on them... for the purpose of what he posted, a string consiting of numbers works
Title: Re: uncompiled source code?
Post by: takashi on March 14, 2007, 05:12:03 pm
b+a+c

fixed! if a word counts as a value.....
Title: Re: uncompiled source code?
Post by: Flipside on March 14, 2007, 07:03:45 pm
you can stream numbers into a string, but you can't perform math on them... for the purpose of what he posted, a string consiting of numbers works

Well, it was this part that confuses me...

Code: [Select]
// declaring variables:
  int a, b, c;

When compared with this...

Code: [Select]
cout << " enter a noun: ";
  cin >> b;

To my mind, entering text into an Integer defined variable would cause a crash, though, I'll freely admit, I haven't got round to learning C++ yet, hell, they're making me code in VB.net at the moment, that's like Frontpage meets Access and a thoroughly horrible experience :(

Also, from personal experience, I find you tend to need to define the variable before you start filling them, however, this just may be part of how C++ works.

Edit2: Ah my mistake, they are defined twice, though b is still set as an integer.
Title: Re: uncompiled source code?
Post by: WMCoolmon on March 14, 2007, 07:25:07 pm
You cannot assign a String an Int value, Int values are signed Integer, usually 2 Bytes long, which allows you to hold a number between 32767 and -32768, but that's all. Assigning a variable to it will either result in an error or a bogus result.

Int should be 4 bytes (32-bits) on 32-bit processors which are the norm nowadays.
Title: Re: uncompiled source code?
Post by: Flipside on March 14, 2007, 07:33:45 pm
Heh, true, some of my coding knowledge is a little out of date ;)
Title: Re: uncompiled source code?
Post by: takashi on March 15, 2007, 09:10:59 pm
when its finished (and better) i will release the username generator, or even maybe bundle it up with fs2 after some changes.