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.
deny_post($poster);
You are not logged in. Please login or register.
Teeworlds Forum → Fan Art and Other → 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.
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.
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
sv_hook 0 turns on hook damage.
sv_hook no turns it off.
I don't mean the .cfg options, I mean the source code behind it.
Please read before you post, jon.
Also, isn't hook damage only available in some mod?
Yeah, the class mod by rahj. That is done in gs_server.cpp
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
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.
People need to read more.
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.
Really? That seems cool. I'll try it.
Whenever I try to open a file in eclipse it opens up in gedit instead.
you should open a new project in eclipse and specify the project folder to the current location of your teeworlds server.
Teeworlds Forum → Fan Art and Other → Hook functions
Powered by PunBB, supported by Informer Technologies, Inc.
Currently installed 3 official extensions. Copyright © 2003–2009 PunBB.