============================================================================ DN3D1666.ME! -- Duke Nukem 3D v1.666 info file Created by Stas * (C)opyLeft by SysD Destructive Labs 1997-2001 ============================================================================ CONTENTS: I. File List II. Installation III. Features List IV. User's Manual V. FAQ-U! VI. Bugs/Inconveniences VII. History VIII. Developer Info IX. (Don't) Contact Me! ============================ I. File List ============================ DN3D1666.ZIP: package file, that contains: DUKE3D.666 - Separated configuration file DEFS.CON \ GAME.CON -0- v1.666 CON files USER.CON / CWSDPMI.EXE - DPMI host (only needed if you plan to play on raw DOS DUKE3D.EXE - Main file DN3D1666.ME! - Guess what... ============================ II. Installation ============================ Well, at first I need to say that all installation is manual, so read this section *OR YOU WILL DAMAGE YOUR CURRENT DUKE3D INSTALLATION*!!! Sorry, I'm too lazy to make decent installer, and, well, it's quite easy. So, let it begin: * What do you need to have? An original Duke Nukem 3D v1.5 installed, of course! No, it can't be 1.3d neither EDuke. This is just a patch for 1.5 version. STEP 1: Backup your Duke Nukem 3D 1.5 installation. Note that if you doesn't have one, you may install it. If you don't want to, what the fuck are you doing here?! (for smart users: you can backup only the files that will be replaced, but, if some crazy bug pisses all your Duke3D, remember that I tried to help) STEP 2: Extract contents of DN3D1666.ZIP to your Duke3D's directory. As I hope you had backuped it, overwrite *ALL*. Have no mercy >:E STEP 3: Configure Duke3D. Run SETUP.EXE, and go to "Controller Setup", then "Choose Controller Type", and then select "Keyboard and External". After this, select "Setup External", "Change External Program Name", and type "DUKE3D.EXE" there. Now you can save config, but DON'T LAUNCH A GAME YET!!! (NOTE: it would be great if you disabled Turn_Left and Turn_Right keyboard bindings, although, if you wouldn't plan to use "AutoAimSelfCalibrate" setting in DUKE3D.666 file or Auto-Aim at all, you don't need to do this) STEP 4: Now, edit a file DUKE3D.666. Open it in your favorite editor, and you'll see that it's self-explanatory. Well, not too much, but... Note that your mouse is now configured by this file, any SETUP settings will be ignored! Also note that default mouse settings for 1.666 imitates default settings for normal Duke3D. STEP 5: Congratulations!!! You're DONE!!! ============================ III. Features List ============================ "Why to use 1.666 version?" Humm, let me see what cool things it have! * Auto-Aim : bot that automatically aims your opponent * Auto-Kick : kicks your opponent when you're close to him * Auto-MedKit : MedKit activates automatically when you get hurt * Weapon Holder : don't care with new weapons you get, it keeps you with old one * Auto-Jetpack : saves you from crashing when falling from a big height * "DN" Cheats in Multiplayer! : *NOT* exactly what you need, see below * New cheats! : "End Episode" and "Pass Level" cheats * Coop View in *any* game mode : allows you to see opponent's screen! * "Visible" holoduke : holoduke now appears different from real player * No steroids trail : well, you know... * Enhanced vision : see in the dark without using nightvision * Automatic "Weapon Mode" : you don't need to activate it when game starts * No camera switching in demo : see your DMO files without those camera mock * Demo viewer bugfix : yeah, those AutoRun bug was fixed (read below) * Hear opponent's sounds : quickly know what your opponent are doing * No Intro/Outro screens : Duke3D now loads/exits faster Of course, all of those are useful only in multiplayer games, *SPECIALLY* in DukeMatch. ============================ IV. User's Manual ============================ When you starts your shiny new Duke3D v1.666, it looks quite boring. Of course, you must *KNOW* how to use it ;) * Auto-Aim In the *multiplayer* (or fake) game activate "Show_Opponents_Weapon" ("W" button on default config). Now, when you shoot your opponent, Duke aims by himself. Press "W" again to turn it off (if you need to blow walls, turn switches, etc.). * Auto-Kick When you get close to your opponent (on head-to-head fight) and fire him, Duke automatically kicks his ass with Quick_Kick. It's a *very* efficient technique, your player dies faster, especially when you're using Steroids. * Auto-MedKit When it's activated in DUKE3D.666 file, it restores your health by MedKit when you get hurt. * Weapon Holder When it's activated in DUKE3D.666 file, it attempts to NOT change your current weapon by getting new one. For example, if you're using a pistol and get new RPG, by default Duke selects RPG. With this option turned on, Duke re-selects pistol, so the game looks like Quake. Read DUKE3D.666 comments for more info. * Auto-Jetpack Prevents you from crashing when falling from a big heights. When you're falling on a high speed and gets close to ground, Jetpack will be activated for a moment, which saves your ass of being smashed! Note: of course, you may have Jetpack to get this feature working. * "DN" Cheats in Multiplayer! This one is quite crazy. If you thought that you becomes Immortal, you're wrong. Yes, it activates Cheats, but most of them results in "Out Of Sync". Well, only a fact that you're typing cheats desyncs a game. So, ALL CHEATS MUST BE TYPED WHEN GAME IS PAUSED!!! So, here comes a list with all cheats and how they work on multiplayer: (you can easily see that they are lowercase and had "DN" stripped, unless you're blind) (ah, those marked with "!!!" are cheats which really works) (just forgot, "???" ones are those I had never tested) cornholio : must be typed by both players to work, unless desynks stuff : desynks when you use weapon/item that cheat added scotty### : !!! coords : !!! view : !!! time : ??? unlock : ?!?! desynks when you opens door unlocked by cheat (virtually impossible in DukeMatch, all doors starts unlocked!) cashman : must be typed by both players to work, unless desynks items : desynks when you use item that cheat added rate : !!! skill# : ??? beta : !!! hyper : BEST THING TO MOCK WITH YOUR OPPONENT!!! Just type it and move, game desynks and turns unplayable! If you're really a l00s3r, type it when you're winning by 1:0! monsters : ??? ending : aborts game and shows episode video (anyone thought "Stratovarius"?) pass : ??? (I think restarts game) todd : !!! showmap : !!! kroz : same as DNCORNHOLIO allen : !!! clip : desynks when you try to move through some wall weapons : desynks when you use weapon that cheat added inventory : desynks when you use anything added keys : desynks when you try to use key that cheat added debug : !!! If you feel pissed of with such a lot text, I resume here things that EVER works: scotty###; coords; view; rate; beta; todd; showmap; allen; debug * New cheats! During the game, you may type'em just like normal cheats: * DNENDING : End Episode (see video) * DNPASS : Pass Level (totally useless!!!) * Coop View in *any* game mode In the *multiplayer* (or fake) game activate "See_Coop_View" ("K" button on default config). Now you can see all your opponent sees, and also his health/map/coordinates (enabled by DNCOORDS cheat). Press "K" again to switch between players, until you reach yourself ;) * "Visible" holoduke Holoduke sprite was changed to big Duke's green head. So, drop holoduke anywhere. You'll see those head. The same will happen with opponent's holoduke. * No steroids trail Get some steroids and face any mirror. Activate steroids. Move a bit, watching yourself in the mirror. No trail, huh? The same happens to opponent's trail. * Enhanced vision Maybe the first feature you'll SEE. Just enter game and go to any dark place. * Automatic "Weapon Mode" Meet any opponent (even fake). You'll see his current weapon floating over his head. And you hadn't presses "W" ;) * No camera switching in demo When you're playing recorded demo, camera is switched every time. This pisses off all the game perception. But no more =D * Demo viewer bugfix If you have large experience on Duke3D, you know that when you see demo and exit without entering the game, Auto-Run status will be reset. This little fix avoids that! * Hear opponent's sounds If you know Duke3D REALLY good, you may remember that in 1.3d version when you shot your opponent he screams, so you may know if you are really hitting him. Duke3D 1.5 had removed that "option", so here is it re-added. * No Intro/Outro screens No more those huge "presentation" with video and noise at the start of the game!!! When you run Duke3D, it opens already on Game Menu. (Note that it even doesn't shows "WAITING FOR PRAYERS...", just blank screen. Don't be afraid of darkness!!!). And when you exit Duke3D, you don't need to "press any key" after seen that wonderful promo screen. ============================ V. FAQ-U! ============================ All right... No one really asked me such a dumb things, so had put here questions that I understand as interesting (dumb?! huh). Q: What the kind of name is "Duke Nukem 3D v1.666"?! A: I wanted to mean it's 1.5's successor from hell ;) Q: Isn't it a bit... satanic? A: No way, it's just a joke. Q: Are you good Duke3D player? A: If I were, you would not be reading this fuck now ;) Well, if you really wanna know, now I had totally abandoned playing Duke3D, and also other games. Sometimes I play just to mock my friends or test Duke3D v1.666 ;) Q: Why your config file is so complex? Why not a same KEY = VALUE format as in Duke3D's config? And where's 1666SETUP.EXE?! A: I'm too lazy for that things. My config format is inspirited in UN*X config format, and it's much more simple to parse by C program. Making setup GUI is quite boring for me, why don't you to it and send to me?! Q: Your Weapon Holder sucks!!! Sometimes it blocks all my controls and don't get back to old weapon! A: Thank 3D Realms for making a buggy controller API. It just don't supports too many buttons be activated at a time. When that astonishing disaster occurs, just release *all* controls and things will go back to normal. Q: And why can't I hear echo effects? A: 'Cos I applied PCI Sound Card fix on DUKE3D.EXE. Why the fuck?! Well, at first, SB Live! users will NOT be able to apply this patch themselves (v1.666 is not yet supported by those patch by Ken Silverman ;), and also, Duke3D echo effect is pretty ugly and sucks a lot. Q: Hummm, I played with SOB-BOT, but your Auto-Aim ignores SOB-BOTs! A: Yeah, but had you tried with PP-BOTs? Yeah, SOB-BOTs aren't recognized as players by Duke3D, but as monsters. And PP-BOT, which is internal to Duke3D 1.5, *IS* a player controlled by machine. Q: I had seen some Auto-Aim before... Is your one a copy of it? A: Yeah, I know that Mathias von Ottenbreit did auto aimer a long time ago. But, I wouldn't create a mine if I liked his one. His auto aim is very slow and imprecise, it recognizes targets by color so it can be used with only one fixed resolution. My auto aim works by totally different way: it "downloads" opponent's coordinates directly from a memory and tells Duke to turn EXACTLY the number of units it needs. So it has no those fuckin' "shake" that drive me crazy on Mathias' aimer. Q: Hey, your Duke3D 1.666 is cool, why didn't you released it *before*?! A: Hahaha, really strange, huh? Game created at 1996 had it's cheater developed 5 years later... I *could* did that cheater before, if I was able to. It was not very easy for me even now, and, you know, Duke3D was the second shooter game I saw (first one was Doom ;) Q: How many time you spent creating it? A: I dunno. I had the first idea of making some cool cheats for Duke3D in September of 2000, I think. I started with Coop View patch, and, well, at this time I developed all current features but those which names starts with "Auto". But, as I'm a *very* lazy person, I only started to develop Extended Controller (base for all "Auto" features, read below) at the last week of December. And it got really usable only *NOW* ;) Q: Holy shit!!! How does it aims through walls?! A: "When developed, Duke Nukem 3D v1.666 got an undocumented feature of "bionic vision", that's a very recent NASA technology and it seems that you're a lucky one: you discovered it!!! So, use it and remember: we always do the best for you, even if you don't think so!" Huh, that was a text suggested by colleague of mine from Micro$oft... But I prefer to say a naked truth: that's just a *BUG*! 1.666 aims through geometric coordinates, and *not* by screen seeking as Mathias' one. So, it aims just direction, it doesn't know how many walls are between you and enemy. It also causes some strange effects: try to jump in the water while firing (Auto-Aim must be on, of course). It's possible to your Duke suddenly change direction when underwater. It happens 'cos when you submerge, in fact you are being transparently "teleported" to special "underwater" sector anywhere in the level (level designers may know what I'm talking about). So, why don't just fix that bug?! Well, I need to say here that costs-benefits to do it are totally incompatible with my life philosophy =D (Read some books 'bout Perl by Larry Wall or Randal Schwartz if you're interested in such a "philosophy" ;) !!! NOTE !!!: now this bug is "optional", I finally found a way to aim only those opponents which you can see! See DUKE3D.666 for details. Q: Why the fuck your Auto-Aim works so bad on real connection?!?! A: It is a computer software, so it needs a real-time data to process if you want to see it working. I hate to say that, but Duke3D's communication is really BAD, especially on 1.5 version. It skips many frames and uses some very poor dead-reckoning, so it pisses of algorithms designed to work on clean fast link. The only way to avoid that is currently unknown by me. So if you have some idea, please tell me or better, DEVELOP IT! Q: So, do you plan to release your source? A: Not exactly. My project files are very strange and depends on really unportable things, and the best of all: my source is award-winning by it's impossible understanding and total absence of comments. (well, if you feel nausea reading my English, think about C, and forgot 'bout assembly ;). You don't believe? Well, what sane programmer makes his project dependent of Borland C++ Compiler, Turbo C++, Turbo Assembler, and... Perl?! YEAH, YOU'RE RIGHT: THAT'S ME!!! So, if you *really* want my sources, ask them personally, and explain to me WHAT EXACTLY you plan to do with them. Sorry, I just don't want any kiddie replace my CopyLefts by his copyrights and rename the whole project do HackyDuke. FFFFUCK! Q: Hey, I already heard 'bout External Controller API for Duke... Had you used that? A: Yeah, I had. But, when original API has unidirectional communication between Controller and Duke, mine is bi-directional. This is a real hardness of a whole project and a thing that Mathias was unable to did. Q: But if so... Where's external controller's executable?! A: It's inside DUKE3D.EXE ;) I replaced DOS4GW host/stub by PM_STUB (which is free, has opened source and is smaller) embedded in controller's code. See "Developer Info". Q: Thus why it's smaller than original DUKE3D.EXE, huh? A: Yeah, DOS4GW is so fat that controller+good loader+good host stills even smaller. Q: And why can't I use my own external controller with your Duke? A: It has a very big difference, so their "protocols" are incompatible. ECTL (Extended Controller), as I call it, is a superset of normal one, and if you tried to mix them, some memory will be overwritten and someone will be forced to press Reset button somewhere... Q: Shit!!! That fuck doesn't works on raw DOS!!! A: Shut up, dammit, it works BAD but it WORKS!!! Hadn't you forgotten 'bout CWSDPMI.EXE file in Duke3D's directory? You damn ugly asshole >:E Q: Uhm, sorry... I mean, when I run SETUP.EXE in DOS, and then I press "Save and launch Duke Nukem 3D", it does quite strange things... A: Oh, well, pardon, sir!!! I dunno what's that, but it's boring me anyway... -- Yeah, yeah, finally, a *REAL* questions!!! Q: Where did you got Duke Nukem 3D 1.5 source??? A: Sorry, I really want to touch(1) on it, but I hadn't found it. Duke Nukem 3D v1.666 was *patched* using assembly only, and it's external controller was made in C/Assembly. Oh, of course, they are some little enhancements that used CON language only! :P Q: Do you plan to release any cheaters for EDuke or Duke3D 1.3d/1.4? A: Certainly, NO. *This* kind of porting is really boring, takes a lot of time and patience, and, do anyone plays those shit?! Oh, well, really, people that got hurt with creation of this cheater *still* play those versions... ============================ VI. Bugs/Inconveniences ============================ Oh shit, *lots* of them!!! * Auto-Aim works really bad on laggy connections. * You can't disable "WEAPON MODE". * Framecounters will overflow (which will cause a small malfunction). after some months (years?) of uninterrupted playing. A bit overkill, isn't it? * When loader is loaded (huh), it uses twice a necessary memory and is twice slow. Well, it just keeps compatibility :( * Loader works extremely bad on pure raw DOS (*not* a DOS prompt!). * I mean, it doesn't even works: it uses external DPMI host (better than original DOS4GW, of course ;) * Weapon Holder is very primitive, has no own priority config. * Auto-Jetpack works bad on small heights. Well, who cares, it certainly will not kill you! * Auto-Jetpack also doesn't detects any sprite, so if you fall over any bridge it will *not* stop you! Beware! * Auto-Jetpack activation boolean expression has 'bout 12 lines and has many non-supported situations. For example: I dunno what *exactly* happens when you use Auto-Jetpack and it consumes all the fuel. And the same in many other situations... ============================ VII. History ============================ * 1.0 Mar 02 2001 - First release * 1.1 Mar 09 2001 - Auto-Kick added - Bugfix: added mouse button mappings: o Quick_Kick o Next_Weapon o Previous_Weapon (Original controller headers hasn't these functions. Why?! Seems to be a little typo by 3D Realms) - Little doc updates: o History section added o New FAQ delirations (Q/A?!) 'bout Duke3D 1.666 biography, The Wall & life philosophy... o Other little fixes - Little internal code reorganizations * 1.1a Mar 10 2001 - Bugfix: Auto-Aim doesn't ignores frozen players - Bugfix: Weapon Holder how handles Expander correctly - Bugfix: fixed a little conflict between Quick and Normal kicks in AutoKick - Checked doc & config file for typos and spelling errors. Note that this still not saves you from my horrific grammar >:E (fuck, I hate M$ Word too, please sorry, next time I'll use ispell) - Updated "player" struct and fixed a little typo in it * 1.2 Mar 13 2001 - Auto-Jetpack added - Macrified some button controls - Bugfix: removed macros, Borland C doesn't handles them correctly >:E * 1.3 Mar 14 2001 - Bugfix: Auto-Aim doesn't aim through walls anymore! Note that you still can "enable" this bug by editing DUKE3D.666 * 1.3a Mar 19 2001 - Bugfix: mouse aiming was blocked when you fire (this turned into bug when Auto-Kick feature was added, 'cos Auto-Kick code was put into Auto-Aim code and some of "useless" Auto-Aim properties was herded ;) - Tiny doc updates, of course * 1.3b Mar 31 2001 - Bugfix: no more auto-aim when you activate pipebomb (those sucked a bit after you drop pipebomb behind your opponent and prepare to run: when you explode it, you turn around and face your death ;) - Bugfix: Weapon Holder didn't handled pipebomb activator properly - New FAQ-off question/answer added - Dammit, I had to change my primary site to: http://sysdlabs.hypermart.net (oh, how I wish to kick ass of those who made this change possible >:E ) ============================ VIII. Developer Info ============================ Don't panic, I'll write it tomorrow. Anyway, do you really need that? Oh, sucks, here I am again... Back to work! So, how does Duke3D v1.666 work? It's just a set of patches to original DUKE3D.EXE. The most simple patch just changes constant value (Holoduke's sprite). The most complex adds my bi-directional communication code to Duke's External Controller API. I think that this last requires a bit more attention. The code is added by re-building DUKE3D.EXE and appending code itself. DUKE3D.EXE has WATCOM/LE format, the only way I found to rebuild it was learn this format and make a kind of stupid relinker, that can be applied only to DUKE3D.EXE specific executable. I never tried to use it on other executables, I think it will not work. So, don't ask it to me, just learn that format by yourself and make any relinker that follows LE specifications, and *not* DUKE3D.EXE/LE ones as mine. So, and what do this "complex" patch does? Heheh, this is a funny part: I put there a subroutine that extends controller functionality, and made it be called internally from controller API. As you *may* know (if you're really interested in this shit I made, you need to know that), original controller API works with ExternalControlInfo structure that follows: typedef struct { word id; word intnum; int32 axes[MAXEXTERNALAXES]; uint32 buttonstate; byte buttonmap[MAXEXTERNALBUTTONS][2]; byte analogaxesmap[MAXEXTERNALAXES]; word command; byte digitalaxesmap[MAXEXTERNALAXES][2]; } ExternalControlInfo; The extension is: typedef struct { word id; word intnum; int32 axes[MAXEXTERNALAXES]; uint32 buttonstate; byte buttonmap[MAXEXTERNALBUTTONS][2]; byte analogaxesmap[MAXEXTERNALAXES]; word command; byte digitalaxesmap[MAXEXTERNALAXES][2]; // and here comes our extended data >:) byte nplayers; player duke[8]; int32 floorz; byte canseeplayer[7]; byte weaponmode; word shots; } ExternalControlInfo; As you see, it has some *VERY* interesting things 'bout current game. And, it's a bit larger than original structure. So, if you ran this kind of controller (that I humbly call ECTL - Extended Controller), it will overwrite some data/code and probably will hang. So, I changed control.id to 0xc0de, now incompatible controller knows about it's incompatibility. But, the really interesting thing is "player duke[8]". This is an internal structure used by Duke3D, and contains ALL information about player. The only problem is that it's quite hard to map that structure. All I know 'bout it at now is: player.h -- CUT HERE -- #ifndef _player_public_ #define _player_public_ typedef struct { int32 x; int32 y; int32 z; int32 va; int32 va0; byte _unknown01[0x008]; int32 x0; int32 y0; int32 x1; int32 y1; int32 z0; byte _unknown02[0x010]; int32 zv; byte _unknown03[0x022]; int16 sectl; byte _unknown04[0x008]; int16 ang; int16 ang0; byte _unknown05[0x002]; int16 sector; byte _unknown06[0x002]; int16 health; byte _unknown07[0x002]; int16 ammo[11]; int16 am; int16 when_dead; int16 killed; int16 died; int16 current_weapon; byte _unknown08[0x008]; int16 holoduke; byte _unknown09[0x01c]; int16 medkit; byte _unknown0A[0x018]; int16 nightvision; byte _unknown0B[0x032]; int16 jetpack; byte _unknown0C[0x002]; int16 armor; byte _unknown0D[0x004]; int16 weapon_raise; byte _unknown0E[0x002]; int16 thold; int16 lfw; byte _unknown0F[0x00e]; byte og; byte _unknown10[0x020]; byte current_item; byte _unknown11[0x001]; byte jetpack_active; byte _unknown12[0x007]; byte have_weapon[11]; byte _unknown13[0x227]; } player; // sizeof(player) == 0x38f #endif -- CUT HERE -- (Not a very self-explanatory names, neither values... Please contact me if you're interested and I'll send you the most recent *commented* headers!) Too many "_unknownXX"'s, huh? Well, specially to treat that I created a Dumper option (see DUKE3D.666). When it's on and you take a screenshot, "player duke[8]" is dumped to file. Yeah, it's vector with 8 entries, each of them presents a data of player with those number. Of course, many info is out of that struct, but it is enough to make cool things, I think ;) So, what is made to transform those "_unknownXX"'s in more interesting things? You may lock at some feature (underwater flag, for example). Stay on ground. Dump Duke state. Now, jump in the water and submerge. Dump again. What now?! In the worst case, go to DOS and type: FC /B DUKE0000.DMP DUKE0001.DMP And go on seeking what changed. And what to do when found?! Update "player.h", of course! How? Here comes a Perl script, I expect you'll understand how to use it. You may re-edit %player hash to insert new offsets. After done, it will convert binary offsets in C struct. Go on: player_struct.pl -- CUT HERE -- #!/usr/bin/perl @byte = qw(byte 1); %sizeof = ( '' => 0, $byte[0]=> $byte[1], int16 => 2, int32 => 4, ); $size = 0x38f; %player = ( 0x000 => [qw(int32 x)], 0x004 => [qw(int32 y)], 0x008 => [qw(int32 z)], 0x00c => [qw(int32 va)], 0x010 => [qw(int32 va0)], 0x01c => [qw(int32 x0)], 0x020 => [qw(int32 y0)], 0x024 => [qw(int32 x1)], 0x028 => [qw(int32 y1)], 0x02c => [qw(int32 z0)], 0x040 => [qw(int32 zv)], 0x066 => [qw(int16 sectl)], 0x070 => [qw(int16 ang)], 0x072 => [qw(int16 ang0)], 0x076 => [qw(int16 sector)], 0x07a => [qw(int16 health)], 0x07e => [qw(int16 ammo[11])], 0x094 => [qw(int16 am)], 0x096 => [qw(int16 when_dead)], 0x098 => [qw(int16 killed)], 0x09a => [qw(int16 died)], 0x09c => [qw(int16 current_weapon)], 0x0a6 => [qw(int16 holoduke)], 0x0c4 => [qw(int16 medkit)], 0x0de => [qw(int16 nightvision)], 0x112 => [qw(int16 jetpack)], 0x116 => [qw(int16 armor)], 0x11c => [qw(int16 weapon_raise)], 0x120 => [qw(int16 thold)], 0x122 => [qw(int16 lfw)], 0x132 => [qw(byte og)], 0x153 => [qw(byte current_item)], 0x155 => [qw(bytw jetpack_active)], 0x15d => [qw(byte have_weapon[11])], ); @player = sort {$a<=>$b} keys %player; push @player, $size; for ($i = 0; $i < @player - 1; $i++) { $offs = $player[$i]; $sizeof = &sizeof ($player {$offs}); $next = $offs + $sizeof; if ($unknown = $player[$i+1] - $next) { die sprintf "data overlapping for offset 0x%x (sizeof = 0x%x) with 0x%x\n", $player[$i], $sizeof, $player[$i+1] if $unknown < 0; $player {$next} = ["\t\tbyte", sprintf ('_unknown%02X[0x%03x]', ++$unknown_n, $unknown)]; } } open STRUCT, '>player.h' || die "can't open output file: $!"; print STRUCT "#ifndef _player_public_\n", "#define _player_public_\n\n", "typedef struct\n", "{\n"; foreach (sort {$a<=>$b} keys %player) { @var = @{$player {$_}}; printf STRUCT "\t%s\t%s;\n", @var; } print STRUCT "} player;\n\n"; printf STRUCT "// sizeof(player) == 0x%x\n\n". "#endif\n", $size; close STRUCT; exit; sub sizeof { $data = shift; return $sizeof {${$data} [0]} * (${$data} [1] =~ /\[(\d+?)\]$/ ? $1 : 1); } -- CUT HERE -- So, why am I writing all that trash? I DON'T KNOW, BUT, IF ANYONE ASKED FOR INFO WRITEN HERE, I'LL HAVE A GOOD REASON TO NOT ANSWER!!! Eheheheh, just a joke! I thing that people who interest in v1.666 and wish to create something good for it may learn how does that fuck works at first. Oh, really, do you want to do any cool config tool for Duke3D v1.666? =D ============================ IX. (Don't) Contact Me! ============================ What the... I said DON'T!!! Just a joke, really, I interest on what you think 'bout it so I could do my beast (hohohoh). So, here comes: * Author (yeah, that's me!): Stanislaw Y. Pusep (a.k.a. Stas) * My Homepage: http://sysdlabs.hypermart.net * Duke3D v1.666: http://sysdlabs.hypermart.net/duke3d/1.666 (get latest version/info 'bout it there) * My current email: stas@grad.icmc.sc.usp.br * If failed: stas@sysd.org