Forum posts

Posted 6 months ago2023-10-26 01:57:58 UTC
in issues with making security guards shut up (goldsrc) Post #347973
Barneys have the attributes UseSentence and UnUseSentence which can be used to specify what they say when asked to follow/stop following the player. So setting UseSentence to !BA_MAD0 results in a barney that says "step off, buddy" when asked to follow. (He will still follow anyway, you need to override his AI with a scripted_sequence.)
If you want him to say nothing at all, you could create a new sentence in a custom sentences.txt that makes him "say" a .wav with only silence in it.
Note: avoid editing the sentences.txt in the ../Half-Life/valve/sound folder directly, as those are the sentences used in the main game. You'll need to distribute the custom sentences.txt with your content, in your_mod/sound if it's a mod, or valve_addon/sound if it's an addon pack.
Posted 6 months ago2023-10-23 07:45:00 UTC
in Problem using -nowadtextures Post #347971
Oh right, mixed up nowadtextures and wadinclude, my mistake.

Still, the main issue was CSG being run twice, the second time without the command, so it was the latter that counted for the rest of the compilation.
Gag stops an NPC's idle chatter, but not responses to being used unfortunately. One thing you could try is giving the "piss off" scripted_sentence a VERY long Sentence Time value.
monster_urby monster_urbyGoldsourcerer
Posted 6 months ago2023-10-22 07:26:54 UTC
in Problem using -nowadtextures Post #347969
Usually .wad files are placed in the mod folder, not in the maps folder, so for example you would place it in the cstrike folder, where cstrike.wad is. You can find information about all the commands here: http://zhlt.info/command-reference.html

You can also often find information about the commands of a tool, in this case hlcsg.exe, by just running it in a command prompt, so you would search for cmd.exe in Windows, drag and drop hlcsg.exe onto it, and you will see some basic information about it. In this case, it says this:

-nowadtextures : include all used textures into bsp
-wadinclude file : place textures used from wad specified into bsp

So -nowadtextures does not need a path specified, it will embed all the textures you used, even those from cstrike.wad. -wadinclude is different, it only embeds used textures from a specific .wad file. If your .wad file is located in the cstrike folder and is called mytextures.wad, you type it after -wadinclude without the .wad extension, like this: -wadinclude mytextures

A batch file is a text file that contains a list of commands, which is why it's called a batch file. It is also known as a script, or just a program. The compilation interface in your map editor is just a graphical way of running the multiple compilation tools in a specific order, with specific arguments, like -wadinclude, or the name of your map source file. You could do the same by making a batch file.
Posted 6 months ago2023-10-21 20:52:57 UTC
in Problem using -nowadtextures Post #347968
After that just add the name of the wad after the argument. The entire command should look like
$csg_exe "$bspdir/$file" -nowadtextures de_heights
Posted 6 months ago2023-10-21 20:50:00 UTC
in Problem using -nowadtextures Post #347967
You're running CSG twice. Remove the first command from the list and add -nowadtextures to the second occurrence of CSG, like so:
User posted image
Posted 6 months ago2023-10-21 18:41:53 UTC
in Problem using -nowadtextures Post #347966
User posted image
`Using mapfile wad configuration
Wadfiles not in use by the map will be excluded
Wadinclude list :
[zhlt.wad]

CreateBrush:
(0.02 seconds)
CSGBrush:
(0.12 seconds)

Including Wadfile: \Users\mikol\Downloads\vulzacn\tools\zhlt.wad
- Contains 2 used textures, 5.00 percent of map (19 textures in wad)
Using Wadfile: \Program Files (x86)\Steam\steamapps\common\Half-Life\de_heights\de_heights.wad
- Contains 38 used textures, 95.00 percent of map (38 textures in wad)

Wad files required to run the map: "de_heights.wad;"
Texture usage is at 1.31 mb (of 32.00 mb MAX)
0.24 seconds elapsed

----- END hlcsg -----
`

I can't find much info about the command at all, so I'm not sure what exactly I have to type in. I'm using Vluzacn's ZHLT v34 compile tools in J.A.C.K. hammer, and the texture file I'm trying to embed is in the maps folder of my ""mod"" which is just a counter strike map under the name of de_heights. Do I have to add a specific path? I know that the tutorials I've seen about this talked about some mysterious batch file, but I'm not sure what they mean.
so basically i want this really cranky barney to tell the player to piss off once they step into a trigger, but i don't want him to respond to the player afterwards if they try to interact with him. apparently using gag can make him shut up, but he still says his lines even with gag ticked.
(please note i am verrry new to hammer editor so dont get angry if the answer is extremely obvious)
Posted 7 months ago2023-10-15 19:47:01 UTC
in map_name.bsp was not built Post #347964
when i remove the Brush it finally worked my map opened like it was supposed to. Thank you so much. I finally found out what the problem was. Thank you so much for putting time into helping me.
Posted 7 months ago2023-10-15 19:29:06 UTC
in map_name.bsp was not built Post #347963
First red flag is the Program Files directly. This seems to come with a whole bunch of permissions errors when running the compile tool .exes. I personally have my Steam folder in the drive root: D:\Steam\steamapps etc. Prevents windows doing stupid things like this.

The main problem however is all of those brush errors. Some of your brushes appear to have been completely malformed, either by vertex manipulation or some other means. Those coordinates are insanely off the grid. In JACK's top menu, use Map -> Go to Brush Number and search for those Brush #s in the log. Those brushes need to be removed or remake.
monster_urby monster_urbyGoldsourcerer
Posted 7 months ago2023-10-15 17:00:43 UTC
in map_name.bsp was not built Post #347962
** Executing...
** Command: Change Directory
** Parameters: C:\Program Files (x86)\Steam\steamapps\common\Half-Life\valve

** Executing...
** Command: C:\Program Files (x86)\Steam\steamapps\common\Half-Life\mapping\J.A.C.K\halflife\tools\hlcsg_x64.exe
** Parameters: "C:\Program Files (x86)\Steam\steamapps\common\Half-Life\valve\maps\halmp"
hlcsg v3.4 VL34 64-bit (Aug 17 2015)
Zoner's Half-Life Compilation Tools -- Custom Build
Based on code modifications by Sean 'Zoner' Cavanaugh
Based on Valve's version, modified with permission.
Submit detailed bug reports to (vluzacn@163.com)
----- BEGIN hlcsg -----
Command line: "C:\Program Files (x86)\Steam\steamapps\common\Half-Life\mapping\J.A.C.K\halflife\tools\hlcsg_x64.exe" "C:\Program Files (x86)\Steam\steamapps\common\Half-Life\valve\maps\halmp"
Arguments: "C:\Program Files (x86)\Steam\steamapps\common\Half-Life\valve\maps\halmp" -low -wadautodetect
Entering C:\Program Files (x86)\Steam\steamapps\common\Half-Life\valve\maps\halmp.map

Current hlcsg Settings
Name | Setting | Default
---------------------|-----------|-------------------------
threads [ 24 ] [ Varies ]
verbose [ off ] [ off ]
log [ on ] [ on ]
reset logfile [ on ] [ on ]
developer [ 0 ] [ 0 ]
chart [ off ] [ off ]
estimate [ off ] [ off ]
max texture memory [ 33554432 ] [ 33554432 ]
max lighting memory [ 50331648 ] [ 50331648 ]
priority [ Low ] [ Normal ]

noclip [ off ] [ off ]
null texture stripping[ on ] [ on ]
clipnode economy mode [ off ] [ off ]
clip hull type [ simple ] [ simple ]
onlyents [ off ] [ off ]
wadtextures [ on ] [ on ]
skyclip [ on ] [ on ]
hullfile [ None ] [ None ]
wad configuration file[ None ] [ None ]
wad.cfg group name [ None ] [ None ]
nullfile [ None ] [ None ]
nullify trigger [ on ] [ on ]
min surface area [ 0.000 ] [ 0.000 ]
brush union threshold [ 0.000 ] [ 0.000 ]
map scaling [ None ] [ None ]
light name optimize [ on ] [ on ]
convert game_text [ on ] [ on ]

Using mapfile wad configuration
Wadfiles not in use by the map will be excluded
Wadinclude list :
[zhlt.wad]

CreateBrush:
Error: Entity 0, Brush 597: outside world(+/-32767): (-70447,-84667,-49186)-(68418,85182,52693)
Error: Entity 0, Brush 599: outside world(+/-32767): (-78301,-21649,-42558)-(77059,80000,80000)
Error: Entity 0, Brush 601: outside world(+/-32767): (-79407,-30023,-79658)-(80182,26966,79296)
Error: Entity 0, Brush 600: outside world(+/-32767): (-78318,-16434,-42568)-(-1632,16604,80000)
Error: brush outside world
Description: The map has a problem which must be fixed
Howto Fix: Check the file http://www.zhlt.info/common-mapping-problems.html for a detailed explanation of this problem

Error: Entity 0, Brush 601: outside world(+/-32767): (-79407,-30023,-79658)-(80182,26966,79296)
Error: Entity 0, Brush 599: outside world(+/-32767): (-78301,-21649,-42558)-(77059,80000,80000)
Error: Entity 0, Brush 600: outside world(+/-32767): (-78318,-16434,-42568)-(-1632,16604,80000)
Warning: Illegal Brush (edge without opposite face): Entity 0, Brush 601

Error: Entity 0, Brush 597: outside world(+/-32767): (-70447,-84667,-49186)-(68418,85182,52693)
Error: Entity 0, Brush 601: outside world(+/-32767): (-79423,-30039,-79694)-(80198,26982,79332)
Error: Entity 0, Brush 599: outside world(+/-32767): (-78301,-21649,-42558)-(77059,80000,80000)
Warning: Illegal Brush (edge without opposite face): Entity 0, Brush 600

Error: Entity 0, Brush 600: outside world(+/-32767): (-78334,-16450,-42604)-(-1616,16620,80036)
Error: Entity 0, Brush 597: outside world(+/-32767): (-70447,-84667,-49186)-(68418,85182,52693)
Error: Entity 0, Brush 601: outside world(+/-32767): (-79423,-30039,-79694)-(80198,26982,79332)
Error: Entity 0, Brush 600: outside world(+/-32767): (-78334,-16450,-42604)-(-1616,16620,80036)
Warning: Illegal Brush (edge without opposite face): Entity 0, Brush 599

Error: Entity 0, Brush 599: outside world(+/-32767): (-78317,-21665,-42594)-(77075,80016,80036)
Error: Entity 0, Brush 601: outside world(+/-32767): (-79439,-30055,-79690)-(80214,26998,79328)
Error: Entity 0, Brush 600: outside world(+/-32767): (-78350,-16466,-42600)-(-1600,16636,80032)
Warning: Illegal Brush (edge without opposite face): Entity 0, Brush 597

Error: Entity 0, Brush 599: outside world(+/-32767): (-78317,-21665,-42594)-(77075,80016,80036)
Error: Entity 0, Brush 597: outside world(+/-32767): (-70463,-84683,-49222)-(68434,85198,52729)
Error: Entity 0, Brush 600: outside world(+/-32767): (-78350,-16466,-42600)-(-1600,16636,80032)
Error: Entity 0, Brush 601: outside world(+/-32767): (-79439,-30055,-79690)-(80214,26998,79328)
Error: Entity 0, Brush 599: outside world(+/-32767): (-78317,-21665,-42594)-(77075,80016,80036)
Error: Entity 0, Brush 597: outside world(+/-32767): (-70463,-84683,-49222)-(68434,85198,52729)
Error: Entity 0, Brush 601: outside world(+/-32767): (-79423,-30039,-79676)-(80198,26982,79314)
Error: Entity 0, Brush 600: outside world(+/-32767): (-78334,-16450,-42586)-(-1616,16620,80018)
Error: Entity 0, Brush 597: outside world(+/-32767): (-70463,-84683,-49222)-(68434,85198,52729)
Error: Entity 0, Brush 601: outside world(+/-32767): (-79423,-30039,-79676)-(80198,26982,79314)
Error: Entity 0, Brush 600: outside world(+/-32767): (-78334,-16450,-42586)-(-1616,16620,80018)
Error: Entity 0, Brush 599: outside world(+/-32767): (-78333,-21681,-42590)-(77091,80032,80032)
Error: Entity 0, Brush 597: outside world(+/-32767): (-70479,-84699,-49218)-(68450,85214,52725)
Error: Entity 0, Brush 599: outside world(+/-32767): (-78333,-21681,-42590)-(77091,80032,80032)
Error: Entity 0, Brush 597: outside world(+/-32767): (-70479,-84699,-49218)-(68450,85214,52725)
Error: Entity 0, Brush 599: outside world(+/-32767): (-78333,-21681,-42590)-(77091,80032,80032)
Error: Entity 0, Brush 597: outside world(+/-32767): (-70479,-84699,-49218)-(68450,85214,52725)
Error: Entity 0, Brush 599: outside world(+/-32767): (-78317,-21665,-42576)-(77075,80016,80018)
Error: Entity 0, Brush 597: outside world(+/-32767): (-70463,-84683,-49204)-(68434,85198,52711)
Error: Entity 0, Brush 599: outside world(+/-32767): (-78317,-21665,-42576)-(77075,80016,80018)
Error: Entity 0, Brush 597: outside world(+/-32767): (-70463,-84683,-49204)-(68434,85198,52711)
Error: Entity 0, Brush 599: outside world(+/-32767): (-78317,-21665,-42576)-(77075,80016,80018)
Error: Entity 0, Brush 597: outside world(+/-32767): (-70463,-84683,-49204)-(68434,85198,52711)
(0.10 seconds)

----- END hlcsg -----
  • WARNING: File was not built!
"C:\Program Files (x86)\Steam\steamapps\common\Half-Life\valve\maps\halmp.bsp "
Posted 7 months ago2023-10-15 16:35:55 UTC
in jack hammer editor giving valve.wad error Post #347961
You are using a custom wad which is not present in either the cstrike directory or the valve directory. Where is valve.wad?
monster_urby monster_urbyGoldsourcerer
Posted 7 months ago2023-10-15 16:33:35 UTC
in map_name.bsp was not built Post #347960
Your map has not compiled for one reason or another. There are a lot of factors to consider. First things first, post a copy of your compile log.
monster_urby monster_urbyGoldsourcerer
Posted 7 months ago2023-10-15 16:01:18 UTC
in map_name.bsp was not built Post #347959
I have a big problem I’m trying to make some Maps for half life. I just started doing it and I’m very new and when I’m trying to run the game. It just says the BSP file or whatever you call it is not built. how do I fix this please help
Posted 7 months ago2023-10-15 03:17:21 UTC
in jack hammer editor giving valve.wad error Post #347958
COUNTER STRIKE 1.6

I recently started editing with the Jack Hammer editor, after compiling the error in cs continues to give this error, can anyone help me when loading the game

""WARNING: couldn't open valve.wad""

i need help plis
Thanks for your Help. :D

(When I get my High-school diploma I will begin development. I'm in 12th grade so I will begin asking questions on their Discord this Summer)
FortressOne should be standalone. As for getting it to work or modding it, your best option there is to join their Discord server and ask there instead.

For the code there's a link to their GitHub on the website. As for which repo is relevant for modding, again the Discord server should be the place to ask or look around in (they likely have channels and pinned messages for this already).
Wait, do I need to Buy Quake off of Steam to have FortressOne Work? Because I ran it and it's stuck when trying to join a new server
Actually, I will ditch the Half-Life Mod altogether to make a mod of the OpenFortress, as that seems way easier to do. After all, it's what the Original Devs had to work with, and weren't they just everyday people sharing a Quake Mod?

Do you know of any Tutorials on how to mod Quake Fortress? I can't seem to find any links to tutorials.

How would I even look into the Code of the file? I may know some Coding but I still struggle with using Windows in terms of advanced things.
Yeah, Admer's playlist, and this series of tutorials are of great help when learning to use the SDK.
You might also check out this tutorial for setting up a HL mod as well.

As for why FortressOne would be easier to mod, it's because it's open source (the game code is publicly available and free) so you won't need to go through recreating anything as you would need to with HLSDK.

Lastly, the Windows Defender message is likely because of a missing app signature on the executable. Apparently Windows requires this sort of signature on applications now for Defender not to alarm you about it. But since it's open source, you can look through the code yourself and even compile it yourself to make sure there's nothing nasty in there, and then if you trust it click on Advanced (or something like that) and click on Run It Anyway (might say something else along those lines).
Dang I tried running FortressOne but my Windows 11 said this:
"Microsoft Defender SmartScreen prevented an unrecognized app from starting. Running this app might put your PC at risk."

Do you know of how I can solve that error?
Would the Playlist I mentioned Before help me with the HLSDK coding?

Why would FortressOne be easier to mod? How would I mod that?
TFC did start out as a HL1 mod, a port of the original Team Fortress from Quake, and later released as a standalone game (although pretty much still just a HL1 mod, which becomes fairly obvious considering all the shared assets and the Hunted map being modified parts of a section of HL1's campaign).

So the timeline of the games goes something like:
  • Team Fortress (Quake and later QuakeWorld)
  • Team Fortress Classic (Half-Life 1 mod and later standalone GoldSrc game)
  • Team Fortress 2 (Source)
Although the name "Team Fortress" might be used to refer to any of these, disambiguating by using the full name matters when talking about modding these as there are major differences in the approach due to the different engines used.

So if you want to make a mod that's similar to TFC in terms of gameplay and feel etc, starting out with HLSDK and recreating the mechanics would be the way to go.

As for FortressOne, it's just an open source version of the original TF using the QuakeWorld engine (which has better networking than Quake) and would be the easiest base game to mod, but its code could possibly be used as a guideline on how to implement certain mechanics into your own mod.
If this is going to be tough, would a Better route to be recreating Team Fortress but in Half-Life? They both use the Goldsrc engine, theres an official SDK, and doesn't half-life have source code available? Why does this remind me of creating a roblox game?

What is Open Source Fortress? Does it run on Source, Goldsrc, or the original Quake engine? Could I make a mod of that instead?

So Far I like the Quake option better, but I could be wrong. This is giving me vibes of making a Roblox game lol.
Since there's no publicly available game code for TFC, there's likely not much you can do other than recreating the mechanics in HLSDK as its own mod as Shepard says.
There's an open source fork of the original Team Fortress which may or may not come in handy.
I won't use Metamod that much then if it won't give me full access to full modding of Tfc.

So what would I use instead of Metamod to re-program Tfc? (So I could add new things like Classes)

Because I had this idea where the Player could press some key like "R" to change the existing class selection panels to change out the Classes instead of me adding new panels altogether.
The source code of TFC is not available to the public and I heavily doubt Valve would agree to release it as they made crystal clear that they would stop doing so in response to the various leaks in the past years.

There are some TFC elements in the HL source code like the player and class selection panels and minor things but the rest such as weapons, game modes, player classes themselves and many more will have to be re-programmed by yourself.

As for Metamod, AFAIK, you will only be able to change existing stuff so forget about adding new stuff like classes.
Do I need access to the Source Code of Tfc (Which there is none available I think) To add something like New Classes though? Or is it where some Code is visible & you can edit?

How I was going to do it where the player would press "R" or something to change the Classes instead of adding new numbers, as that part could be locked? Idk. For "0" instead of a Random Class I was going to make it a Commander Class.

I was going to make the Keycard part where any class could pick it up & use it, I was going to add new colors as well.

Do you know of someone else who knows about Metamod I could ask this to? Could the Valve Modding Community Discord Server give me answers too?
New classes and weapons sounds like code territory. As far as I know we only have HL1, Op4 and BS code SDKs but none for TFC and I'm unsure what options we have there.
Perhaps something like Metamod could be used? I've never messed around with that sort of stuff myself so can't really tell how much it could help you here.

Doors and keycards (regardless of class) is vanilla goldsrc so that's definitely doable.
Making it class-specific, on the other hand, iirc the TFC entities only had logic for team-specificity so might need code work to get that.
PigFactory2003b by VooDooPig (http://web.archive.org/web/20031112152953/http://cariad.netfirms.com/twhl/mapvault_map.php?id=4)

Second after cs_canbunk, seems to of been in testing during that archived post.
I wanted to add new Classes to my Tfc Mod, Could I do that? Same goes with Weapons, and this idea where any class could pick up a Keycard to unlock a door.
As for Valve's approval, don't worry about that. I don't think they even acknowledge TFC anymore, and even if they did they'd just be positive about it as they've always been about mods*.

(*except for HDTF, but you can't really call that a mod, and besides we don't talk about that dumpster fire anyway)
TFC is still being played. It's not as popular as it used to be, but there's at least a couple communities still around with regular players.

I'm not sure if there's any game code available, and engine code is definitely off the table, but if all you want to do is add new maps then all that isn't needed. If you're not changing anything code-wise you can just use TFC as the base game (iirc you can put "fallback_dir" "tfc" in liblist.gam), but if custom maps is all you're planning on making you don't even need to make a mod for that. Just publish those maps on their own and anyone already owning TFC can play those without getting a separate game/mod for it!

The making of and publishing of custom TFC maps is over two decades old and I'm sure the remaining players (including me) would be very grateful to try out new maps 😊
But wait, would Valve not approve of me making a Tfc mod though? Or is it okay as long as I don't steal any of their code & make the game free to play? But am I required to "steal" code to make my mod work? Or could I just write my own Code but it does the same thing? Or should I just make my mod unique in general? I was going to add different maps to it.
Are people still even playing Team Fortress Classic? Because I might actually make a Tf2 mod instead if no one is going to even play the Mod, or are there people out there who would be interested?

ChatGPT was also telling me to look somewhere else for help after I started asking it more advanced Goldsrc questions, so I came here :glad:
Posted 7 months ago2023-10-09 23:00:02 UTC
in How to define gravity in source code? Post #347936
Thanks Admer! This worked!
Yeah, I would advise against using ChatGPT for GoldSRC-related stuff, because there isn't much information about it. It has worked okay for doing my brother's Bosnian homework (writing little poems etc.), but I'd definitely not use it for this.
Admer456 Admer456If it ain't broken, don't fox it!
LLMs such as ChatGPT should only be used as entertaining novelties, not as actual sources of information.

They don't know anything, they don't provide any guaranteed correct information. All they're good for is making convincingly enough human-like text.
Strangely, ChatGPT was telling me that the Goldsrc Engine was written on a Programming Language called "Squirrel" so I accidentally assumed that you needed to know it instead of C++. Thanks for clarifying the confusion.
Posted 7 months ago2023-10-09 16:59:33 UTC
in How to define gravity in source code? Post #347932
You can just use CVAR_SET_FLOAT:
// Gravity will vary +/- 400
#define GRAVITY_VARIATION 400

int myRandomGravity = 800 + rand() % GRAVITY_VARIATION;

CVAR_SET_FLOAT( "sv_gravity", myRandomGravity );
But of course, there are ways to convert numbers into strings (the values in quotation marks are called "strings").
Admer456 Admer456If it ain't broken, don't fox it!
Posted 7 months ago2023-10-09 16:53:56 UTC
in Changing HUD element positioning? Post #347931
Files like health.cpp, battery.cpp etc. implement their own HUD elements with exact coordinates in them.

I'll give you a bit of a detailed explanation so you mechanically know what's going on, if that makes sense.
For example, battery.cpp starts with:
//
// battery.cpp
//
// implementation of CHudBattery class
//
Implementation of CHudBattery huh... what's that?
It is defined in hud.h:
class CHudBattery : public CHudBase
{
public:
    bool Init() override;
    bool VidInit() override;
    bool Draw(float flTime) override;
    bool MsgFunc_Battery(const char* pszName, int iSize, void* pbuf);

private:
    HSPRITE m_hSprite1;
    HSPRITE m_hSprite2;
    Rect* m_prc1;
    Rect* m_prc2;
    int m_iBat;
    int m_iBatMax;
    float m_fFade;
    int m_iHeight; // width of the battery innards
};
Each of these HUD elements are C++ classes, which inherit from CHudBase. The HUD system contains a collection of these CHudBase based objects.

Now, here's the thing. When the HUD wants to actually draw itself onto the screen, it visits each of these elements and asks them to render themselves. This is what the Draw functions are for. If you want to find what coordinates are used, you would simply find, for instance, CHudBattery::Draw, like so:
bool CHudBattery::Draw(float flTime)
{
    if ((gHUD.m_iHideHUDDisplay & HIDEHUD_HEALTH) != 0)
        return true;

    int r, g, b, x, y, a;
    Rect rc;

    rc = *m_prc2;
    rc.top += m_iHeight * ((float)(100 - (V_min(100, m_iBat))) * 0.01); // battery can go from 0 to 100 so * 0.01 goes from 0 to 1
    UnpackRGB(r, g, b, RGB_YELLOWISH);

    if (!gHUD.HasSuit())
        return true;
... // rest of the code
Scrolling down in the same function, we see this code:
y = ScreenHeight - gHUD.m_iFontHeight - gHUD.m_iFontHeight / 2;
x = ScreenWidth / 4;

// make sure we have the right sprite handles
if (0 == m_hSprite1)
    m_hSprite1 = gHUD.GetSprite(gHUD.GetSpriteIndex("suit_empty"));
if (0 == m_hSprite2)
    m_hSprite2 = gHUD.GetSprite(gHUD.GetSpriteIndex("suit_full"));


SPR_Set(m_hSprite1, r, g, b);
SPR_DrawAdditive(0, x, y - iOffset, m_prc1);

if (rc.bottom > rc.top)
{
    SPR_Set(m_hSprite2, r, g, b);
    SPR_DrawAdditive(0, x, y - iOffset + (rc.top - m_prc2->top), &rc);
}
This says "Hey GoldSRC, please render a sprite at these coordinates here". SPR_Set tells the engine to use a certain sprite, and SPR_DrawAdditive tells the engine to draw it. So, now you might be wondering what's up with these x and y variable things. You can declare your own temporary variables to essentially "chain" HUD elements one after another, so you don't have to manually specify every single coordinate yourself. You can use it to say "the next one will be 5 pixels more" etc.

Now if you actually know C++ and stuff, woops! I tend to assume people don't know, and this may be useful to people in the future anyway, so yeah.

So, generally, it boils down to maths. You just gotta read the code really well to see where the coordinates are defined, and you'll be fine. You can change it to whatever you want, whether it's moving something from the bottom-left corner into a top-right corner, or make them bounce up'n'down through time and anything you can imagine.
Admer456 Admer456If it ain't broken, don't fox it!
Posted 7 months ago2023-10-09 11:54:54 UTC
in Half-Life Featureful SDK Post #347930
New release

Changelog

Configurable features

  • Wall puff sprites (cl_weapon_wallpuff) can be configured via featureful_server.cfg. Up to 4 sprites can defined (wall_puff1 - wall_puff4) which allows to set sprites from Counter Strike. By default sprites/stmbal1.spr is used as a sole wall puff sprite.

BugFixes

  • Fixed opfor ropes physics on high framerates.
  • Fixed spore launcher not playing a pet sound.
  • Fixed some HUD issues when player has both flashlight and NVG.
  • Fixed FG_CURE sentence group (a resource change)
  • Replaced fgrunt/checkin (a missing sound) with fgrunt/check in sentences.txt (a resource change).

Entities

  • Each global variable has one integer number associated with them, in addition to the state value. The number can be changed via game_counter_set targeting env_global with Modify/Set value triggermode. Also, triggering such env_global with 'On' or 'Toggle' use-type increments the global variable number by 1. Triggering it with 'Off' use-type decrements the number by 1.
  • New parameter Obey Use-type for env_global which allows to change the global variable state accordingly to the input use-type.
  • New spawnflag Act as Master for env_global which allows to use the global variable state as a master.
  • New entity trigger_compare for comparing constant numbers and numbers associated with entities (so called Locus Ratio) and triggering different targets depending on the result of comparison.
  • New entity calc_state to evaluate the state from boolean operation where the 'On' state corresponds to True and 'Off' state corresponds to False. Can be used as a master.
  • Copy Input and Reverse Input trigger modes for trigger_relay.
  • New entity calc_eval_number to evaluate the math expression based on constant numbers and calc ratios of entities.
  • New entity game_number for storing floating point numbers (you can still use game_counter to store and retrieve integer values). Can be used as a storage or parameter of calc_eval_number.
  • New entity trigger_check_state to check the master entity state and trigger the target depending on the check result.
  • Customizable smoke sprite for env_explosion.
  • monster_human_assassin_dead.
  • Barnacles can't grab victims possessed by non-interruptible scripts anymore.

Server commands

  • set_global_state - set the state of global variable. Available only when sv_cheats is enabled.
  • set_global_value - set the number value associated with global variables. Available only when sv_cheats is enabled.
  • ReportAIState (impulse 103) now reports the name of the scripted sequence entity if monster is currently possessed by a script. The command also draws the current monster route and the nearest node using temporary beams.
  • calc_ratio - calculate a ratio values associated with entity and report the result to developer console.
  • calc_state - calculate/get the entity state and report the result to developer console.

Other

  • Support for snow texture material.
  • Added item_sodacan to FGD.
New pages on wiki: Math and Master entities.
It teaches you about programming map entities, weapons and such. It will help you if you know C++ programming fairly well from the start.
You can also check out programming tutorials here on TWHL.

Also hi, I made that :walter:
Admer456 Admer456If it ain't broken, don't fox it!
Would this help me Mod Tfc? It's a Playlist of how to program in the Half Life SDK.
Posted 7 months ago2023-10-08 10:44:08 UTC
in Changing HUD element positioning? Post #347927
Hey all. I've been trying to change the X and Y coordinates of various parts of the HUD for a bit, both the numbers and icons, but I'm a bit lost on where exactly I could find the code for this, as I'm not seeing it anywhere in hud.cpp or battery.cpp.
I've modified the height and width of the icons via the hud.txt file, but I'm looking to change the position of which they actually show up on screen.
Posted 7 months ago2023-10-08 09:26:43 UTC
in How to define gravity in source code? Post #347926
Hey thank you for the detailed response, and sorry for coming back to you so late!

I've tried a number of things but somehow can't get it to work. I have to add that I am not a professional (c++) programmer, my understanding is quite basic.
I think you are correct in that the best way is to do it in CWorld::Spawn as that is where the global sv_gravity value is assigned. However I am unsure how to, so to speak, change this value with an rng if it's in quotation marks (as it will literally paste my code as text as the value for sv_gravity). What would be the logical approach to do this?
Posted 7 months ago2023-10-05 14:44:49 UTC
in Problem with zombie soldier Post #347925
Oh

seems like I missed game.cpp

Thanks for telling me

ill check if it works

Edit: it works , thank you everyone that helped and you guys are best
Scientistbeta ScientistbetaGravity is Great!
Posted 7 months ago2023-10-05 14:36:23 UTC
in Problem with zombie soldier Post #347924
Posted 7 months ago2023-10-05 13:14:21 UTC
in Problem with zombie soldier Post #347923
Tried using code blocks

says that "may not be greater than 10000"

But i set link to "anyone with the link"

so check the link works

link

If it does not work please tell me again
Scientistbeta ScientistbetaGravity is Great!
Posted 7 months ago2023-10-05 13:04:51 UTC
in Problem with zombie soldier Post #347922
The link is inaccessible because you need to share access.

Just post the code directly using code blocks.