Raised This Month: $ Target: $400
 0% 

Counter-Strike SDK


Post New Thread Reply   
 
Thread Tools Display Modes
joropito
AlliedModders Donor
Join Date: Mar 2009
Location: pfnAddToFullPack
Old 04-03-2010 , 12:13   Re: Counter-Strike SDK
Reply With Quote #31

Thanks.

FYI and from hlsdk:

m_flOffsetPlayer100 -> m_flNextObserverInput
I found observer.cpp only on ricochet & dmc
__________________

Divide et vinces
approved plugins | steam account

I don't accept PM for support. Just ask on forums.
If you're looking for private work, PM me.
joropito is offline
Send a message via MSN to joropito
Arkshine
AMX Mod X Plugin Approver
Join Date: Oct 2005
Old 04-03-2010 , 12:32   Re: Counter-Strike SDK
Reply With Quote #32

Nice catch.

Will take a look too.
__________________
Arkshine is offline
ConnorMcLeod
Veteran Member
Join Date: Jul 2006
Location: France (95)
Old 04-04-2010 , 01:49   Re: Counter-Strike SDK
Reply With Quote #33

Code:
        else if ( m_afButtonPressed & IN_FORWARD )
Shoud rather be IN_ATTACK2

Observer_FindNextPlayer( 1, 0 )
First param could be something like Next/Previous, and i think that 2nd param could be about allowed players, like team specific param.
__________________
- tired and retired -

- my plugins -
ConnorMcLeod is offline
Arkshine
AMX Mod X Plugin Approver
Join Date: Oct 2005
Old 04-04-2010 , 05:25   Re: Counter-Strike SDK
Reply With Quote #34

It's weird because I see for both linux/window IDA output "& 8" ; but it makes sens it should be IN_ATTACK2. ( EDIT : Ah I think I know why )

About the last param, the type is a string, it seems to be an optional param to search directly a player by its name. Looking at the function I see a check done in a loop with this param and m_hObserverTarget->pev->netname.

Anyway it should look now like :

Code:
#define OBS_NONE          0 #define OBS_CHASE_LOCKED  1 #define OBS_CHASE_FREE    2 #define OBS_ROAMING       3         #define OBS_IN_EYE        4 #define OBS_MAP_FREE      5 #define OBS_MAP_CHASE     6 void CBasePlayer::Observer_HandleButtons() {     if ( m_flNextObserverInput > gpGlobals->time )     {         return;     }     if ( m_afButtonPressed & IN_JUMP )     {         int mode;                 switch ( pev->iuser1 )         {             case OBS_CHASE_LOCKED :             case OBS_CHASE_FREE   : mode = OBS_IN_EYE;             case OBS_IN_EYE       : mode = OBS_ROAMING;             case OBS_ROAMING      : mode = OBS_MAP_FREE;             case OBS_MAP_FREE     : mode = OBS_MAP_CHASE;             default               : mode = m_fObserverAutoDirector ? OBS_CHASE_LOCKED : OBS_CHASE_FREE;         }               Observer_SetMode( mode );     }         if ( m_afButtonPressed & IN_ATTACK )     {         Observer_FindNextPlayer( FALSE );     }     else if ( m_afButtonPressed & IN_ATTACK2 )     {         Observer_FindNextPlayer( TRUE );     }         m_flNextObserverInput = gpGlobals->time + 0.2; }
__________________

Last edited by Arkshine; 04-04-2010 at 06:46.
Arkshine is offline
joropito
AlliedModders Donor
Join Date: Mar 2009
Location: pfnAddToFullPack
Old 04-04-2010 , 11:13   Re: Counter-Strike SDK
Reply With Quote #35

From cl_dll/hud_spectator.cpp
PHP Code:
FindNextPlayer( (ButtonPressed IN_ATTACK2) ? true:false ); 
I wonder if you, Arkshine, are getting only assembler code with IDA or something else that can help to move it to C.

It was hard to my to understand the structure of the decompiled code.
__________________

Divide et vinces
approved plugins | steam account

I don't accept PM for support. Just ask on forums.
If you're looking for private work, PM me.
joropito is offline
Send a message via MSN to joropito
Arkshine
AMX Mod X Plugin Approver
Join Date: Oct 2005
Old 04-04-2010 , 11:36   Re: Counter-Strike SDK
Reply With Quote #36

For sure, we can reduce the code like that. I know there are some functions which are taken from the Client and modified on the server like StudioEstimateGait().

I'm not enough crazy to try to decompile from the disassembled code !! I don't have the knowledge to start ( even though I've read severals asm tutorials ). I'm using a decompiler provided with IDA which greatly help by given a nearly C output. Even with that, it takes a lot of time to understand because the output is often weird and you have to read carefully, following the goto, thinking if the structure is right, filtering between virtual functions, entities data, etc., switching between windows/linux decompiled binary because the output differs and you can have an output more pertinent than the other. For example CBasePlayer::Killed() takes me ~2h ( without counting the time to search what does some things ), though I have to finish one part yet. So, you can imagine without decompiled code it would take so much more time.

By the way, I'm thinking to actually try to reproduce a decent SDK with header and such, so I could use Doxygen to generate a documentation system like we can see for metamod. This way it would be better to see the relations and references. I wanted to do that manually but the forum or the wiki suck as hell. I think it's a more appropriate solution instead of posting like I do.
__________________

Last edited by Arkshine; 04-04-2010 at 11:45.
Arkshine is offline
EXteRmiNaToR
Senior Member
Join Date: Dec 2009
Old 04-04-2010 , 11:56   Re: Counter-Strike SDK
Reply With Quote #37

Quote:
Originally Posted by Arkshine View Post
By the way, I'm thinking to actually try to reproduce a decent SDK with header and such, so I could use Doxygen to generate a documentation system like we can see for metamod. This way it would be better to see the relations and references. I wanted to do that manually but the forum or the wiki suck as hell. I think it's a more appropriate solution instead of posting like I do.
It's the best that way!
EXteRmiNaToR is offline
joropito
AlliedModders Donor
Join Date: Mar 2009
Location: pfnAddToFullPack
Old 04-04-2010 , 12:12   Re: Counter-Strike SDK
Reply With Quote #38

Another way is to start a Google Code project and put all together in SVN to you can upload updates with revision control.
You have code parsing and you can search inside the SVN too so it's very useful.
__________________

Divide et vinces
approved plugins | steam account

I don't accept PM for support. Just ask on forums.
If you're looking for private work, PM me.

Last edited by joropito; 04-04-2010 at 12:15.
joropito is offline
Send a message via MSN to joropito
Arkshine
AMX Mod X Plugin Approver
Join Date: Oct 2005
Old 04-04-2010 , 12:23   Re: Counter-Strike SDK
Reply With Quote #39

In waiting to have more file and a good structure to use Doxygen, I could use for sure a Google Code project so people could help more easily, especially people knowing very well C/C++ who could fix easily typos/errors and such. Thanks for the suggestions.
__________________

Last edited by Arkshine; 04-04-2010 at 12:29.
Arkshine is offline
Seta00
The Seta00 user has crashed.
Join Date: Jan 2010
Location: Berlin
Old 04-04-2010 , 15:04   Re: Counter-Strike SDK
Reply With Quote #40

Quote:
Originally Posted by Arkshine View Post
In waiting to have more file and a good structure to use Doxygen, I could use for sure a Google Code project so people could help more easily, especially people knowing very well C/C++ who could fix easily typos/errors and such. Thanks for the suggestions.
I support this completely.
By the way:
Quote:
Originally Posted by multiplayer_gamerules.cpp:310
m_iNumEscapers = 0
missing a semicolon.
Seta00 is offline
Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 10:37.


Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Theme made by Freecode