sdk - adding abilities like fast shootin Created 14 years ago2010-07-23 07:46:06 UTC by ninja defuse ninja defuse

Created 14 years ago2010-07-23 07:46:06 UTC by ninja defuse ninja defuse

Posted 14 years ago2010-07-23 07:51:42 UTC Post #283352
@all
hello i got the idea, player skills and augmentations, you can only have one active skill, what is your opinion??
  • fast shoot
  • speed enhancement
  • regeneration
  • environmental resistance

@coders
i think it is not so hard to implement, so far i have a few problems with compilator errors and i have no idea what is going on :o the new ability class compiles without any problems but error occurs just after including the class in player.h and player.cpp >.>

ok, this is what i have written:
CPlayerAbilities.h -> http://www.copypastecode.com/33092/
CPlayerAbilities.cpp -> http://www.copypastecode.com/33096/

and now in shotgun.cpp change:
m_flNextPrimaryAttack = UTIL_WeaponTimeBase() + 0.75;
m_flNextSecondaryAttack = UTIL_WeaponTimeBase() + 0.75;
to:
[quote]
if( m_pPlayer->GetPlayerAbilities().HasEnabledAbility( FAST_SHOOT ) )
{
m_flNextPrimaryAttack = UTIL_WeaponTimeBase() + 0.75 / 2;
m_flNextSecondaryAttack = UTIL_WeaponTimeBase() + 0.75 / 2;
}

else
m_flNextPrimaryAttack = UTIL_WeaponTimeBase() + 0.75;
m_flNextSecondaryAttack = UTIL_WeaponTimeBase() + 0.75;
[/quote]

i have also added in player.h, under float m_flNextChatTime;
[quote]
CPlayerAbilities& GetPlayerAbilities( void ) { return m_playerAbilities; }

private:
CPlayerAbilities m_playerAbilities;
[/quote]

there are a few things more...
errors:
-------------------Configuration: hl - Win32 Profile-------------------
Compiling...
player.cpp
D:\Half Life SDK\Single-Player Source\dlls\player.h(318) : error C2079: 'm_playerAbilities' uses undefined class 'CPlayerAbilities'
D:\Half Life SDK\Single-Player Source\dlls\player.cpp(2870) : error C2228: left of '.SetPlayer' must have class/struct/union type
D:\Half Life SDK\Single-Player Source\dlls\player.cpp(2871) : error C2228: left of '.EnableAbility' must have class/struct/union type
Error executing cl.exe.

player.obj - 3 error(s), 0 warning(s)
Posted 14 years ago2010-07-23 10:03:56 UTC Post #283354
so far i have a few problems with compilator errors
What the hell has my Compilator to do with what you're to achieve? For your information, the Compilator (which i have created) is a frontend for CSG, BSP, VIS and RAD and HLFix as well).

I think you're mixing things up, dude.
Posted 14 years ago2010-07-23 10:21:00 UTC Post #283355
hmm i made a mistake:
should be "compiler" couse in my language compiler goes "kompilator" so i wrote "compilator"

and i am not mixing things up Bob.
Posted 14 years ago2010-09-26 13:04:30 UTC Post #285755
Error #1: It appears you haven't declared the type CPlayerAbilities, or you haven't declared it before you reference it. In the first case, you have do create the CPlayerAbilities class. In the second case, try putting class CPlayerAbilities; at the top of player.h, or move the CPlayerAbilities declaration. If this does not help you, post
a few things more...
Oskar Potatis Oskar Potatis🦔
Posted 14 years ago2010-09-26 13:04:41 UTC Post #285756
yea i got it working some time ago but i am not interested anymore

close topic.
You must be logged in to post a response.