Forum posts

Posted 3 years ago2019-02-09 08:22:59 UTC
in mod icon Post #341996
It writes them in the required order, which is the reverse order of most TGA files, but the same order as most image files of other formats in my experience. By default most simple image formats keep rows of pixels top-to-bottom. It seems TGA is the exception, though has the capability through certain header fields to store pixel rows top-to-bottom, too. My tool does this, and this makes the icon display correctly in Half-Life as well as anywhere else like Steam.

You're correct that the direction bit (1<<5 in byte 17) should be set, there's also bytes 10-11 which should contain the height as a 16-bit little endian integer, having the same values as bytes 14-15. https://github.com/oskarlh/hltga/blob/master/scripts/index.js#L29
Posted 3 years ago2019-02-08 10:46:35 UTC
in ep2 - make chopper take damage Post #341990
Hi!

I don't know much about Half-Life 2 and the Episodes, but it seems the requirement for the damage to be from rockets or airboats is hard-coded: https://github.com/ValveSoftware/source-sdk-2013/blob/master/mp/src/game/server/hl2/npc_attackchopper.cpp#L3473

I think you're right in your line of thinking, sounds like the only thing that could work other than custom code
99% of computers use pirated oses
Certianly not true. The vast, vast majority of computers are factory-made and come pre-installed with a legal copy of Windows. If you don't want to buy, sure, I understand. Doesn't mean it's better to use old outdated software than modern pirated software that receives security updates and has a more secure architecture. Rather something that may possibly be compromised from the start than something that's guaranteed to be open to infection.
i dont see how win xp is any less secure than any other os
Microsoft has stopped releasing security updates. So the difference is, when an exploit is discovered for Windows 10, an update is released and the system is made secure within days. When an exploit for Windows XP is discovered, nobody gives a fuck, because nobody is supposed to be using a 17-years-old version of Windows anyway.
I am still running XP and never have had any virus warnings...
Having viruses and getting virus warnings are entirely different things. Viruses can go undetected and some viruses alter anti-virus software.
You must only have to keep you antivirus updated and never visit "extrange" or suspicious web sites.
Or browse the web (perhaps to pirate software or watch that weird porn you probably love). Or play games online. Or plug in a USB stick. Microsoft isn't releasing patches against Spectre, Meltdown or any of the other attacks that don't require you to do anything weird. Windows XP is abandoned.

If you don't want to use Windows 10, get a Linux OS or OS X or FreeBSD. You may already be part of a botnet without knowing, and contribute to attacks against innocent websites, companies, organizations, government agencies and even small countries. Update your software, folks.
You really shouldn't be using Windows XP anyway. It's an insecure, outdated, unsupported system that makes your computer an easy target for people who run botnets that threaten everyone.
Posted 3 years ago2019-02-04 15:09:40 UTC
in mod icon Post #341957
I wrote a script you can use if you don't want to install GIMP. Just drag and drop a PNG, GIF, SVG, JPEG, WebP, or TIFF (ironically enough not TGA) onto image_to_hl_game_tga.bat and it will create a game.tga which works fine with both Half-Life and Steam. Let me know if you have any trouble using it. If you want to try different image dimensions, edit index.js (the const width and const height lines).

https://github.com/oskarlh/hltga/releases
Remember to add icon "game" to your liblist.gam if you want it to show up in Steam.

Edit: Added to the wiki

Edit 2: Turns out compression works (even Half-Life's valve\game.tga is compressed), the information on Valve's wiki is outdated. Also, the file can have any reasonable resolution, but should be 32x32 if you want to use the same file for Steam's game list.
Posted 3 years ago2019-02-03 22:16:28 UTC
in mod icon Post #341949
No idea, unfortunately
Posted 3 years ago2019-02-03 17:38:09 UTC
in mod icon Post #341947
Here's how to save the image correctly using GIMP:
Then add icon "game" to your liblist.gam. The icon will then display correctly both in Steam and the Half-Life window header / taskbar icon.

The "Origin: Top left" option is what does it. I guess the technical reason is that either Windows or Half-Life (whichever is responsible for interpreting the TGA) doesn't care about the part of the file header that says which order the pixels are in. So we need to use the expected order.
You could compare it to painting. Some artists can make fantastic art with just their fingers. But you can't deny the importance of the paintbrush.

Similarly, the Doom engine is excellent. For Doom. Not for Battlefield, not for Half-Life, not for a lot of fantastic games, not even Quake. Half-Life can not even be made in the game engines of the early 1990s without changing either the engine or the game so much it's no longer the same.
If you make a great game using an ill-suited engine, it's a great game despite the engine. If you have an engine and tooling that's a good fit for what you're creating, you're more likely to succeed in creating something good. Game engines (and the associated tools) matter a lot.
An engine has absolutely no bearing on a games quality
It does, depending on the kind of game and what you're trying to create. What made Crysis special? Do old FPS games feel immersive anymore, now that we've been spoiled by more realistic graphics? One of my absolute favourites is Deus Ex. Maybe the second best game I've ever played (Life is Strange is special to me). But I'd like it a lot more if it wasn't so damn ugly and bug-ridden. And not half of the ugliness can be blamed on the artists or even the programmers. The core technology is outdated: look at the lighting, the physics. And if you've played it, you know the Unreal AI isn't a good fit for that kind of game. The game suffers because of these things. That it's still such a great game according to so many people is an achievement, but it could probably be even better if made with today's modern tools. But of course, that's just speculation.
I'm going to have to disagree with you. While you can certainly make a fantastic game in any decent game engine that's flexible enough, the limitations of some engines simply don't let your realize certain visions. You can't make something like GTA in the GoldSrc engine or even the Source engine without jumping through hoops that take -a lot- of time away from the creative process.
Posted 3 years ago2019-01-01 20:15:04 UTC
in Post your screenshots! WIP thread Post #341533
Don't be sorry! I don't understand it, but you do whatever makes you happy 🙂
Posted 3 years ago2019-01-01 17:47:28 UTC
in Post your screenshots! WIP thread Post #341531
The geometry looks great, but some of the textures are very pixelly
Thanks for sharing! Good read
Posted 3 years ago2018-12-29 09:17:11 UTC
in getting number of sprite frames on server Post #341520
Can you provide a piece of example code? It would save whoever decides to look into this some time
Posted 3 years ago2018-12-29 08:54:34 UTC
in when to EXPORT an entity method Post #341519
After having a quick look at it, it seems the engine looks up the names of DLL functions (and for this to work the functions need to be listed in the DLL exports table, which Half-Life achieves with the EXPORT macro) when pointers to those functions need to be (re)stored for the purposes of save files. The names of the functions, rather than the actual function pointers, are written to save files. So I'm guessing you only need to worry about EXPORT when you need to be able to (re)store a pointer to a function (i.e. anywhere you use DEFINE_FIELD with the FIELD_FUNCTION argument). The current think, touch, use and blocked functions of entities are good examples: https://github.com/ValveSoftware/halflife/blob/5d761709a31ce1e71488f2668321de05f791b405/dmc/dlls/cbase.cpp#L584

EXPORT is also used to enable the engine to find some functions it needs to call and knows to expect under certain names like HUD_Init and V_CalcRefdef.
It seems like things compile without the EXPORT but I guess save-games will screw up without it
I haven't tested, but from my quick glance at the code I agree
Posted 3 years ago2018-12-27 17:16:55 UTC
in Competition 35: Vanilla Half-Life Post #341494
That's really nice of you, Leslie
Posted 3 years ago2018-12-24 13:17:20 UTC
in The Ballet of the Bots Post #341486
Does Botman's original code produce the same behaviour?
This post was made on a thread that has been deleted.
Posted 3 years ago2018-12-17 02:45:45 UTC
in VHLT source code cleaned up Post #341463
I wonder if anyone's ever explored the idea of using a rendering engine like the one in Blender to generate light maps for old games
Posted 3 years ago2018-12-15 11:55:23 UTC
in Now Playing: ... Post #341458
The Voidz - Virtue (album): YouTube, Spotify
Best of luck to him. I think a better use of time might be to encourage people to share their source files, since the root of this problem is cultural, not technological.
Posted 3 years ago2018-12-10 16:24:24 UTC
in VHLT source code cleaned up Post #341418
Sorry, Solokiller, that article is useless. It's common in high-performance C++ projects to use custom allocators, and the cost of deallocation wasn't measured. A more complicated allocation can make the deallocation cheaper and vice versa since a common goal of a memory allocation scheme is to avoid memory fragmentation and that requires a lot of work. C# is of course garbage collected and the cost of cleaning up and reorganizing needs to be taken into account. Most implementations of the standard C++ operator new are designed to be thread-safe and conservative - so there's likely a big overhead from locking every time you call new - which is something a custom allocator can minimize by being greedy and preallocating large amounts of memory. The costs of dealing with dynamic memory are paid for at different points in the lifetime of the program: with (non-garbage-collected (yes, C++ can be garbage collected according to the standard, no idea why anyone would want that though)) C++ it's very predictable - you only pay when you allocate and deallocate; with C# you leave a lot of the work to the garbage collector. There have been a few interesting CppCon talks on allocators.

Making something like this in C# is fine of course, use whatever you prefer. Ease of development is a good reason to pick one language over the other and C++ can be painful. As you know design usually matters much, much more than choice of language when it comes to performance. I'm excited to see the results of your work!
Posted 3 years ago2018-12-01 14:31:49 UTC
in Is there a way to fire random events? Post #341369
A laser with multiple same-name targets is a common method: https://twhl.info/wiki/page/Tutorial%3A_Random_entity_triggering
Posted 3 years ago2018-11-25 12:10:11 UTC
in Disabling Spectator modes Post #341315
Looks to me like you should put that code back in and focus on Observer_HandleButtons
Posted 3 years ago2018-11-24 04:42:37 UTC
in Competition 35: Vanilla Half-Life Post #341305
I know I didn't enter, but can you let me win anyway so I get the oxy? I promise to share
Posted 3 years ago2018-11-14 13:05:07 UTC
in 3DS Half-Life Post #341243
What's the point? I wouldn't want to play an FPS with the 3DS's controls.
I'm pretty sure that would require programming.
Posted 3 years ago2018-11-04 23:41:52 UTC
in Competition 35: Vanilla Half-Life Post #341188
Hello there, Sirlion! Looks like the judges have a difficult job ahead of them with all these promising entries.
Posted 3 years ago2018-11-04 17:14:50 UTC
in Safe Entity Threshold Post #341184
TIL. Solokiller knows the engine better than probably anyone on this site.
Posted 3 years ago2018-11-04 05:25:13 UTC
in Safe Entity Threshold Post #341172
The default limit is 900 and can be changed by the server owner by adding
commandargs "-num_edicts 3072"
(the number can be changed to something lower or higher) to liblist.gam. I don't think texlights count.
Posted 3 years ago2018-10-27 15:20:32 UTC
in Sledge (Hammer Alternative) Alpha Build Post #341087
I don't know what you're trying to say, MuchoFranco. Could you rephrase that, please?
Posted 3 years ago2018-10-25 20:25:07 UTC
in SharpLife - Dot Net Core based modding p Post #341079
A lot of apps use a web engine for their GUI (I do NOT suggest this for your project) and I think a big part of the attraction is the access to all the CSS units and properties which make it easy to produce UIs that scale for any resolution and aspect ratio. Units like vw, vh, (r)em, and percentages. Maybe they can serve as inspiration somehow?
Posted 3 years ago2018-10-17 23:20:52 UTC
in TWHL4 Discussion / Bug Reports Post #341052
I think it could be a good idea to display some of the latest Discord messages on the website. New visitors might be more inclined to stick around if they know there's more activity than just what they see on the site. I've written some quick example code for fetching the latest messages from a channel using RestCord:
<?php

// Step 0: Install RestCord (Composer: restcord/restcord)
// Step 1: Go to https://discordapp.com/developers/applications/ and register a new application
// Step 2: Create a bot for that application
// Step 3: Go to https://discordapp.com/oauth2/authorize?&client_id=502232355797204994&scope=bot&permissions=66560 (replace 502232355797204994 with your application's client id) and make the bot join the relevant server
// Step 4: Update the definitions below

define("BOT_TOKEN", "NTAyMjMyMzU1Nzk3MjA0OTk0.DqlD6w.uOnSIKcM7N0oG6srQN8vUBqsM3Q");
define("DISCORD_SERVER_ID", 502229064434712585);
define("CHANNEL_ID", null); // <- Define for one request fewer (since we don't have too look up the ID from the name)
define("CHANNEL_NAME", "general");
define("CHANNEL_TYPE", 0); // 0 for text channel (see https://discordapp.com/developers/docs/resources/channel#channel-object-channel-types)

require_once __DIR__ . "/vendor/autoload.php";

use RestCord\DiscordClient;
use Psr\Log\LoggerInterface;

class SilentLoggerReplaceWithSomethingBetterOrUseTheDefaultLogger implements LoggerInterface {
	public function emergency($message, array $context = array()) {}
	public function alert($message, array $context = array()) {}
	public function critical($message, array $context = array()) {}
	public function error($message, array $context = array()) {}
	public function warning($message, array $context = array()) {}
	public function notice($message, array $context = array()) {}
	public function info($message, array $context = array()) {}
	public function debug($message, array $context = array()) {}
	public function log($level, $message, array $context = array()) {}
};


$discordClient = new DiscordClient(["token" => BOT_TOKEN, "logger" => new SilentLoggerReplaceWithSomethingBetterOrUseTheDefaultLogger()]);


$channelId = CHANNEL_ID;
if($channelId === null) {
	$guildChannels = $discordClient->guild->getGuildChannels(["guild.id" => DISCORD_SERVER_ID]);
	foreach($guildChannels as $channel) {
		if($channel->name === CHANNEL_NAME && $channel->type === CHANNEL_TYPE) {
			$channelId = $channel->id;
			break;
		}
	}
	if($channelId === null) {
		exit("Channel not found.\n");
	}
}
echo "Channel ID: " . $channelId . "\n";

$messages = $discordClient->channel->getChannelMessages(["channel.id" => $channelId, "limit" => 5]);

echo "Messages:\n";
foreach($messages as $msg) {
	$time = new DateTime($msg["timestamp"], new DateTimeZone("UTC"));
	$author = $msg["author"]["username"];
	$content = $msg["content"];
	echo $time->format("Y-m-d H:i:s") . " " . $author . " wrote:\n" . $content . "\n\n\n";
}

?>
I'd offer to help with this beyond just this example code if you're interested in implementing this, but, you know, I'm lazy.

PS. The code formatting using backticks isn't working properly
Posted 3 years ago2018-09-22 01:15:38 UTC
in Hassassins killing each other Post #340931
Posted 3 years ago2018-09-20 03:04:00 UTC
in Post your screenshots! WIP thread Post #340920
That's really beautiful. I think it's a wonderful idea
Posted 3 years ago2018-09-16 15:40:09 UTC
in Cs 1.6 - Spawn with dif. weapons each round Post #340895
Here's an idea, the first that comes to my mind:
If you want, say, 4 different weapon rounds, create 4 different game_counters with the same name, with the limit set to 4, with the Reset on fire flag checked, with different targets, and with different initial values. So the first one would have these properties:
Name: c
Target: give_players_knives
Initial value: 0
Limit: 4
[Reset on fire]
The second one would be:
Name: c
Target: give_players_mp5s
Initial value: 1
Limit: 4
[Reset on fire]
And so on...
And then make sure "c" is triggered at the start of each round.
Untested.
Posted 4 years ago2018-08-01 16:32:56 UTC
in Map won't compile properly Post #340364
It can be helpful for others trying to figure it out to post the compile log (the text the compilers spew out when you compile your map), the .bsp, the .map, and/or the .rmf, plus any resources needed to run the map (models, sprites, wads). Or a screenshot. Are the entities and buildings just invisible, or are they also physically not there (can you walk through where they're supposed to be)?
A new version has been published and it should be rolling out to your browser within 24h. Here are the changes:
  • Using this extension no longer keeps your account on the top of the active users list (added request header X-Requested-With: XMLHttpRequest)
  • Earlier limit of 4 shouts reduced to 2.
  • Some changes to the timing of requests. Should be a little friendlier to the server (and your connection if you're on modem or on mobile or maybe just a Canadian polar bear) when there hasn't been activity in a while.
Seriously? I'm sorry! I have the memory of a jellyfish. It was TJB
I thought I removed those lines. Never release when you're in a hurry...

Edit:
A new, fixed version was uploaded an hour ago.
@Jessie, I haven't been able to recreate your full-screen problems on either Firefox or Chrome.
Thanks for your suggestions. The actual notification system is built into the browsers, so I'm limited in what I can do.

Concerning the heading, I could prefix the title with "TWHL: ". Would that be an okay solution?
Concerning your second point, I think that that is excellent idea and it shouldn't be too difficult to implement.
Concerning your third point, I'm not sure if it's worth the effort because I doubt that users would install the extensions in strict SFW environments. But I'll give it more consideration when I have more free time or if one more person asks for it.

Note to self: "They seem to show up most of the time after I close a YouTube video from fullscreen, that might be the cause of it." <- see what I can do about that

Edit: Implemented point 1 and also, whenever there are 5 or more new shouts, you get just one notification.
Posted 4 years ago2018-06-03 22:11:02 UTC
in [Idea] TWHL Shoutbox desktop application Post #339799
It would be a massive amount of work I'm afraid. I think a more realistic idea would be to improve the mobile experience of the website. The source code is available here: https://github.com/LogicAndTrick/twhl . I would be surprised if Penguinboy doesn't welcome good contributions.
Posted 4 years ago2018-06-03 14:30:20 UTC
in What font is this? Post #339794
It's definitely a typewriter font.
New version uploaded, should be available within a few minutes.
Changes:
  • No longer displays shouts older than two hours (configurable) on startup
Posted 4 years ago2018-06-03 10:49:35 UTC
in TWHL4 Discussion / Bug Reports Post #339786
@ninja defuse: bottom right
Posted 4 years ago2018-06-02 22:55:23 UTC
in TWHL4 Discussion / Bug Reports Post #339780
@Penguinboy: Members would be a logical place, yes. I also think it would fit okay below the wiki edits on the front page.
Those are good suggestions. I thought about the first one, but though it might require too much work to create an UI. After a quick Googling, I've changed my mind - it seems pretty easy to create a settings UI. Using the user's avatar in the notification is something I hadn't considered. I'll get to it!

Edit: An update has been released containing implementations of Penguinboy's suggestions. If you want your shouts to be ignored, you have to go to the Extensions control panel and use the extension options panel to enter your username (Chrome: More tools > Extensions > TWHL Shoutbox Notifications > DETAILS > Extension options) (Firefox: Ctrl+Shift+A > Extensions > TWHL Shoutbox Notifications > Options).
Posted 4 years ago2018-06-02 18:04:43 UTC
in TWHL4 Discussion / Bug Reports Post #339775
Thanks for all the hard work you have put into the website over the years!

I miss the list of recently active users.
Would you like your web browser to alert you when someone shouts in TWHL's shoutbox, even when you're not on TWHL? I created a browser extension for that purpose.
Firefox version
Chrome version