1

Topic: ?oordinates of the cursor[help]

Do mod.
How to get the coordinates of the cursor in the game?
And how do the calculation distance from the object?
How to get the coordinates of the player in his ID?

P.S. I use google translate !

2

Re: ?oordinates of the cursor[help]

Maybe you should try to download a client that supports that. I don't know what client though.

nya~ :3c
r.i.p. Teeworlds

3 (edited by unsigned char* 2014-07-23 12:36:55)

Re: ?oordinates of the cursor[help]

1.
From Client:

m_pClient->m_pControls->m_MousePos.x;
m_pClient->m_pControls->m_MousePos.y;

From Server:
** Need change the "m_Core" atribute to public or add a method for get it

GameServer()->m_apPlayers[CLIENT_ID]->GetCharacter()->m_Core.m_Input.m_TargetX;
GameServer()->m_apPlayers[CLIENT_ID]->GetCharacter()->m_Core.m_Input.m_TargetY;

------

2.
** Need import "vmath.h"

distance(vec2, vec2);

------

3.
From Client:

CNetObj_Character PrevChar = m_pClient->m_Snap.m_aCharacters[CLIENT_ID].m_Prev;
CNetObj_Character CurChar = m_pClient->m_Snap.m_aCharacters[CLIENT_ID].m_Cur;

vec2 Position = mix(vec2(PrevChar.m_X, PrevChar.m_Y), vec2(CurChar.m_X, CurChar.m_Y), Client()->IntraGameTick());

From Server:

GameServer()->m_apPlayers[CLIENT_ID]->GetCharacter()->m_Pos

4

Re: ?oordinates of the cursor[help]

what mod you do with that knowledge ? big_smile

5 (edited by TXrusTX 2014-07-24 19:37:22)

Re: ?oordinates of the cursor[help]

unsigned char*
Thank you so much.
but I did not understand about the first point. Where his register.

6

Re: ?oordinates of the cursor[help]

Download source, use a IDE, use search function...