You could just override PrimaryAttack, do the trace yourself and do a [url=https://developer.valvesoftware.com/wiki/Decal#Standard]DecalTrace[/url] to paint the decal.
Ok. I think I've got it working. Will it work or is there any errors that I'm not picking up on?
[CODE]//-----------------------------------------------------------------------------
// Purpose:
// Output : Activity
//-----------------------------------------------------------------------------
Activity CWeaponSPRAYPAINT::GetPrimaryAttackActivity( void )
{
if ( m_nShotsFired > 0 )
{
UTIL_DecalTrace( &tr, "PaintSplash" );//TODO: Use real decal
};
return ACT_VM_RECOIL3;
}
//-----------------------------------------------------------------------------[/CODE]
For a start "tr" doesn't exist in the scope of that function.
It would seem to me that you'll need to learn some C++ before attempting to code a Source mod.
While some people have learned programming via trial and error, it's probably safer to read a proper introduction.
Trial and error are still good tools, but you can get a good headstart to make more educated guesses.
It will probably also improve your understanding about why code written in a certain way works, and in another won't, which will improve the code you write.
I don't know what guides are current, but a bunch of years back "Learn C++ in 21 days" (the title was changed at some point, you should be able to find it though) was the book that gave me a decent introduction. "Accelerated C++" was the suggestion of other people.
Make sure you get the latest revision and that it's not more than a couple of years old.
The C++ tutorials I saw on the internet don't seem suitable for someone who's starting out with programming, although many are written as such, but rather people who already know one language and want an introduction to another.
Sorry, you need to Log In to post a reply to this thread.