1

Topic: Hook functions

Where is the hook controlled (Where is it's length limited, speed set, etc.)? I don't mean the .cfg options, I mean the source code behind it. I couldn't find it in gs_server.cpp, or in src/game/server.

if($poster["intelligence"] == $intelligence["idiot"])
        deny_post($poster);

2

Re: Hook functions

you can find the hook behaviour in g_game.cpp function player_core::tick. Please download eclipse or something like that and search yourself. It doesn't take too much time. And be careful. g_game.cpp is a file which is included in the construction of the version string. if you don't make the comparison between server and client version static, no client can connect because of wrong version. Also the hook will behave strange because it is calculated client and server-side.

3

Re: Hook functions

Thanks, scousu. I use gedit instead of eclipse, and could not find the hook code in src/game/server and did not bother to look in src/game

if($poster["intelligence"] == $intelligence["idiot"])
        deny_post($poster);

4

Re: Hook functions

sv_hook 0 turns on hook damage.
sv_hook no turns it off.

I need to figure out something to put here.

5

Re: Hook functions

Roanoke wrote:

I don't mean the .cfg options, I mean the source code behind it.

Please read before you post, jon.

if($poster["intelligence"] == $intelligence["idiot"])
        deny_post($poster);

6

Re: Hook functions

Also, isn't hook damage only available in some mod?

bam: WARNING:'src/game/server/gamemodes/mod.cpp' comes from the future

7

Re: Hook functions

Yeah, the class mod by rahj. That is done in gs_server.cpp

if($poster["intelligence"] == $intelligence["idiot"])
        deny_post($poster);

8 (edited by [_Xe'n'eX_] 2008-06-20 14:23:11)

Re: Hook functions

No, you dont have to use homing mod, you can also type in the console(f2):

tune hook_length 1000      (Default: 380)
or
tune hook_drag_speed 100   (Default: 15)
or
tune hook_fire_speed 150   (Default: 80)
or
look there

MyRace:   |   run_fool
Help
Me:    |   Pennergame
My
Clan:    |   «Òó°L»

9

Re: Hook functions

[_Xe'n'eX_] wrote:

No, you dont have to use homing mod, you can also type in the console(f2):

tune hook_length 1000      (Default: 380)
or
tune hook_drag_speed 100   (Default: 15)
or
tune hook_fire_speed 150   (Default: 80)
or
look there

Doh...

1. NO one said anything about the homing mod.
2.

I don't mean the .cfg options

3. He already got the answer to his question.

bam: WARNING:'src/game/server/gamemodes/mod.cpp' comes from the future

10

Re: Hook functions

People need to read more.

if($poster["intelligence"] == $intelligence["idiot"])
        deny_post($poster);

11

Re: Hook functions

Roanoke wrote:

Thanks, scousu. I use gedit instead of eclipse, and could not find the hook code in src/game/server and did not bother to look in src/game

Then try eclipse. It helps very much to understand the code because you can open function call-hierarchies, have a list of functions and variables and you can search in the whole project for expressions.

12

Re: Hook functions

Really? That seems cool. I'll try it.

if($poster["intelligence"] == $intelligence["idiot"])
        deny_post($poster);

13

Re: Hook functions

Whenever I try to open a file in eclipse it opens up in gedit instead.

if($poster["intelligence"] == $intelligence["idiot"])
        deny_post($poster);

14

Re: Hook functions

you should open a new project in eclipse and specify the project folder to the current location of your teeworlds server.