1

Topic: [Help] Throughhookable tiles and Prediction

Hello. I've got 2 questions about modding of the teeworlds source (vanilla).
First of all, I tried to implement tiles you can stand on but hook through.
For this purpose, I added a new Tile to mapitems.h, right underneath TILE_DEATH.
The tile has been added to the map, and I am a 100% certain that it worked.
So, in collision.cpp, I added a new "case TILE_THROUGHHOOK:", which sets the tile index for this tile to COLFLAG_SOLID|COLFLAG_THROUGHHOOK
Alright. COLFLAG_THROUGHHOOK is set to 128 by default in collision.hpp.
After compiling (Which worked, too) I simply fall through this tile. If I set the collisionflag to COLFLAG_SOLID only, I stay on the tile, but it LOOKS like I fall through, until I move left or right and the coordinate is updated.

So, first question: Why do I fall through a tile with colflag 1000001 but not through one with 1?
Second question: What can I do against the prediction errors? I know I can compile a matching Client, but where do I change how the prediction works?

Thanks for your time,
Ikaron

2 (edited by BeaR 2013-03-13 11:44:15)

Re: [Help] Throughhookable tiles and Prediction

Set your flag to sth lower. If the tile index is greater than 128, it's handled like air.

3 (edited by Ikaron 2013-03-13 18:55:26)

Re: [Help] Throughhookable tiles and Prediction

Thanks man, that did it.
Prediction is still REALLY buggy though. If I hook the ground and then rotate my field of vision, the hook is randomly detached, for example, though this might not be a prediction error. I fall through the tiles, still, though, but when I move slightly, I'm ported back to the top of the tile.
Thanks for your time,
Ikaron