Topic: Adding own Entities / Game Layer Tiles to your Mod. Possible in 0.6?
Hey guys.
I'm currently writing an advanced City Mod, this means server AND client modified.
So, i wanted to add some Fields on my Game Layer.
Something like a field for money and so on.
But all i would need to know (as first) is, how to add them?
I really looked into the collision.cpp and so..
I added a function like:
bool CCollision::Tile_Is_Money(int x, int y) //i added TILE_MONEY in mapitems.h.... more down...
{
return GetTile(x, y)&TILE_MONEY;
}
//or:
int CCollision::GetTrueTile(int x, int y) //eheheh lets see, what tile its really (16*16 fields!)
{
int Nx = clamp(x/32, 0, m_Width-1);
int Ny = clamp(y/32, 0, m_Height-1);
return m_pTiles[Ny*m_Width+Nx].m_Index;
}
and in mapitems.h in a enum its like so:
.....
TILE_NOHOOK,
TILE_MONEY,
.....
In the Character.cpp at ::Tick()
i added a broadcast message (every frame / ms / tick) that does something like this:
char buf[512];
str_format(buf, sizeof(buf), "X: %d; Y: %d; Current Tile: %d", m_Pos.x, m_Pos.y, GetTrueTile(m_Pos.x, m_Pos.y));
//sending a broadcast (buf)
.....
Now i edited the entities (the entities.png) and added a new 64*64 field next to the nohook symbol.
I created a test map and added the MONEY TILE (near the nohook-tile).
But now when i enter it, it says everything like before: (Current Tile: 0)
So man..
Can anyone of the good coders help me at this problem?
I really need help.
I tried everything-
The oncest tiles its detecting is the spawn points (all, red, blue, as 192-194) and the other likes like for weapons.
But it wont find my added tiles.
You can add me in skype too: powachill
Or send me a email... felix@codingshare.de
Thank you all, if i find a soloution ill just give you a piece of love.