Forum posts

Posted 4 years ago2020-05-13 16:19:34 UTC
in Compiling dll problem Post #344212
Thank you for your answers, yes I did. :glad:
Posted 4 years ago2020-05-13 15:43:01 UTC
in Compiling dll problem Post #344210
I tried this now:

I downloaded the SDK in your link because it's a newer version than the one I have. I compiled without change any code, it works alright.

Now I replace gauss.cpp with my modified work from 2014, where I make the gauss behave the same way in multiplayer like it does in singleplayer (longer chargin, unable to fly in air etc.). I know it should work because I compiled this before, and have an old compiled hl.dll from 2014. It compiles fine but no changes happens with the gauss. (This was just one of my modified cpp files for testiing purposes)

Maybe I should just stick to Virtual Studio 2010 and SDK 2.3? Maybe it's bad anyway to copy my modified SDK 2.3 files to 2.4 as these new cpp files might have updated code. And it's not like I want to recode all my old work :)
Posted 4 years ago2020-05-13 12:25:38 UTC
in Compiling dll problem Post #344208
Hello,

I recently picked up some coding I used to work on 6years ago. I tried compiling my code, and got a compiling error c2668. I solved this though, and my dll finally compiled.

However, when I moved the hl.dll to my mod dir and started the game, it's just like regular hl. It's like visual studio just ignored all my coding and compiled a default hl dll. I doublechecked to see if it compiled the right files, and that's what it should do.

I made some custom settings to other things like some hl maps and server settings etc and with this new dll, all my editing here is also ignored.

I think I used to have SDK 2.3 and now I downloaded SDK 2.4, to make it more compatible with newer versions of virtual studio.

Anyone knows what's going on? Maybe I should just download a earlier version of virtual studio and compile it like I used to back in the day? It's been a long time hehe..
Posted 11 years ago2013-04-17 16:28:22 UTC
in Coding trigger_camera Post #313329
Okay, thanks for answering again, tried simular before but didn't get it right, but I will try again. I have one more question, when a player cross a trigger, I want the activator to get different default_fov value. Tried with 'CVAR_SET_FLOAT( "default_fov", 120 );' but that will only make the Client have his default_fov changed, no matter which player that triggers it. Have any clue? I appreciate that you take time to answer my questions, thanks.
Posted 11 years ago2013-04-13 10:56:07 UTC
in Coding trigger_camera Post #313311
I'm having a trigger_camera for a Multiplayer map, and want all players to be able to be affected when it's triggered instead of just 1. I know a way how to do this with just entities, but I want to do this with coding instead.. Anyway , code looks like this from triggers.cpp:

void CTriggerCamera::Use( CBaseEntity *pActivator, CBaseEntity *pCaller, USE_TYPE useType, float value )
{
if ( !ShouldToggle( useType, m_state ) )
return;
// Toggle state
m_state = !m_state;
if (m_state == 0)
{
	m_flReturnTime = gpGlobals->time;
	return;
}
if ( !pActivator || !pActivator->IsPlayer() )
{
	pActivator = CBaseEntity::Instance(g_engfuncs.pfnPEntityOfEntIndex( 1 ));
}
I guess this says that it's the activator of the camera that gets affected. What does the g_engfuncs.pfnPEntityOfEntIndex really do? Some change in this code to make all players see through camera? Still learning :P
Posted 11 years ago2013-02-21 20:30:35 UTC
in Code for triggering all players Post #312726
Thanks for fast answer. Will try it and tell later if it worked :)

Edit: Did as you said, then I made a game_zone_player with both in- and outtarget triggered to the entity. It worked, thanks a bunch:)

Edit2: I found an easier way, without having to use the game_zone_player. Changed to this:
MESSAGE_BEGIN( MSG_ALL, gmsgShowGameTitle ); 
WRITE_BYTE( 0 );
MESSAGE_END();
Cheers!
Posted 11 years ago2013-02-21 17:26:34 UTC
in Code for triggering all players Post #312723
Hey there, my first post here. Can't really find any active hl1 coding community, all sites like Wavelength seems dead unfortunately :( So thought this site would be the best bet.

Anyway, I'm making a mod where I want the "Half-Life" title to be visible for all players when a certain entity is triggered(the title that shows when you start a new hl game, c0a0, the tram map..). So I made a copy of trigger_relay and changed some code, it looks like this (only showing the 'Use' function as I guess this is the important part):

void CTriggerLogo::Use( CBaseEntity *pActivator, CBaseEntity *pCaller, USE_TYPE useType, float value )
{
gDisplayTitle = TRUE;
}

So when this entity gets triggered at my map, the title appears like I want to. Unfortunately, only for 1 player. My question here is what code do I need to make all players see the logo? I would guess something with for the code ( int i = 1; i <= gpGlobals->maxClients; i++ ) but I can't get it right when playing around with the codes. Thanks!