Forum posts

Posted 1 week ago2020-11-21 23:34:33 UTC
in Need help with Activities and NPC coding Post #344919
I just tested your method. It compiled correctly, but for some reason I don't know the NPC animations are bugged. The NPC stay freeze.
Anyway, I really appreciate your help, guys. But I think it would be better if I create the NPC with all weapons separately. :confused:
Posted 1 week ago2020-11-20 18:21:24 UTC
in Need help with Activities and NPC coding Post #344909
Hello Captain P, thanks for your correction. :D
I just deleted that part (iSequence = LookupActivity ( NewActivity );), but unfortunately my NPC still plays all the idle animations :(
I'm starting to think it's more complicated than I thought...
Posted 2 weeks ago2020-11-20 13:28:16 UTC
in Need help with Activities and NPC coding Post #344906
Yep, I just did what you said. And here's the bunch of code I wrote:
case ACT_IDLE:
if (FBitSet(pev->weapons, HEVSCI_GLOCK)) // 9mm handgun hevscientist
{
    if ( m_fStanding )
    {
        iSequence = LookupSequence( "ref_aim_onehanded" );
    }
    else
    {
        iSequence = LookupSequence( "crouch_aim_onehanded" );
    }
}
else if (FBitSet(pev->weapons, HEVSCI_PYTHON)) // .357 Magnum hevscientist
{
    if ( m_fStanding )
    {
        iSequence = LookupSequence( "ref_aim_python" );
    }
    else
    {
        iSequence = LookupSequence( "crouch_aim_python" );
    }
}
else if (FBitSet(pev->weapons, HEVSCI_SHOTGUN)) // Shotgun hevscientist
{
    if ( m_fStanding )
    {
        iSequence = LookupSequence( "ref_aim_shotgun" );
    }
    else
    {
        iSequence = LookupSequence( "crouch_aim_shotgun" );
    }
}
else if (FBitSet(pev->weapons, HEVSCI_MP5)) // MP5 hevscientist
{
    if ( m_fStanding )
    {
        iSequence = LookupSequence( "ref_aim_mp5" );
    }
    else
    {
        iSequence = LookupSequence( "crouch_aim_mp5" );
    }
}
else if (FBitSet(pev->weapons, HEVSCI_CROSSBOW)) // Crossbow hevscientist
{
    if ( m_fStanding )
    {
        iSequence = LookupSequence( "ref_aim_bow" );
    }
    else
    {
        iSequence = LookupSequence( "crouch_aim_bow" );
    }
}
else if (FBitSet(pev->weapons, HEVSCI_RPG)) // RPG hevscientist
{
    if ( m_fStanding )
    {
        iSequence = LookupSequence( "ref_aim_rpg" );
    }
    else
    {
        iSequence = LookupSequence( "crouch_aim_rpg" );
    }
}
else if (FBitSet(pev->weapons, HEVSCI_GAUSS)) // Gauss hevscientist
{
    if ( m_fStanding )
    {
        iSequence = LookupSequence( "ref_aim_gauss" );
    }
    else
    {
        iSequence = LookupSequence( "crouch_aim_gauss" );
    }
}
iSequence = LookupActivity ( NewActivity );
break;
And my NPC still plays all the idling sequences without select one specifically. But I guess this is the way! And it seem that something's still missing...
Posted 2 weeks ago2020-11-20 01:31:36 UTC
in Need help with Activities and NPC coding Post #344897
Hey Shepard. I tried that method from hgrunt.cpp, but my NPC still plays all idling animations :(
In the QC file, I assigned to every idling sequence (glock, magnum, shotgun, etc.) the ACT_IDLE tag. Is that right?
Posted 2 weeks ago2020-11-19 12:25:06 UTC
in Need help with Activities and NPC coding Post #344889
Hello people. Will you believe me if I tell you that I've been trying for months the following coding issue with no satisfactory results? Yes, it took me several months of headaches, and I'm getting sad :(
So for dat reason I'm appealing to TWHL, specifically to Half-Life's Lords of Coding. :D

I'm trying out a new NPC that consists in hevscientist with multiple faces and weapons to choose (yeah, like those ones saw in Sweet Half-Life).
I want to assign a specific idling animation to every weapon the model has. For example, if the model has a RPG, the idling animation will be those that hold up an RPG. If the model has a crowbar, the idling animation will be the one that carry a crowbar, and so on.

The challenge, I guess, is make the NPC choose a certain animation when it has a given weapon. Note that if all idling sequences has ACT_IDLE attached to them, the NPC plays all idling animations without distinction.

But I can't get what I'm looking for. Is there something I gotta do in the code?
Thanks in advance, and have a nice day :cool:
Thanks Shepard! :cool:
Hello everyone! I'm making a NPC that can shoot the following weapons: Glock, Python (357. Magnum), Shotgun, MP5, Crossbow, RPG, Gauss and Egon!
Hard work I've chosen. I wrote up the code for Glock, Python, Shotgun and MP5. They basically are a slightly modified copy of a hgrunt.cpp's bunch of code. I'll show up as an example my Python's method:

//=========================================================
// PythonShoot
//=========================================================
void CMyNewNPC :: PythonShoot ( void )
{
Vector vecShootOrigin = GetGunPosition();
Vector vecShootDir = ShootAtEnemy( vecShootOrigin );

UTIL_MakeVectors ( pev->angles );

Vector vecShellVelocity = gpGlobals->v_right * RANDOM_FLOAT(40,90) + gpGlobals->v_up * RANDOM_FLOAT(75,200) + gpGlobals->v_forward * RANDOM_FLOAT(-40, 40);
EjectBrass ( vecShootOrigin - vecShootDir * -24, vecShellVelocity, pev->angles.y, m_iBrassShell, TE_BOUNCE_SHELL);
FireBullets(1, vecShootOrigin, vecShootDir, VECTOR_CONE_10DEGREES, 2048, BULLET_PLAYER_357 );

pev->effects |= EF_MUZZLEFLASH;

m_cAmmoLoaded--;

Vector angDir = UTIL_VecToAngles( vecShootDir );
SetBlending( 0, angDir.x );
}

I wonder if you have the bunch of code for RPG, Crossbow, Gauss and Egon shoots! Due to I couldn't find them out through the Half-Life SDK yet. Or at least if you know where I can find them, please tell me! I suspect they are a little bit more complicated than the others I made! (I think they use different sprites, more sounds and models, beams...).

Thanks in advance,
Alexis.
I just couldn't get it. :\
Hello guys. Well I'm sorry if I sound kinda annoying, but you helped me some time ago. I'm very thankful with you. Now, I'm wondering again if you can help me one more time.
I can't figure out how to get NPCs show up their health points and name in vanilla Half-Life, just like they do in Sven Co-op. I wonder if you guys know how to do it... I think I'm gonna have to edit cl_dll, but certainly Idk.
Thanks in advance,
Alexis.
Posted 6 months ago2020-05-30 00:35:23 UTC
in Need help with player.mdl Post #344325
Thank you guys for your responses. I tried what abbadon said and it worked (about changing model's origin on QC file).
You're the best!
Problem solved!Problem solved!
Posted 6 months ago2020-05-28 04:34:49 UTC
in Need help with player.mdl Post #344313
Hello guys. I need your help again: When I'm implementing player.mdl (through monster_generic entity) into my map, it gets its lower half of the body under the floor, as you can see in the picture below:
player.mdl getting its lower half of the body under the floorplayer.mdl getting its lower half of the body under the floor
If you know how to fix that issue, you'd have helped me a lot. Because I coudn't fix it yet!
Alexis.
Posted 6 months ago2020-05-23 07:11:07 UTC
in Security guards reloading their gun Post #344282
I did it and it worked successfully. Thank you!
Posted 6 months ago2020-05-22 01:49:05 UTC
in Security guards reloading their gun Post #344266
Hello folks. I wonder if you know how to get, through programming, security guards (monster_barney) reloading their gun after firing 17 shots. I'm now using Visual Studio 2019 and Solokiller's updated Half-Life SDK that works with VS2019. I think it's possible since barney.mdl contains an animation doing so. But I couldn't find the bunch of code that allow security guards reload their gun :cry: . So, I need your help again!
Thanks in advance,
Alexis.
Posted 6 months ago2020-05-21 18:04:42 UTC
in About adding randomness to HL Post #344261
Thank you guys for answering. Solokiller's method worked perfectly! I've tested myself.
This thread is solved.
I'm in debt to you!
Alexis.
Posted 6 months ago2020-05-20 19:04:20 UTC
in About adding randomness to HL Post #344252
Hey there. I'm seeking out the way to add randomness to HL for triggering events. I wanna do it through editing its source code (using Microsoft Visual Studio 2010 and official Valve's Half-Life 1 SDK from GitHub). But I coudn't figure out how to do it :cry: . So, I'm wondering if you guys know how to do it. I was thinking about creating a new entity, like trigger_random or so.

I would appreciate your help of course. Greetings from Argentina!
Alexis.