17 Replies. 1 pages. Viewing page 1.
< Newer [ 1 ] Older >
 |
| 17. |
Re: Return to Castle Wolfenstein and Enemy Territory Source Code |
Aug 13, 2010, 09:22 |
peteham |
|
|
kxmode wrote on Aug 12, 2010, 22:04: Is ActionScript 2 like C++? This reminds me of an old gem. "Shooting yourself in the foot in any language." It can be found in many, many places across teh web, in just as many versions. I'm about to include an abbreviated version of this..
The proliferation of modern programming languages (all of which seem to have stolen countless features from one another) sometimes makes it difficult to remember what language you’re currently using. This guide is offered as a public service to help programmers who find themselves in such dilemmas.
C: You shoot yourself in the foot. C++: You accidentally create a dozen clones of yourself and shoot them all in the foot. Providing emergency medical assistance is impossible since you can’t tell which are bitwise copies and which are just pointing at others and saying, “That’s me, over there.” JAVA: After importing java.awt.right.foot.* and java.awt.gun.right.hand.*, and writing the classes and methods of those classes needed, you’ve forgotten what the hell you’re doing. PHP: You shoot yourself in the foot with a gun made with pieces from 300 other guns. Perl: You shoot yourself in the foot, but nobody can understand how you did it. Six months later, neither can you. COBOL: Using a COLT 45 HANDGUN, AIM gun at LEG.FOOT, THEN place ARM.HAND.FINGER. on HANDGUN.TRIGGER and SQUEEZE. THEN return HANDGUN to HOLSTER. CHECK whether shoelace needs to be retied. Visual Basic: You’ll shoot yourself in the foot, but you’ll have so much fun doing it that you won’t care.
By the way, I've never understood the one about Visual Basic. I've had to briefly touch some legacy VB code from time to time, and it certainly wasn't fun in any way, shape or form |
|
|
|
|
|
|
|
| |
 |
| 16. |
Re: Return to Castle Wolfenstein and Enemy Territory Source Code |
Aug 13, 2010, 05:14 |
Capitan |
|
|
| Why can't we get games like these nowadays? I don't understand how the game developers think? |
|
|
|
|
|
|
|
| |
 |
| 15. |
Re: Return to Castle Wolfenstein and Enemy Territory Source Code |
Aug 13, 2010, 03:13 |
Eldaron Imotholin |
|
|
ET. The one game I will forever love and miss. The one era where I was hardcore and clanned. I felt that the ET servers got tainted with personal crapmods too quickly (imo).
*sigh* Good old times, RTCW included. Beach <3 |
|
 |
 |
|
 |
|
 |
|
Playing: Skyrim, World of Warcraft. Future: Dead Space 3. |
|
|
|
|
| |
 |
| 14. |
Re: Return to Castle Wolfenstein and Enemy Territory Source Code |
Aug 13, 2010, 01:40 |
Domgrief |
|
|
kxmode wrote on Aug 12, 2010, 22:04: I've never seen C++ code before, but I'm trying to figure out if there is more to it than what I saw. Can anyone tell me what the differences are? Is ActionScript 2 like C++? It's quite similar in several respects - the methods of creating functions, performing basic operations, and nesting {} are quite similar. You should have no problem tinkering with the existing code, changing a few numbers, etc.
I'm not familiar with AS2, but I think you'll notice three major differences:
1) The available libraries (import xx in your AS code) in most C/C++ applications are very limited. Even though it's built on OpenGL, I expect you'll find that id have had to write their own wrapper functions for drawing graphics, and so on.
2) Creating a new object in C involves declaring it (like any scripting language), and in many cases allocating memory for it as well, then de-allocating the memory once you're done with your work. You don't have to bother with that stuff when working with scripting languages (or .NET), which is one reason they're so popular.
3) Scripting languages are very self-aware - they'll let you know if you go out of bounds on an array, or try and use a variable that hasn't been given a value yet. C just fails. It can be a real pain to debug. |
|
|
|
|
|
|
|
| |
 |
| 13. |
Re: Return to Castle Wolfenstein and Enemy Territory Source Code |
Aug 13, 2010, 01:01 |
Kxmode |
|
|
dubfanatic wrote on Aug 12, 2010, 23:30:
kxmode wrote on Aug 12, 2010, 22:04: I've never seen C++ code before, but I'm trying to figure out if there is more to it than what I saw. Can anyone tell me what the differences are? Is ActionScript 2 like C++? Going from ActionScript 2 to C++ is like going from riding a bike with training wheels to driving a motorcycle with a jet engine strapped to it. Because the jet engine is a metaphor for the OS and hardware? |
|
 |
|
|
|
|
|
| |
 |
| 12. |
Re: Return to Castle Wolfenstein and Enemy Territory Source Code |
Aug 12, 2010, 23:30 |
dubfanatic |
|
|
kxmode wrote on Aug 12, 2010, 22:04: I've never seen C++ code before, but I'm trying to figure out if there is more to it than what I saw. Can anyone tell me what the differences are? Is ActionScript 2 like C++? Going from ActionScript 2 to C++ is like going from riding a bike with training wheels to driving a motorcycle with a jet engine strapped to it. |
|
|
|
|
|
|
|
| |
 |
| 11. |
Re: Return to Castle Wolfenstein and Enemy Territory Source Code |
Aug 12, 2010, 22:04 |
Kxmode |
|
|
I'm trying to wrap my head around something.
Here's a snippet from line 5268 in ui_main.c:
/* ================== UI_SortServerStatusInfo ================== */ static void UI_SortServerStatusInfo( serverStatusInfo_t *info ) { int i, j, index; char *tmp1, *tmp2;
// FIXME: if "gamename" == "baseq3" or "missionpack" then // replace the gametype number by FFA, CTF etc. // index = 0; for ( i = 0; serverStatusCvars[i].name; i++ ) { for ( j = 0; j < info->numLines; j++ ) { if ( !info->lines[j][1] || info->lines[j][1][0] ) { continue; } if ( !Q_stricmp( serverStatusCvars[i].name, info->lines[j][0] ) ) { // swap lines tmp1 = info->lines[index][0]; tmp2 = info->lines[index][3]; info->lines[index][0] = info->lines[j][0]; info->lines[index][3] = info->lines[j][3]; info->lines[j][0] = tmp1; info->lines[j][3] = tmp2; // if ( strlen( serverStatusCvars[i].altName ) ) { info->lines[index][0] = serverStatusCvars[i].altName; } index++; } } } }
Juxtapose with ActionScript 2.0 code snippets I wrote for a large custom card flash app...
/* ***************************** Press the Up Arrow ***************************** */ function displayUpArrow() { uparrow.onPress = function() { this.onEnterFrame = function() { selectedPhoto._y -= rate; } } uparrow.onRelease = function() { delete this.onEnterFrame; } uparrow.onReleaseOutside = uparrow.onRelease; }
/* ***************************** Switches photo between grayscale, sepia and color. The sepia shader is FPO. ***************************** */ import flash.filters.BitmapFilter; import flash.filters.ColorMatrixFilter; function changeColor(colorData:Number) { var matrix:Array = new Array(); switch (colorData) { case 1: // grayscale matrix = matrix.concat([0.3, 0.59, 0.11, 0, 0]); // red matrix = matrix.concat([0.3, 0.59, 0.11, 0, 0]); // green matrix = matrix.concat([0.3, 0.59, 0.11, 0, 0]); // blue matrix = matrix.concat([0, 0, 0, 1, 0]); // alpha break; case 2: // sepia matrix = matrix.concat([0.4, 0.4, 0.4, 0, 0]); // red matrix = matrix.concat([0.3, 0.3, 0.3, 0, 0]); // green matrix = matrix.concat([0.2, 0.2, 0.2, 0, 0]); // blue matrix = matrix.concat([0, 0, 0, 1, 0]); // alpha break; default: // color matrix = matrix.concat([1, 0, 0, 0, 0]); // red matrix = matrix.concat([0, 1, 0, 0, 0]); // green matrix = matrix.concat([0, 0, 1, 0, 0]); // blue matrix = matrix.concat([0, 0, 0, 1, 0]); // alpha break; } var filter:BitmapFilter = new ColorMatrixFilter(matrix); viewport1.container.filters = new Array(filter); photo1thumb.filters = new Array(filter); photo1Color = colorData; photoColor[1] = colorData; }
A snippet from a floorplan app:
/* ***************************** Toggles "feature products" header bar ***************************** */ (featured1product[id] == "") ? nofeatured1product = true : nofeatured1product = false; (featured2product[id] == "") ? nofeatured2product = true : nofeatured2product = false; (featured3product[id] == "") ? nofeatured3product = true : nofeatured3product = false; (featured4product[id] == "") ? nofeatured4product = true : nofeatured4product = false; (featured5product[id] == "") ? nofeatured5product = true : nofeatured5product = false; if (nofeatured1product == true && nofeatured2product == true && nofeatured3product == true && nofeatured4product == true && nofeatured5product == true) { this.sidecolumn.featuredproducts_mc._alpha = 0; } else { this.sidecolumn.featuredproducts_mc._alpha = 100; }
A snippet from restaurant website...
/* ***************************** Populate time combobox with an array of hours ***************************** */ for (h=0; h<=23; h++) { m = 0; //24-hour period for (i=0; i<=1; i++) { //seconds s = ""; if (h == 0) { s = s + "12"; } else { if (h > 12) { s = s + int(h - 12); } else { s = s + h; } } // minutes if (m < 10) { s = s + ":0" + m; } else { s = s + ":" + m; } // hours if (h > 11) { s = s + " PM"; } else { s = s + " AM"; } // populate combobox component timecombo.addItem({label:s, data:s}); //increment by 30 m += 30; } }
/* ***************************** Sets party size to 2 and time to 7:30 PM ***************************** */ partycombo.selectedIndex = 1; party = "2"; timecombo.selectedIndex = 39; time = "7:30 PM";
And a snippet from an architect's website:
/* ***************************** Slides menu up and down ***************************** */ function menuSlider(speed) { var isScroll:Boolean = true; var targetDistance:Number = ((clientmenu_mc._height - Stage.height) + 20) * -1; trace(Stage.height + " " + clientmenu_mc._height + " " + targetDistance); trace(((clientmenu_mc._height - Stage.height) + 20) * -1); var sliderListener:Object = new Object(); this.createEmptyMovieClip("sliderListenerObj",this.getNextHighestDepth()); sliderListenerObj.onEnterFrame = function() { // is scrolling enabled? if (isScroll == true) { // is mouse near client menu? if (_xmouse < Stage.width / 6) { // tracks mouse's Y position if ((_ymouse < Stage.height) && (_ymouse >= 0)) { // tracks client menu's Y position if ((clientmenu_mc._x <= 0) && (clientmenu_mc._y >= targetDistance)) { scrollMotion = (_ymouse - Stage.height / 2) / speed; // switches scrolling up or down if ((clientmenu_mc._y - scrollMotion <= 0) && (clientmenu_mc._y - scrollMotion >= targetDistance)) { clientmenu_mc._y -= scrollMotion; } } } } } } this.addListener(sliderListener); }
I've never seen C++ code before, but I'm trying to figure out if there is more to it than what I saw. Can anyone tell me what the differences are? Is ActionScript 2 like C++? |
|
 |
|
|
|
|
|
| |
 |
| 10. |
Re: Return to Castle Wolfenstein and Enemy Territory Source Code |
Aug 12, 2010, 20:36 |
Sepharo |
|
|
Than wrote on Aug 12, 2010, 17:34: Wolfenstein: Enemy Territory is an exceptional LAN game. During my senior year of high school my 1st hour class was an online AP class, they combined the 20 or so students taking online courses into one computer lab.
Every morning at 7:20 sharp I'd start passing out the executable on burned CDs (HD image reset every night) and by 7:30 or so we were ready to have an fun as hell ET LAN.
The lab supervisor every now and then would look up from her book wondering why we would be slamming away on the keyboard or holding in anger/excitement.
I've never seen so many 4.0 AP students fail their classes before. I remember one kid told his online professor that he was going to be on vacation for a week just so he could play more ET and do less work.
I bet after all us smarties failed they dropped the whole program, "These gosh-darned online classes must be waaay too hard/demanding!"
edit: eh, thinking about it some more, most of my classmates probably did all their work at home anyway. I never cared much for homework so I certainly failed. |
|
 |
 |
|
 |
|
 |
|
| [I'm not trolling I'm just] tossing stuff like that in there only to get your panties all bunched up. -TrollinThundr |
|
|
|
|
| |
 |
| 9. |
Re: Return to Castle Wolfenstein and Enemy Territory Source Code |
Aug 12, 2010, 20:34 |
Reikon |
|
|
| ET was great back in the day. I tried playing it again recently and pretty much all the servers have horrible mods and settings. How I wish I could go back and play on populated servers with ETPro. |
|
|
|
|
|
|
|
| |
 |
| 8. |
Re: Return to Castle Wolfenstein and Enemy Territory Source Code |
Aug 12, 2010, 20:33 |
TorchMaster |
|
|
ET was the shizzle.
Much respect to iD for consistently releasing their old source code. I've learned a lot from their code.
=TorchMaster= |
|
 |
 |
|
 |
|
 |
|
| Victory needs no explanation; defeat allows none. |
|
|
|
|
| |
 |
| 7. |
Re: Return to Castle Wolfenstein and Enemy Territory Source Code |
Aug 12, 2010, 20:09 |
Pigeon |
|
|
| I played the hell out of ET. I still have fond memories of mowing people down at bottlenecks with the MG42 |
|
|
|
|
|
|
|
| |
 |
| 6. |
Re: Return to Castle Wolfenstein and Enemy Territory Source Code |
Aug 12, 2010, 18:57 |
SM0k3 |
|
|
Ant wrote on Aug 12, 2010, 17:23: What's next? DOOM 3?
OH please don't get my hopes up!!!!
This is cool as sh*t though, I can't wait to see what the community does with it. |
|
 |
|
|
|
|
|
| |
 |
| 5. |
Re: Return to Castle Wolfenstein and Enemy Territory Source Code |
Aug 12, 2010, 18:20 |
BobBob |
|
|
|
|
|
| |
 |
| 4. |
Re: Return to Castle Wolfenstein and Enemy Territory Source Code |
Aug 12, 2010, 17:40 |
Wolfen |
|
|
| Totally. ET was awesome. Its the one team based action fps that i spent countless hours on. Even rented my own server for a while. |
|
|
|
|
|
|
|
| |
 |
| 3. |
Re: Return to Castle Wolfenstein and Enemy Territory Source Code |
Aug 12, 2010, 17:38 |
Ant |
|
|
Than wrote on Aug 12, 2010, 17:34: Wolfenstein: Enemy Territory is an exceptional LAN game. The amount of time I've put into that game is absurd.
It managed to make leveling work and awesome in a multiplayer game. I can't think of any other game that's done it, let alone done it well. (My memory has been known to suck however.) Yeah, now people can MODIFY the games to make the games better and even new stuff! YEAH! =)
Hey, were there ever Mac OS X ports for these two games? If not, then maybe someone can port them to Mac OS X! |
|
 |
|
|
|
|
|
| |
 |
| 2. |
Re: Return to Castle Wolfenstein and Enemy Territory Source Code |
Aug 12, 2010, 17:34 |
Than |
|
|
Wolfenstein: Enemy Territory is an exceptional LAN game. The amount of time I've put into that game is absurd.
It managed to make leveling work and awesome in a multiplayer game. I can't think of any other game that's done it, let alone done it well. (My memory has been known to suck however.) |
|
|
|
|
|
|
|
| |
 |
| 1. |
Re: Return to Castle Wolfenstein and Enemy Territory Source Code |
Aug 12, 2010, 17:23 |
Ant |
|
|
| Wow! I can't wait to see mods and stuff. What's next? DOOM 3? |
|
 |
|
|
|
|
|
| |
17 Replies. 1 pages. Viewing page 1.
< Newer [ 1 ] Older >
|
|