Forum posts

well i have checked the folder where the qc file is in and the reference.smd is in the same folder of the qc. i tried removing the .smd of the qc file but nothing changes.
also if i try skipping reference and gunreference all the other files like walk.smd gives the same error.
im compiling with the crowbar program.
here is the .qc file

`// Created by Crowbar 0.67

$modelname "valve/models/hgrunt.mdl"

$bodygroup "body"
{
studio "reference.smd"
}
$bodygroup "weapons"
{
studio "gunreference.smd"
}

$sequence "walk1" {
"hgrunt_anims\walk1.smd"
fps 30
loop
LX
}
$sequence "walk2" {
"hgrunt_anims\walk2.smd"
fps 30
loop
LX
}
$sequence "run" {
"hgrunt_anims\run.smd"
fps 30
loop
LX
}
$sequence "diesimple" {
"hgrunt_anims\diesimple.smd"
fps 30
X
}
$sequence "dieforward" {
"hgrunt_anims\dieforward.smd"
fps 30
X
}
$sequence "crouch" {
"hgrunt_anims\crouch.smd"
fps 30
}
$sequence "standup" {
"hgrunt_anims\standup.smd"
fps 30
}
$sequence "crouching" {
"hgrunt_anims\crouching.smd"
fps 30
}
$sequence "crawl" {
"hgrunt_anims\crawl.smd"
fps 30
loop
LX
}
$sequence "smflinch" {
"hgrunt_anims\smflinch.smd"
fps 30
}
$sequence "fire_grenade" {
"hgrunt_anims\fire_grenade.smd"
fps 30
}
$sequence "notarget" {
"hgrunt_anims\notarget.smd"
fps 30
}
$sequence "idle1" {
"hgrunt_anims\idle1.smd"
fps 30
loop
}
$sequence "idle2" {
"hgrunt_anims\idle2.smd"
fps 30
loop
}
$sequence "reload" {
"hgrunt_anims\reload.smd"
{ event 1 43 }
fps 30
loop
}
$sequence "shootcycle" {
"hgrunt_anims\shootcycle.smd"
{ event 2 4 }
fps 30
loop
}
$sequence "frontkick" {
"hgrunt_anims\frontkick.smd"
{ event 3 14 }
fps 30
}
$sequence "swim" {
"hgrunt_anims\swim.smd"
fps 30
loop
}
$sequence "signal" {
"hgrunt_anims\signal.smd"
fps 30
}
$sequence "180L" {
"hgrunt_anims\180L.smd"
fps 30
}
$sequence "180R" {
"hgrunt_anims\180R.smd"
fps 30
}
$sequence "strafeleft" {
"hgrunt_anims\strafeleft.smd"
fps 40
loop
LX LY
}
$sequence "straferight" {
"hgrunt_anims\straferight.smd"
fps 40
loop
LX LY
}
`
i am trying to compile a hl1 alpha model and everytime i try to compile it, it gives this error:

` ********** ERROR **********
/reference.smd.smd doesn't exist
CROWBAR: Deleted empty temporary compile folder "C:\Users\Alexandre\Downloads\Half-Life_Alpha.1\Half-Life Alpha\valve\models\valve".
... Compiling ".\hgrunt.qc" finished. Check above for any errors.`

i tried editing the .qc file with notepad but nothing seems to fix it.
Posted 1 week ago2020-06-26 16:01:46 UTC
in hl1 weapon coding bug Post #344468
thanks! now my problem is fixed, sorry for my late response i've been busy with other things.
Posted 2 weeks ago2020-06-19 21:28:31 UTC
in hl1 weapon coding bug Post #344431
i also have a bug in which the weapon doesn't play the idle animation, but when i press the reload key or the right mouse key the idle animation plays.
Posted 2 weeks ago2020-06-19 21:12:20 UTC
in hl1 weapon coding bug Post #344430
#include "extdll.h"
#include "util.h"
#include "cbase.h"
#include "monsters.h"
#include "weapons.h"
#include "nodes.h"
#include "player.h"
#include "gamerules.h"

enum fuckfinger_e {
FUCKFINGER_IDLE = 0,
FUCKFINGER_SHOOT1,
FUCKFINGER_SHOOT2,
FUCKFINGER_RELOAD,
FUCKFINGER_RELOAD_NOSHOOT,
FUCKFINGER_DRAW,
FUCKFINGER_SHOOT_EMPTY,
FUCKFINGER_EMPTY_IDLE
};

LINK_ENTITY_TO_CLASS(weapon_fuckfinger, CFuckfinger);

void CFuckfinger::Spawn()
{
pev->classname = MAKE_STRING("weapon_fuckfinger");
Precache();
m_iId = WEAPON_FUCKFINGER;
SET_MODEL(ENT(pev), "models/w_fuckfinger.mdl");

m_iDefaultAmmo = FUCKFINGER_DEFAULT_GIVE;

FallInit();// get ready to fall
}

void CFuckfinger::Precache(void)
{
PRECACHE_MODEL("models/v_fuckfinger.mdl");
PRECACHE_MODEL("models/w_fuckfinger.mdl");
PRECACHE_MODEL("models/p_fuckfinger.mdl");

m_iShell = PRECACHE_MODEL("models/shell.mdl");// brass shell

PRECACHE_SOUND("items/9mmclip1.wav");

PRECACHE_SOUND("items/9mmclip1.wav");
PRECACHE_SOUND("items/9mmclip2.wav");
PRECACHE_SOUND("weapons/pl_gun3.wav");

m_usFireFuckfinger1 = PRECACHE_EVENT(1, "events/fuckfinger.sc");
m_usFireFuckfinger2 = PRECACHE_EVENT(1, "events/fuckfinger2.sc");
}

int CFuckfinger::GetItemInfo(ItemInfo *p)
{
p->pszName = STRING(pev->classname);
p->pszAmmo1 = "ammo_45";
p->iMaxAmmo1 = _45_MAX_CARRY;
p->pszAmmo2 = NULL;
p->iMaxAmmo2 = -1;
p->iMaxClip = FUCKFINGER_MAX_CLIP;
p->iSlot = 1;
p->iPosition = 3;
p->iFlags = 0;
p->iId = m_iId = WEAPON_FUCKFINGER;
p->iWeight = FUCKFINGER_WEIGHT;

return 1;
}

BOOL CFuckfinger::Deploy()
{
return DefaultDeploy("models/v_fuckfinger.mdl", "models/p_fuckfinger.mdl", FUCKFINGER_DRAW, "onehanded");
}

void CFuckfinger::SecondaryAttack(void)
{

void;

}

void CFuckfinger::PrimaryAttack()
{
// don't fire underwater
if (m_pPlayer->pev->waterlevel == 3)
{
PlayEmptySound();
m_flNextPrimaryAttack = UTIL_WeaponTimeBase() + 0.4;
return;
}

if (m_iClip <= 0)
{
if (!m_fFireOnEmpty)
Reload();
return;
}

m_pPlayer->m_iWeaponVolume = NORMAL_GUN_VOLUME;
m_pPlayer->m_iWeaponFlash = NORMAL_GUN_FLASH;

m_iClip--;

int flags;
#if defined( CLIENT_WEAPONS )
flags = FEV_NOTHOST;
#else
flags = 0;
#endif

m_pPlayer->pev->effects = (int)(m_pPlayer->pev->effects) | EF_MUZZLEFLASH;

// player "shoot" animation
m_pPlayer->SetAnimation(PLAYER_ATTACK1);

Vector vecSrc = m_pPlayer->GetGunPosition();
Vector vecAiming = m_pPlayer->GetAutoaimVector(AUTOAIM_5DEGREES);

Vector vecDir;
vecDir = m_pPlayer->FireBulletsPlayer(1, vecSrc, vecAiming, VECTOR_CONE_FUCKFINGER, 8192, BULLET_PLAYER_45, 0, 0, m_pPlayer->pev, m_pPlayer->random_seed);

PLAYBACK_EVENT_FULL(flags, m_pPlayer->edict(), m_usFireFuckfinger1, 0.0, (float *)&g_vecZero, (float *)&g_vecZero, vecDir.x, vecDir.y, 0, 0, 0, 0);

if (!m_iClip && m_pPlayer->m_rgAmmo[m_iPrimaryAmmoType] <= 0)
// HEV suit - indicate out of ammo condition
m_pPlayer->SetSuitUpdate("!HEV_AMO0", FALSE, 0);

m_flNextPrimaryAttack = 0.4;
m_flTimeWeaponIdle = UTIL_SharedRandomFloat(m_pPlayer->random_seed, 10, 15);
}

void CFuckfinger::Reload(void)
{
if (m_pPlayer->ammo_45 <= 0)
return;

int iResult;

if (m_iClip == 0)
iResult = DefaultReload(9, FUCKFINGER_RELOAD, 1.5);
else
iResult = DefaultReload(9, FUCKFINGER_RELOAD_NOSHOOT, 1.5);

if (iResult)
{
m_flTimeWeaponIdle + UTIL_SharedRandomFloat(m_pPlayer->random_seed, 10, 15);
}
}

void CFuckfinger::WeaponIdle(void)
{
ResetEmptySound();

m_pPlayer->GetAutoaimVector(AUTOAIM_10DEGREES);

if (m_flTimeWeaponIdle > UTIL_WeaponTimeBase())
return;

// only idle if the slid isn't back
if (m_iClip != 0)
{
int iAnim;
float flRand = UTIL_SharedRandomFloat(m_pPlayer->random_seed, 0, 1);

if (flRand <= 0.5)
{
iAnim = FUCKFINGER_IDLE;
m_flTimeWeaponIdle + 70.0 / 30.0;
}
else if (flRand <= 0.7)
{
iAnim = FUCKFINGER_IDLE;
m_flTimeWeaponIdle + 60.0 / 16.0;
}
else
{
iAnim = FUCKFINGER_IDLE;
m_flTimeWeaponIdle + 88.0 / 30.0;
}
SendWeaponAnim(iAnim, 1);
}
}

class CFuckfingerAmmo : public CBasePlayerAmmo
{
void Spawn(void)
{
Precache();
SET_MODEL(ENT(pev), "models/w_9mmarclip.mdl");
CBasePlayerAmmo::Spawn();
}
void Precache(void)
{
PRECACHE_MODEL("models/w_9mmarclip.mdl");
PRECACHE_SOUND("items/9mmclip1.wav");
}
BOOL AddAmmo(CBaseEntity *pOther)
{
if (pOther->GiveAmmo(AMMO_FUCKFINGERCLIP_GIVE, "ammo_45", _45_MAX_CARRY) != -1)
{
EMIT_SOUND(ENT(pev), CHAN_ITEM, "items/9mmclip1.wav", 1, ATTN_NORM);
return TRUE;
}
return FALSE;
}
};
LINK_ENTITY_TO_CLASS(ammo_fuckfingerclip, CFuckfingerAmmo);
Posted 2 weeks ago2020-06-19 17:11:16 UTC
in hl1 weapon coding bug Post #344426
so i recently created a new hl1 weapon, and everything seems to work properly, but i have a strange bug that sometimes when i press the reload button the reload animation doesn't play and the weapon reloads. how do i fix that?