Re: [hlcoders] GoldSrc VGUI2 headers / libs (Screen overlays)
You can get access to the GoldSrc VGUI2 interfaces by exporting a function named ClientFactory from your client.dll - this function should return a CreateInterfaceFn function pointer that can return a pointer to a class implementing the interface VClientVGUI001. The functions in this interface are passed pointers to the VGUI2, Steam filesystem, hw/sw engine and GameUI DLL factories. I have some notes on this interface (and several others available through it) available at http://www.goldsrc.com/dokuwiki/start?idx=interfaces Hope this helps. -- Philip Dominik Tugend wrote: Hello, thank you for your reply. well hm, that is sad. Anways, I'll try interfacing it directly then using the the dll's CreateInterfaceFn. Luckily there are a few headers for some of the older interface versions that are used in GoldSrc's vgui2.dll included in the SourceSDK :] With kind regards Dominik Tugend - Original Message - From: "Tony "omega" Sergi" <[EMAIL PROTECTED]> To: Sent: Monday, July 02, 2007 9:18 AM Subject: Re: [hlcoders] GoldSrc VGUI2 headers / libs (Screen overlays) -- [ Picked text/plain from multipart/alternative ] Nope. Vgui2 is only available in goldsrc where the GameUI is concerned. the actual engine only uses the original vgui. Sorry ___ To unsubscribe, edit your list preferences, or view the list archives, please visit: http://list.valvesoftware.com/mailman/listinfo/hlcoders
Re: [hlcoders] Adding a new skill level and Steam
Something like Natural-Selection's trigger_script entity. It doesn't do anything at the moment, but this: http://homepage.ntlworld.com/pr.searle/nsfaq/#11 suggests that the script engine is there... it just needs tieing to the entity. I really hope it gets implemented soon. K. Mike Bradley wrote: Well Of course the AI could always use improvement. It was ground breaking in 1999 ... But now? I would like to see a feature to add compilable script ent's in the Game Def file. What about a mod with a script compiler. A mod to end all mods so to speak. Then a new map "Script" entity could be added. I'd love to see more power put in the hands of mappers w/o having to make a new mod. Then the Map is the mod. Kuel! ___ To unsubscribe, edit your list preferences, or view the list archives, please visit: http://list.valvesoftware.com/mailman/listinfo/hlcoders
[hlcoders] Detail textures
In this thread: http://www.natural-selection.org/forums/index.php?showtopic=62384 on the ns.org forums, the possibilty of using detail textures in Half-Life was brought up. Screenshots of CS:CZ appear to show detail textures, and the existence of the cvars r_detailtextures and r_detailtexturesupported suggest that this was added in a recent HL engine update. Looking through RetailInstalledFiles.txt in half-life.gcf I found a list of all the files included in CS:CZ. There are a lot of files with names like "gfx/detail/dt_texturename.tga", and a "mapname_detail.txt" for each bsp file. Setting the cvar r_detailtextures to 1 in HLDM gives the message "Loading detail textures..." followed by "Couldn't open maps/mapname_detail.txt". Does anyone know if it's possible to use these detail textures in standard HL mods? And could anyone from Valve give us a hint as to the format of the .txt files? I've gathered it's some kind of texturename -> detail texture mapping, but the obvious formats don't appear to work. -- Philip Searle ___ To unsubscribe, edit your list preferences, or view the list archives, please visit: http://list.valvesoftware.com/mailman/listinfo/hlcoders
[hlcoders] Client-side BSP models
I've been looking through the code in entity.cpp (client dll), and playing around with HUD_CreateEntities() and CL_TentEntAllocCustom(). I've been able to create client-side models and sprites, but is there any way to use these functions to make a client-side BSP model? Something like func_illusionary, but without a server entity. It seems to me that this would be a very useful thing for entity-heavy mods like Natural-Selection. I tried setting the client-entities model to "*51" (which I know exists - it's a func_door), but it doesn't seem to work. I inserted trace statements to ensure the entity was being created, and it seems that it is deleted after a single frame. Has anyone else managed to get client-side BSP models working, or are they not possible? ___ To unsubscribe, edit your list preferences, or view the list archives, please visit: http://list.valvesoftware.com/mailman/listinfo/hlcoders
Re: [hlcoders] Client-side BSP models
I'm recreating the entity every frame (actually every second with p->die set to the current time plus 1). If I use a model like "models/apache.mdl", then the entitiy shows up fine. I can even get it to animate by using the callback function. It seems that CL_LoadModel() only loads .mdl and .spr models, not BSP models ("*51"). I though DoD had client-side func_illusinary, but looking at the documentation on the web it seems not. I guess what I'm asking is: is it even possible to use BSP models in client-side entities, or can I only use .mdl/.spr? jc wrote: off the top of my head and probably wrong anything created in HUD_CreateEntities has to be created every frame... HUD_CreateEntities is basically how you add something to the render list :s jc ___ To unsubscribe, edit your list preferences, or view the list archives, please visit: http://list.valvesoftware.com/mailman/listinfo/hlcoders
Re: [hlcoders] TeamScore and nsp (natural selection)
I believe NS uses the individual player scores to work out the team score client-side. The message for player scores is ScoreInfo, and its format is: Byte - The index of the player. Short - The player's score. Short - The player's kills Short - The player's deaths. Byte - The player's class. Short - The player's auth status. A bitmask. Short - The team the player is on. Taken from http://homepage.ntlworld.com/pr.searle/nsnet/ Brian A. Stumm wrote: It appears that TeamScore is not used in nsp (natural selection) mod. Anyone know what to look at to get the team scores? I've got a huge dump of pfnMessageBegin pfnWriteString pfnWriteByte etc but see nothing that looks like it might be team score related. CS, DoD and TFC all use TeamScore. DoD is slightly diff than CS and TFC but you at least know where to look... ___ To unsubscribe, edit your list preferences, or view the list archives, please visit: http://list.valvesoftware.com/mailman/listinfo/hlcoders
[hlcoders] Studio model format (version 9)
Looking through half-life.gcf, I came across a file called doctor.mdl. It seems to have been introduced during the transition from WON to Steam, as I can't find it in any .pak files. This file can't be opened by any model viewers and crashes Half-Life. It appears doctor.mdl is a version 9 model file (Half-Life uses version 10 for all other models). Does anybody at Valve know why this file was added? It isn't used by anything I know of, although it is precached by "Half-life singleplayer.lst" and "Half-life multiplayer.lst". From what I can see, the file format is very similar to the existing version 10 format. The studiohdr_t structure is very similar - the only changes are the version number (9, not 10) and the two entries at the end relating to the transition graph are absent. The mstudiobone_t structure is a little different - the root bone name is stored (24 bytes), and each bone has the following structure: typedef struct { intunknown[2]; // Always seem to be zero intparent; intflags; intbonecontroller[6]; float value[6]; float scale[6]; } mstudiobone_t; The mstudioseqdesc_t strucutre has some changes, too - I'm not sure whether I have this one right as my modified modelviewer won't display animations correctly. It looks like one of automoveposindex or automoveangleindex is missing (not sure which one), the bboxmin and bboxmax are absent, the blendtype[2] member is missing, as are the three transition graph entries and the nextseq member. I was unable to verify the structure of studioseqhdr_t, mstudiobonecontroller_t, mstudioevent_t, mstudiopivot_t and mstudioattachment_t as they aren't used in doctor.mdl. All other structures appear to be identical to version 10. In case anyone was wondering exactly what the model looks like, it's the "Ivan the Space Biker" model of Gordon Freeman (referenced by Ken Birdwell at http://www.gamasutra.com/features/19991210/birdwell_pfv.htm), holding a gun. He has animations for walking, running and shooting, but I can't view them yet. If anyone has any extra info (particularly regarding the mstudioseqdesc_t structure), feel free to share :) -- Philip Searle ___ To unsubscribe, edit your list preferences, or view the list archives, please visit: http://list.valvesoftware.com/mailman/listinfo/hlcoders
Re: [hlcoders] Studio model format (version 9)
Marco Leise wrote: What the...? Why bother with an ancient model format that did not even have transition graphs? On the other hand the tentacle is the only real version 10 model using them. You said yourself it is a version 9 model and Half-Life can no longer display it. It must have got in there by accident from an old Half-Life backup. Tell me one good reason why writing a modified model viewer was not a waste of time? I suppose your right - there's no way this will ever be useful. I just thought it would be interesting to see how much the format had changed. The model viewer itself took very little time - the hardest part was figuring out why the animations weren't showing. It turns out they're just very subtle - the only two that actually move are "shoot" and "runshoot", which make the model's fingers move. [Sorry, just felt like beeing a bit offending. I'm doing a lot of more or less useless stuff too, when I have the time. At least one learns something new from it. :)] Marco Leise No offense taken - "why would you do this?" is a reasonable question. The only real answer I have is "because I wanted to". :) -- Philip Searle ___ To unsubscribe, edit your list preferences, or view the list archives, please visit: http://list.valvesoftware.com/mailman/listinfo/hlcoders
Re: [hlcoders] Resizing Models
Jeffrey "botman" Broome wrote: Adam "amckern" Mckern wrote: i only think u can resize the bounding box, but some one that might know more, might answer this better for you Actually, the hit boxes DON'T get rescaled at run-time... http://articles.thewavelength.net/232/ (doesn't ANYBODY use google.com to search for stuff anymore?) -- Jeffrey "botman" Broome That's true if you only do the scaling on the client studiomodelrenderer. If you also implement the same scaling in the server blending interface, then you can scale hitboxes and have them work correctly, although there's still the problem of hitboxes outside the entity bounding box not being hit by tracelines (Natural-Selection fixed this, although I'm not sure how). ___ To unsubscribe, edit your list preferences, or view the list archives, please visit: http://list.valvesoftware.com/mailman/listinfo/hlcoders
Re: [hlcoders] Resizing Models
Marco Leise wrote: Am Sat, 18 Sep 2004 23:51:53 +0100 schrieb Philip Searle <[EMAIL PROTECTED]>: That's true if you only do the scaling on the client studiomodelrenderer. If you also implement the same scaling in the server blending interface, then you can scale hitboxes and have them work correctly, although there's still the problem of hitboxes outside the entity bounding box not being hit by tracelines (Natural-Selection fixed this, although I'm not sure how). And the entity bounding box is hard coded where and why? You're right - the positions of the hitboxes would scale, but the sizes wouldn't. I seem to have been answering the wrong question here; sorry about that. ___ To unsubscribe, edit your list preferences, or view the list archives, please visit: http://list.valvesoftware.com/mailman/listinfo/hlcoders
Re: [hlcoders] What MSVC version do you use/have?
Still using VC6, although I do have access to the academic version of VC.Net. Alfred Reynolds wrote: I just want to do a quick straw poll of how many people on this list DON'T have access to MSVC.NET or above for their MOD development (we hope to only release MSVC.NET project files with the SDK)? - Alfred ___ To unsubscribe, edit your list preferences, or view the list archives, please visit: http://list.valvesoftware.com/mailman/listinfo/hlcoders
[hlcoders] Some general questions and some undocumented functions
Hey folks, Recently I've been looking through hw.dll (just for fun) and managed to work up a long list of questions - if anyone (perhaps even a Valve member?) could provide some answers I would be very grateful. Apologies for the length of this post. General Questions = Why does the decal code handle decals with the name "}z_" specially? I can't quite understand what the code does (floating-point assembly isn't my strong point). What determines the colour of text in the new VGUI console? As far as I can tell, there's no way for it to determine whether the engine or the game DLL is printing to it yet it variously prints in white or brown. Regarding the server blending API (SV_StudioSetupBones), why is the passed in edict_t pointer sometimes NULL? Surely the server always has all the required data for entities? Now that player movement is all handled by the client/game DLLs, why would the engine ever need to find out the texture the player is standing on (HUD_PlayerMoveTexture)? Or is this an obsolete function now? Whatever happend to VGUI::GLSurface? The header is there but it's mostly unimplemented. Is it possible to create your own surface and have VGUI panels in-game (i.e. like doom3 guis). Undocumented Functions == Poking around I found quite a few functions exposed to the game DLLs that aren't documented - they're tacked onto the end of existing interface structures. Some I've managed to figure out, but many are still a mystery. If anyone knows more (or has the header files - hint hint Valve ;) ) please let me know. Any function names are taken either from string literals found in hw.dll or are best guesses based on their effects. SV_SaveGameComment -- Stick this in your server DLL and you can control what goes in the description field of saved games (appears in the load dialog): extern "C" void __declspec(dllexport) SV_SaveGameComment(char *buffer, int max_length) { strcpy( buffer, "Hello, world!" ); } HUD_ChatInputPosition - I think the engine trys to call this from the client DLL, but what its prototype is and what values it shoudl return I don't know. - Extra function in pEfxAPI structure, immediately after R_DecalRemoveAll: /* Prototype and function unknown - seems to have something to do with decals */ void (*UnknownFunction1)(); - Extra functions in pTriAPI structure, immediately after fog function: /* Prototype and function unknown */ void (*UnknownFunction1)(); /* Prototype and function unknown (passthrough to glGetFloatv?) */ void (*UnknownFunction2)(); /* Prototype and function unknown */ void (*UnknownFunction3)(); /* Prototype and function unknown */ void (*UnknownFunction4)(); /* Prototype and function unknown (passthrough to glColor4f?) */ void UnknownFunction5(); /* Prototype and function unknown (something to do with fog?) */ void (*UnknownFunction6)(); - Extra function in pVoiceTweakAPI struct, immediately after GetControlFloat: /* Prototype and function unknown */ void (*UnknownFunction1)(); - Extra functions in client engine interface, immediately after pfnSetMouseEnable: /* Returns pointer to start of registered cvar linked list. Added for VGUI console autocomplete? */ cvar_t* (*pfnGetCvarList)( void ); /* Returns pointer to start of registered command linked list. Added for VGUI console autocomplete? typedef struct cmd_function_s { struct cmd_function_s *next; const char *name; xcommand_t function; const char *description; qbooleanpure; } cmd_function_t; */ cmd_function_t* (*pfnGetCmdList)( void ); /* Not sure about this - convert cvar_t pointer to cvar name? Why? */ char* (pfnCvarNameFromPointer)( cvar_t* pointer ); /* Not sure abput this - convert cmd_function_t pointer to command name? Why? */ char* (*pfnCmdNameFromPointer)( cmd_function_t* pointer ); /* Returns current time for this client? Why is this needed when GetClientTime() already exists? */ float (*pfnGetCurrentTime)( void ); /* Unsure - always seems to return 800.0f (no, it's not horizontal resolution) */ float (*pfnGetUnknownFloat)( void ); /* Appears to be identical to function in IEngineStudio */ struct model_s* (*pfnGetModelByIndex)( int index ); /* Appears to modifies hidden cvar gl_texsort. Value of 0 disables it, other values enable it. Effect is a very bright (but not fullbright) screen. Who uses gl_texsort these days? */ void (*pfnSetGL_TexSort)( int value ); /* Colour scaling values for screen. Only works when gl_texsort is active. Defaults to white (1.0 1.0 1.0) */ void (pfnSetGL_TexSort_Colour)( float red, float green, float blue ); /* Final scaling factor for screen. Only works when gl_texsort is active. Defaults to 1.0 */ void (*pfnSetGL_TexSort_Scale)( float scale ); /* Seems to be a client entry point to the pfnSequenceGet function introduced for CS:CZ (see post "Engine interface changes" by
Re: [hlcoders] Some general questions and some undocumented functions
tei wrote: Philip Searle wrote: Why does the decal code handle decals with the name "}z_" specially? I can't quite understand what the code does (floating-point assembly isn't my strong point). ??? maybe: texture are already mangled because encode stuff (special atributes) name[0] = type, "z_" can be a substring that trigger something Possibly, but there's some code nearby that changes {blood decals to {yblood when content control is switched on so I think it's operating with raw decal names. Perhaps I'll try creating a decal called }z_ and see what it looks like in-game... /* Starts a local sound - why is this needed? */ void (*pfnStartDynamicSound)( char *filename, float volume, float pitch ); ??? Menus? Music? "radar"? "sniper scope effect"? banned player triing to logon? Its this server or client? This particular function is client-side. Good thinking on the meus; with the new launcher hooking into other parts of the engine, perhaps they use this for the button sounds? I'll try hooking it and seeing when it's called. ___ To unsubscribe, edit your list preferences, or view the list archives, please visit: http://list.valvesoftware.com/mailman/listinfo/hlcoders
Re: [hlcoders] Some general questions and some undocumented functions
Michael Shimmins wrote: What determines the colour of text in the new VGUI console? As far as I can tell, there's no way for it to determine whether the engine or the game DLL is printing to it yet it variously prints in white or brown. The Scheme Text files from memory determine the colour of things. If not then its generally stomped/hard coded in VGUI_TeamFortressViewPort.cpp/.h (my memory is starting to get a bit stretched here). I think I phrased my question wrong here - I know how the colours are chosen, but what makes the console display "Base networking initialized" in white while "Creating fake network channel" is displayed in brown? At first I thought it was decided based on whether the client or server had requested the message be displayed, but some client strings (GL_VENDOR, etc.) are white while others are brown ("joystick not found"). It's the same with the server messages - what's different between the messages "'sv_cheats' changed to '1'" and "'sv_aim' changed to '0.0'" that warrants the change in colour? ___ To unsubscribe, edit your list preferences, or view the list archives, please visit: http://list.valvesoftware.com/mailman/listinfo/hlcoders
Re: [hlcoders] message of bogus type
Your message name is longer than 11 characters. Because of the way user mesages are stored in the engine, message names are limited to 11 chars plus the nul terminator. If you try to create a message longer than that, then you'll trash the next usermessage or message handler pointers. -- Philip Searle Draco wrote: For 2 days I've been playing around with a message system to replace the death message and gun/ammo pickup messages in my mod. I think I got it set up, with messages queuing to be displayed and such, but one problem has arisen... The game crashes when I make a message for it. I mean the server-client messages. I have dealt with this system twice before for radar and a timer but this one defies me. I have the message registered gmsgPerfectDarkMessage = REG_USER_MSG("PerfectDarkMessage", -1); i have an extern of it in the gamerules so I can call it there, i have it declared as a global int in player.cpp I have everything my old messages have. Then I go to trigger the message. 3 messages so I can test the queuing out MESSAGE_BEGIN(MSG_ALL, gmsgPerfectDarkMessage); WRITE_STRING("Dont fly strongbad"); MESSAGE_END(); MESSAGE_BEGIN(MSG_ALL, gmsgPerfectDarkMessage); WRITE_STRING("I worry about you"); MESSAGE_END(); MESSAGE_BEGIN(MSG_ALL, gmsgPerfectDarkMessage); WRITE_STRING("i can see the strings"); MESSAGE_END(); It then, because it cares, tells me "fatal eror" "tried to create a message with bogus message type (0)" Yeah, thanks HL, I Wubb J00 too. This only occures when i fire off a message, because i tired commenting the 'dont fly strongbad' stuff. So, any ideas on why I am createing a message with a bogus message type? -- ** Draco Coder for Perfect Dark http://perfectdark.game-mod.net ___ To unsubscribe, edit your list preferences, or view the list archives, please visit: http://list.valvesoftware.com/mailman/listinfo/hlcoders
Re: [hlcoders] Help with HL1 SPR file format
Rodrigo 'r2d2rigo' Diaz wrote: Hi, I want to load a SPR file to use it as a texture in one OpenGL program. I have based my code from the one in sprgen.c. For testing, I'm using a single frame 256*256 sprite, and I follow this order for reading the data: -1 struct dsprite_t (sprite header) -1 short (# of palette indexes - 256) -256 bytes (colours of the palette indexes) -1 struct spriteframetype_t (frame type - single or multiple) -1 struct dspriteframe_t (sprite frame header) -dspriteframe_t->height*dspriteframe_t->width bytes (height*width bytes - sprite frame data) And then I create the texture with glTexImage2D. The problem is the final texture gets messy; did I miss something? Is there any documentation about SPR file format? I'm not sure whether this was a typo, but the palette is actually 256*3 bytes (red, green and blue). ___ To unsubscribe, edit your list preferences, or view the list archives, please visit: http://list.valvesoftware.com/mailman/listinfo/hlcoders
Re: [hlcoders] Source .dem specifications
Andrew Hammett wrote: I saw a reference a long time ago that VALVE would be publishing the specifications of the .dem file format for the Source engine at some point. Does anybody here know anything about it? Andrew Hammett www.caleague.com The latest SDK has the file format in public/demofile/demoformat.h - it covers the high-level message format but doesn't go into too much detail for things like entity updates and stuff. ___ To unsubscribe, edit your list preferences, or view the list archives, please visit: http://list.valvesoftware.com/mailman/listinfo/hlcoders
Re: [hlcoders] HL1 demo format
The HL1 demo format is essentially an unencrypted dump of the network stream recieved by the recording machine. As far as I know, Valve have never officially documented it. This page: http://machinima.com/opendemo/od-misc.html has some perl scripts that can decode some of the message types, although I don't know how well the code relates to the current demo spec. Shawn R Smith wrote: i know this is kind of odd to be asking about amidst all of these HL2 related programming questions, but is there any sort of documentation / source code for reading and parsing HL1 demo files out there anywhere? Discover Yahoo! Find restaurants, movies, travel and more fun for the weekend. Check it out! http://discover.yahoo.com/weekend.html ___ To unsubscribe, edit your list preferences, or view the list archives, please visit: http://list.valvesoftware.com/mailman/listinfo/hlcoders
Re: [hlcoders] HL1 timerefresh
If you're OK with heading into undocumented territory, then you can disable pretty much any cvar or console command, even ones the engine has installed. There's a whole load of function pointers that have been added to the end of various interfaces in the Half-Life 1 engine (I posted on this list asking about them a while back). cl_enginefunc_t contains two that will return the start of the cvar and console command linked lists. Just walk the list until you find the timerefresh command and replace it's function pointer with your own. I've uploaded a copy of the updated structures at http://homepage.ntlworld.com/pr.searle/testns/cdll_int.h If anyone can throw any light on the functions marked 'unknown', I'd be grateful too :) Disclaimer: Don't forget that all these extra functions are undocumented by Valve and could disappear or fail to work without warning. -- Philip Searle Jorge Rodriguez wrote: TS has this problem where the timerefresh command can cause you to do like, eight stunts in a row. The command doesn't seem to be a problem with most Valve mods, the most I can remember as far as exploits go is that it lets people concjump really high in TFC if you do it right. Basically, this is not good. It is an carmackian engine function which was intended for benchmarking, but I don't think anybody uses it anymore. Can Valve look into disabling or allowing modders to disable this command? -- Jorge "Vino" Rodriguez ___ To unsubscribe, edit your list preferences, or view the list archives, please visit: http://list.valvesoftware.com/mailman/listinfo/hlcoders