RE: [hlcoders] CreateMaterial, KeyValues...

2005-05-12 Thread Gary McTaggart
Here's an example from the HL2 code of making a material from code:

KeyValues *pVMTKeyValues = new KeyValues( UnlitGeneric );
pVMTKeyValues-SetInt( $flat, 1 );
pVMTKeyValues-SetFloat( $vertexcolor, 0.05f );
IMaterial *pDrawFlatMaterial = materials-CreateMaterial( ___flat.vmt, 
pVMTKeyValues );

Gary

 -Original Message-
 From: [EMAIL PROTECTED]
 [mailto:[EMAIL PROTECTED] On Behalf Of
 Ignacio Martín
 Sent: Wednesday, May 11, 2005 7:23 PM
 To: hlcoders@list.valvesoftware.com
 Subject: [hlcoders] CreateMaterial, KeyValues...

 --
 [ Picked text/plain from multipart/alternative ] Hi again. I
 have already succesfully finished the night vision using
 shaders. I have created a dummy vmt material (well, it is not
 actually dummy, as it has a variable used by the shader), but
 I do not want to give people the chance to cheat with it, so
 I think that the best choice is to create the material inside
 the code, thanks to the IMaterial *CreateMaterial( const char
 *pMaterialName, KeyValues *pVMTKeyValues ) function. I would
 bind it to my shader using void SetShader( const char
 *pShaderName ). The question comes now. How does KeyValues
 work? I mean, if I have this:

 My_shader
 {

 $var1 0.5
 $var2 1.5
 $var3 2
 $var4 1.7
 $var5 1
 }

 How can I create KeyValues to create that material? It may
 sound silly, but what is the relationship between Name and
 firstKey in the constructors?
 (are they parent-child?).
 In my example, if I set Name as My_shader, would be it
 enough for CreateMaterial to know which shader to use?
 Otherwise I would have to call SetShader.
 If I want to get a value, do I have to find firstKey? As I
 can guess, when I call functions like SetFloat or SetString,
 new keys are created as sub-keys, and stored at the end of
 that sub-key list. Isn´t it like that?
 As you see, I´m quite lost with KeyValues, hehe.

 Finally, the last question (at last!): does IMaterial
 *CreateMaterial( const char *pMaterialName, KeyValues
 *pVMTKeyValues ) store a reference to this material in
 materialsystem so that I can use materials-FindMaterial
 anywhere in my code?

 Thank you for your time

 Regards,

 Ignacio Martin

 FIRE WAR MOD - Spanish HL2 Modification
 www.firewar.net http://www.firewar.net
 --

 ___
 To unsubscribe, edit your list preferences, or view the list
 archives, please visit:
 http://list.valvesoftware.com/mailman/listinfo/hlcoders



___
To unsubscribe, edit your list preferences, or view the list archives, please 
visit:
http://list.valvesoftware.com/mailman/listinfo/hlcoders



RE: [hlcoders] Re: Re: 3 round

2005-05-12 Thread Tony \omega\ Sergi
Who was talking about switching while firing? The whole argument has been
about how burst works while you have it selected, I don't recall anyone
talking about switching to or from it.

I also don't believe it's possible to even switch while holding the trigger
down, because the trigger group would be locked. But I dunno for sure, and
I'm too lazy to look at the manual now.


-Original Message-
From: bob [mailto:[EMAIL PROTECTED]
Sent: May 11, 2005 11:39 PM
To: hlcoders@list.valvesoftware.com
Subject: [hlcoders] Re: Re: 3 round

What the man is saying is that in real life, if you switch to the burst
mode from automatic or any other selection that it starts counting and
doesn't reset until the next trigger release.

IE- if you depress the trigger, firing one shot, and switch to burst
without releasing you will only be able to fire 2 bullets the next time
you press the trigger down.

Every time there after you will be firing 3. unless you release the
trigger before they all come out.

--
No virus found in this outgoing message.
Checked by AVG Anti-Virus.
Version: 7.0.308 / Virus Database: 266.11.8 - Release Date: 10/05/2005



___
To unsubscribe, edit your list preferences, or view the list archives, please 
visit:
http://list.valvesoftware.com/mailman/listinfo/hlcoders



Re: [hlcoders] Modifying The Lost Cost

2005-05-12 Thread Draco
And I'd imagine you would just mount it's GCF and load it's
directories to use your mod with LC


--
Draco

___
To unsubscribe, edit your list preferences, or view the list archives, please 
visit:
http://list.valvesoftware.com/mailman/listinfo/hlcoders



[hlcoders] (HL1 Question) My gun doesn't accept custom ammo type

2005-05-12 Thread Draco
I previously was using the existing HL weapon ents as my weapons in my
mod, but they were recoded to be a completely different one. This
looked stupid in the console Draco has killed SomeGuy with Squeak
when I shot them with a silenced pistol;) . I found out how to
actually get your own weapons working, So I tried it, my first one, a
little SMG, worked well, even used a new ammo type. Now came time to
convert another over, not so good this time. Using the same code,
names changed from Cyclone to AR34 and the weapon selection
position set on more than  the last, same code otherwise, and when I
go to play it, the gun can't be switched to. I ended u dropping all
other guns to see it, the ammo hud said 0 in clip, 0 in reserve, and
the gun just keeps trying to reload.

I have tried for the last 2 days to get this bastard to work, any ideas?

Here's my ar34.cpp


-
#include extdll.h
#include util.h
#include cbase.h
#include monsters.h
#include weapons.h
#include nodes.h
#include player.h
#include soundent.h
#include gamerules.h

enum ar34_e
{
AR34_IDLE = 0,
AR34_FIRE,
AR34_RELOAD,
AR34_DRAW,
AR34_DOWN
};



LINK_ENTITY_TO_CLASS( weapon_ar34, CAR34 );

void CAR34::Spawn( )
{
pev-classname = MAKE_STRING(weapon_ar34); // hack to allow for old 
names
Precache( );
SET_MODEL(ENT(pev), models/w_ar34.mdl);
m_iId = WEAPON_AR34;

m_iDefaultAmmo = AR34_DEFAULT_GIVE;

FallInit();// get ready to fall down.
}


void CAR34::Precache( void )
{
PRECACHE_MODEL(models/v_ar34.mdl);
PRECACHE_MODEL(models/w_ar34.mdl);
PRECACHE_MODEL(models/p_ar34.mdl);

m_iShell = PRECACHE_MODEL (models/shell.mdl);// brass shellTE_MODEL
m_iClipModel = PRECACHE_MODEL (models/w_9mmARclip.mdl);//clip model

PRECACHE_MODEL(models/w_9mmARclip.mdl);

PRECACHE_SOUND( ar34/ar34_fire.wav );
PRECACHE_SOUND( ar34/ar34_reload.wav );

PRECACHE_SOUND (weapons/357_cock1.wav);

m_usAr34Fire = PRECACHE_EVENT( 1, events/ar34.sc );
}

int CAR34::GetItemInfo(ItemInfo *p)
{
p-pszName = STRING(pev-classname);
p-pszAmmo1 = Automatics;
p-iMaxAmmo1 = AR34_MAX_CARRY;
p-pszAmmo2 = NULL;
p-iMaxAmmo2 = 0;
p-iMaxClip = AR34_MAX_CLIP;
p-iSlot = 3;
p-iPosition = 4;
p-iFlags = 0;
p-iId = m_iId = WEAPON_AR34;
p-iWeight = AR34_WEIGHT;

return 1;
}

int CAR34::AddToPlayer( CBasePlayer *pPlayer )
{
if ( CBasePlayerWeapon::AddToPlayer( pPlayer ) )
{
return TRUE;
}
return FALSE;
}

BOOL CAR34::Deploy( )
{
return DefaultDeploy( models/v_ar34.mdl, models/p_ar34.mdl,
AR34_DRAW, onehanded );
}


void CAR34::PrimaryAttack()
{
if (m_iClip = 0)
{
PlayEmptySound();
m_flNextPrimaryAttack = 0.15;
return;
}

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

m_iClip--;


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 = m_pPlayer-FireBulletsPlayer( 1, vecSrc, vecAiming,
VECTOR_CONE_6DEGREES, 8192, BULLET_PLAYER_MP5, 2, 0, m_pPlayer-pev,
m_pPlayer-random_seed );

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

//  PLAYBACK_EVENT_FULL( flags, m_pPlayer-edict(), m_usAr34Fire, 0.0,
(float *)g_vecZero, (float *)g_vecZero, vecDir.x, vecDir.y, 0, 0, 0,
0 );

m_flNextPrimaryAttack = UTIL_WeaponTimeBase() + 0.1;

m_flNextSecondaryAttack = UTIL_WeaponTimeBase() + 0.1;
}


void CAR34::SecondaryAttack( void )
{

}

void CAR34::Reload( void )
{
if ( m_pPlayer-ammo_automatic = 0 )
return;

DefaultReload( AR34_MAX_CLIP, AR34_RELOAD, 2 );
if (m_iClip != AR34_MAX_CLIP)
{
UTIL_MakeVectors( m_pPlayer-pev-v_angle + 
m_pPlayer-pev-punchangle );
Vector  vecShellVelocity = m_pPlayer-pev-velocity
 + gpGlobals-v_right * 
RANDOM_FLOAT(-10,10)
 + gpGlobals-v_up * 0
 + gpGlobals-v_forward * 23;
EjectBrass ( pev-origin + m_pPlayer-pev-view_ofs +
gpGlobals-v_up * -22 + gpGlobals-v_forward * 10 + gpGlobals-v_right
* 2 , vecShellVelocity, pev-angles.x, m_iClipModel, TE_BOUNCE_SHELL
);
}
}


void CAR34::WeaponIdle( void )
{

Re: [hlcoders] Re: Re: 3 round

2005-05-12 Thread SB Childe Roland
Damn, don't get pissed at him.  What did he do to you??

Can't we all just get along?

On 5/12/05, Tony omega Sergi [EMAIL PROTECTED] wrote:
 Who was talking about switching while firing? The whole argument has been
 about how burst works while you have it selected, I don't recall anyone
 talking about switching to or from it.

 I also don't believe it's possible to even switch while holding the trigger
 down, because the trigger group would be locked. But I dunno for sure, and
 I'm too lazy to look at the manual now.


 -Original Message-
 From: bob [mailto:[EMAIL PROTECTED]
 Sent: May 11, 2005 11:39 PM
 To: hlcoders@list.valvesoftware.com
 Subject: [hlcoders] Re: Re: 3 round

 What the man is saying is that in real life, if you switch to the burst
 mode from automatic or any other selection that it starts counting and
 doesn't reset until the next trigger release.

 IE- if you depress the trigger, firing one shot, and switch to burst
 without releasing you will only be able to fire 2 bullets the next time
 you press the trigger down.

 Every time there after you will be firing 3. unless you release the
 trigger before they all come out.

 --
 No virus found in this outgoing message.
 Checked by AVG Anti-Virus.
 Version: 7.0.308 / Virus Database: 266.11.8 - Release Date: 10/05/2005


 ___
 To unsubscribe, edit your list preferences, or view the list archives, please 
 visit:
 http://list.valvesoftware.com/mailman/listinfo/hlcoders




--
=
SB Childe Roland
I will show you fear in a handful of jellybeans.

___
To unsubscribe, edit your list preferences, or view the list archives, please 
visit:
http://list.valvesoftware.com/mailman/listinfo/hlcoders



Re: [hlcoders] Modifying The Lost Cost

2005-05-12 Thread NuclearFriend
--
[ Picked text/plain from multipart/alternative ]
HDR will be a feature of the Source Engine, thus I'd say anything written
that uses the source engine will support it. This includes all mods.

On 5/12/05, Draco [EMAIL PROTECTED] wrote:

 And I'd imagine you would just mount it's GCF and load it's
 directories to use your mod with LC

 --
 Draco

 ___
 To unsubscribe, edit your list preferences, or view the list archives,
 please visit:
 http://list.valvesoftware.com/mailman/listinfo/hlcoders




--
Programmer for RnL
www.resistanceandliberation.com http://www.resistanceandliberation.com
--

___
To unsubscribe, edit your list preferences, or view the list archives, please 
visit:
http://list.valvesoftware.com/mailman/listinfo/hlcoders



RE: [hlcoders] Modifying The Lost Cost

2005-05-12 Thread Mike Dussault
The SDK will be updated around the time when the lost coast is released.
If you follow the steps in our source control doc
(http://www.valve-erc.com/srcsdk/Code/SourceControl/SourceControl.html),
then you can start using the current SDK now and you will be able to
integrate the changes that lost coast includes easily.

-Original Message-
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of Adam
amckern Mckern
Sent: Wednesday, May 11, 2005 6:03 PM
To: hlcoders@list.valvesoftware.com
Subject: [hlcoders] Modifying The Lost Cost

I'm just wondering what people needs to do, to be able to mod The Lost
Coast when its out in a few months.

I'm only going on the PCG interview, but what are the
4 Levels that are used in the textures?

Second, will there be a sdk, or will teams just be able to add maps?

Will HDR be ported to d0d:s, cs:s, hl2/dm, etc?

I'm just trying to work out what code base to build my mod on, and the
more infomation i have the better informed my choices

Thanks

Adam

http://ammahls.com




__
Yahoo! Mail Mobile
Take Yahoo! Mail with you! Check email on your mobile phone.
http://mobile.yahoo.com/learn/mail

___
To unsubscribe, edit your list preferences, or view the list archives,
please visit:
http://list.valvesoftware.com/mailman/listinfo/hlcoders


___
To unsubscribe, edit your list preferences, or view the list archives, please 
visit:
http://list.valvesoftware.com/mailman/listinfo/hlcoders



RE: [hlcoders] Re: Re: 3 round

2005-05-12 Thread Tony \omega\ Sergi
Where am I getting pissed at him? By asking a question about what he's
talking about? ;p


-Original Message-
From: SB Childe Roland [mailto:[EMAIL PROTECTED]
Sent: May 12, 2005 9:07 AM
To: hlcoders@list.valvesoftware.com
Subject: Re: [hlcoders] Re: Re: 3 round

Damn, don't get pissed at him.  What did he do to you??

Can't we all just get along?

--
No virus found in this outgoing message.
Checked by AVG Anti-Virus.
Version: 7.0.308 / Virus Database: 266.11.8 - Release Date: 10/05/2005



___
To unsubscribe, edit your list preferences, or view the list archives, please 
visit:
http://list.valvesoftware.com/mailman/listinfo/hlcoders



Re: [hlcoders] Re: 3 round burst

2005-05-12 Thread tei
Man, I love this mail list.
What will be the next topic? home made fision bombs?
:DDD
McCormack, Chris wrote:
hehe this thread is insane, I think some of the contributors may possibly be on 
FBI watch lists :P
-Original Message-
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] Behalf Of Michael A.
Hobson
Sent: 11 May 2005 06:11
To: hlcoders@list.valvesoftware.com
Subject: Re: [hlcoders] Re: 3 round burst
root 3:16,
Just for once, maybe you could stop pretending to be the all-knowing
infallible font of knowledge you seem to think you are as demonstrated
by at least half your posts to this list ?
At 08:55 PM 5/10/2005, you wrote:
 3 sites I went to .org's .mils have the same thing it fires 3 rounds
automatically in burst mode.
http://www.au.af.mil/au/awc/systems/dvic534.htm

Link above is not to an actual training manual, wherein one might
learn all the subtle nuances of the weapon.
Are you suggesting that some random web pages are superior in
authority to an actual scanned *US MARINE CLASS TRAINING
MANUAL* ???

At any rate, I have shot the M16A2, when you pull and release it fires 3
rounds. Regardless if you pull and hold the trigger or just pull and release
the trigger.

Did you actually try to make it cut the bursts short ?
Why do I find that hard to believe?
I shall now quote from page 4 (top paragraph) of the M16A2 MILSPEC
document for the M16A2 Assault Rifle:  MIL-R-63997B(AR) MILITARY
SPECIFICATION  Rifle, 5.56mm: M16A2, which is
available from Armalite (the AR in AR-15) at the following URL:
 http://www.ar15.com/content/manuals/m16a2milspec.pdf
quote:
 ...  When the selector is placed in the BURST
 position, it shall permit the automatic sear to engage the hammer,
 so that the rifle is capable of burst firing.  (One, two, or three
 continuous sh[[... NO CARRIER
___
To unsubscribe, edit your list preferences, or view the list archives, please 
visit:
http://list.valvesoftware.com/mailman/listinfo/hlcoders


Re: [hlcoders] Re: 3 round burst

2005-05-12 Thread SB Childe Roland
SSS.  THEY are listening... looks over his shoulder

On 5/12/05, tei [EMAIL PROTECTED] wrote:
 Man, I love this mail list.

 What will be the next topic? home made fision bombs?

 :DDD

 McCormack, Chris wrote:
  hehe this thread is insane, I think some of the contributors may possibly 
  be on FBI watch lists :P
 
  -Original Message-
  From: [EMAIL PROTECTED]
  [mailto:[EMAIL PROTECTED] Behalf Of Michael A.
  Hobson
  Sent: 11 May 2005 06:11
  To: hlcoders@list.valvesoftware.com
  Subject: Re: [hlcoders] Re: 3 round burst
 
 
  root 3:16,
 
  Just for once, maybe you could stop pretending to be the all-knowing
  infallible font of knowledge you seem to think you are as demonstrated
  by at least half your posts to this list ?
 
  At 08:55 PM 5/10/2005, you wrote:
 
   3 sites I went to .org's .mils have the same thing it fires 3 rounds
 
 automatically in burst mode.
 
 http://www.au.af.mil/au/awc/systems/dvic534.htm
 
 
  Link above is not to an actual training manual, wherein one might
  learn all the subtle nuances of the weapon.
 
  Are you suggesting that some random web pages are superior in
  authority to an actual scanned *US MARINE CLASS TRAINING
  MANUAL* ???
 
 
 At any rate, I have shot the M16A2, when you pull and release it fires 3
 rounds. Regardless if you pull and hold the trigger or just pull and release
 the trigger.
 
 
  Did you actually try to make it cut the bursts short ?
 
  Why do I find that hard to believe?
 
  I shall now quote from page 4 (top paragraph) of the M16A2 MILSPEC
  document for the M16A2 Assault Rifle:  MIL-R-63997B(AR) MILITARY
  SPECIFICATION  Rifle, 5.56mm: M16A2, which is
  available from Armalite (the AR in AR-15) at the following URL:
 
   http://www.ar15.com/content/manuals/m16a2milspec.pdf
 
  quote:
   ...  When the selector is placed in the BURST
   position, it shall permit the automatic sear to engage the hammer,
   so that the rifle is capable of burst firing.  (One, two, or three
   continuous sh[[... NO CARRIER

 ___
 To unsubscribe, edit your list preferences, or view the list archives, please 
 visit:
 http://list.valvesoftware.com/mailman/listinfo/hlcoders




--
=
SB Childe Roland
I will show you fear in a handful of jellybeans.

___
To unsubscribe, edit your list preferences, or view the list archives, please 
visit:
http://list.valvesoftware.com/mailman/listinfo/hlcoders



[hlcoders] Attaching Physics Objects to Players

2005-05-12 Thread Michael Kramer
Ok, I have created it so that you can attach physics objects to
players...but when you do the player is stuck and can no longer
move...if you attach the physics objects to another object it can move
fine following that other object (this is for DM by the way) anyone
know why attaching a physics object to another player would make it so
they could not walk?

Thanx :D

___
To unsubscribe, edit your list preferences, or view the list archives, please 
visit:
http://list.valvesoftware.com/mailman/listinfo/hlcoders



RE: [hlcoders] Modifying The Lost Cost

2005-05-12 Thread Adam \amckern\ Mckern
Thanks to everyone

Mike, i will do so with the code, and work from there,
seeing the mod is a free flowing single player
enviroment, the lost coast, will prove to be a good
test on my ideas

Adam


--- Mike Dussault [EMAIL PROTECTED] wrote:
 The SDK will be updated around the time when the
 lost coast is released.
 If you follow the steps in our source control doc

(http://www.valve-erc.com/srcsdk/Code/SourceControl/SourceControl.html),
 then you can start using the current SDK now and you
 will be able to
 integrate the changes that lost coast includes
 easily.

 -Original Message-
 From: [EMAIL PROTECTED]
 [mailto:[EMAIL PROTECTED] On
 Behalf Of Adam
 amckern Mckern
 Sent: Wednesday, May 11, 2005 6:03 PM
 To: hlcoders@list.valvesoftware.com
 Subject: [hlcoders] Modifying The Lost Cost

 I'm just wondering what people needs to do, to be
 able to mod The Lost
 Coast when its out in a few months.

 I'm only going on the PCG interview, but what are
 the
 4 Levels that are used in the textures?

 Second, will there be a sdk, or will teams just be
 able to add maps?

 Will HDR be ported to d0d:s, cs:s, hl2/dm, etc?

 I'm just trying to work out what code base to build
 my mod on, and the
 more infomation i have the better informed my
 choices

 Thanks

 Adam

 http://ammahls.com




 __
 Yahoo! Mail Mobile
 Take Yahoo! Mail with you! Check email on your
 mobile phone.
 http://mobile.yahoo.com/learn/mail

 ___
 To unsubscribe, edit your list preferences, or view
 the list archives,
 please visit:

http://list.valvesoftware.com/mailman/listinfo/hlcoders


 ___
 To unsubscribe, edit your list preferences, or view
 the list archives, please visit:

http://list.valvesoftware.com/mailman/listinfo/hlcoders



http://ammahls.com




__
Yahoo! Mail Mobile
Take Yahoo! Mail with you! Check email on your mobile phone.
http://mobile.yahoo.com/learn/mail

___
To unsubscribe, edit your list preferences, or view the list archives, please 
visit:
http://list.valvesoftware.com/mailman/listinfo/hlcoders