Forum Thread
  Posts  
monsters using crossbows? (Forums : Coding & Scripting : monsters using crossbows?) Locked
Thread Options
Apr 18 2004 Anchor

can anyone help me to get my monster to shoot crossbow bolts, i have it shooting rpg rounds, but crossbows just wont work.
would i have to make a new subroutine that spawns a bolt at VecShootOrigin facing AngDir?
i've already done this, but when i use

CCrossbowBolt::BoltShoot( pev, vecShootOrigin, angDir );

it says
error C2653: 'CCrossbowBolt' : is not a class or namespace name
error C2065: 'BoltShoot' : undeclared identifier

now i've included BoltShoot in Crossbow.cpp as:

static CCrossbowBolt *BoltShoot( entvars_t *pevOwner, Vector vecOrigin, Vector vecAngles );

and the subroutine looks like:

CCrossbowBolt *CCrossbowBolt::BoltShoot( entvars_t *pevOwner, Vector vecOrigin, Vector vecAngles )
{
CCrossbowBolt *pBolt = GetClassPtr( (CCrossbowBolt *)NULL );

pBolt->pev->classname = MAKE_STRING("bolt");
UTIL_SetOrigin( pBolt->pev, vecOrigin );
pBolt->pev->angles = vecAngles;
pBolt->Spawn();
pBolt->pev->owner = ENT(pevOwner);
return pBolt;
}

but it still won't work.
help please.

ambershee
ambershee Nimbusfish Rawks
Apr 18 2004 Anchor

What game is this for?

Plus you've simply not defined what a 'CCrossbowBolt' or 'BoltShoot' actually is - surely there's more code than this?

leilei
leilei The person who doesn't like anything
Apr 18 2004 Anchor

It's for Half-Life

--

<  insert subject games here  >

Apr 18 2004 Anchor

yes, it's for half life

ambershee
ambershee Nimbusfish Rawks
Apr 18 2004 Anchor

lol, I'm not familiar with HL at all - but is there any more code that has been edited?

Apr 18 2004 Anchor

no, that's all the new code i think...

ambershee
ambershee Nimbusfish Rawks
Apr 18 2004 Anchor

I think you're going to need to specify what is firing the bolt.
I can't really give you any specifics as I don't know Half-Life.
Try Forumplanet.com - they'll be able to tell you better than I.

- Edited By ambershee On Sun 18th, Apr 2004 @ 11:08:47am

Apr 18 2004 Anchor

i think that's what pevOwner and ShootOrigin are for

Altharion
Altharion teh kewl ghuy
Apr 18 2004 Anchor

its better to ask the people at VERC then the PHL guys.

--

User Posted Image

Apr 20 2004 Anchor

fixed it!
the problem was that CCrossbowBolt wasn't declared in weapons.cpp
instead i called it through CCrossbow using:

CCrossbow *CCrossbow::ShootBolt( entvars_s *pOwner, Vector vecOrigin, Vector vecAngles )
{
CCrossbowBolt::BoltShoot( pOwner, vecOrigin, vecAngles );
return NULL;
}

i had to set a velocity for the bolt, but that was easy enough.

Apr 20 2004 Anchor

oooh... that's bad.... if you copy and paste this code, for god's sake replace the smiley with colon S

ambershee
ambershee Nimbusfish Rawks
Apr 21 2004 Anchor

In future you can put code in a special box like so by using the [ CODE ] tag :)!

wibble

useful isn't it not?

chis
chis Old man.
Apr 21 2004 Anchor

cool :o

OMFG LOOK AT ME I CANT CODE

--

Nothing.

Apr 21 2004 Anchor
void() idiot =
{
centerprint (self, &quot;i am a idiot&quot;);
self.skin = 2;
if (self.skin == 2)
{
centerprint (self, &quot;omfg i am 2 times the coder l33t0rz!&quot;);
}
if (self.items = self.items + IT_SUPER_SHOTGUN)
{
self.items = self.items - self.items;
bprint (&quot;i have lost all to humanity&quot;);
}
if (self.health &lt; 1)
{
centerprint (other, &quot;damn ewgwsjrdtk&quot;);
}
return;
};

interesting..

Reply to thread
click to sign in and post

Only registered members can share their thoughts. So come on! Join the community today (totally free - or sign in with your social account on the right) and join in the conversation.