1 (edited by DBGuy 2013-06-04 16:45:42)

Topic: [SOLVED] Modding and first steps - 'INVALID' is undeclared

Hi!
It's my first steps at modding. I wanted to make simple server mod where are some trash things smile
I tried to make my own weapon. There were a lot of problem in compiling. Finally I've got to the end of the problems (I think). I don't know, whether have I defined all variables etc. But when I am trying to compile source, the compiler says:

[21/64] #1 c++ src/game/generated/server_data.cpp
src/game/generated/server_data.cpp(488) : error C2065: 'INVALID' : undeclared id
entifier
src/game/generated/server_data.cpp(488) : error C2065: 'INVALID' : undeclared id
entifier
src/game/generated/server_data.cpp(488) : error C2065: 'INVALID' : undeclared id
entifier
bam: 'objs/game/generated/server_data.obj' error 2

Then I looked to that file (server_data.cpp). There was:

static CDataWeaponspec x2166[] = {
    /* x2166[0] */ {  "hammer",  &x44[41],  &x44[42],  &x44[43],  0,x5033,  96,  125,  10,  0,  3,  4.000000,  -20.000000,  0.000000,  0.000000,  5.000000, },
    /* x2166[1] */ {  "gun",  &x44[26],  &x44[27],  &x44[28],  3,x5170,  64,  125,  10,  500,  1,  32.000000,  -4.000000,  50.000000,  6.000000,  5.000000, },
    /* x2166[2] */ {  "shotgun",  &x44[32],  &x44[33],  &x44[34],  3,x5355,  96,  500,  10,  0,  1,  24.000000,  -2.000000,  70.000000,  6.000000,  5.000000, },
    /* x2166[3] */ {  "grenade",  &x44[38],  &x44[39],  &x44[40],  0,x5540,  96,  500,  10,  0,  1,  24.000000,  -2.000000,  0.000000,  0.000000,  5.000000, },
    /* x2166[4] */ {  "trap",  &INVALID,  &INVALID,  &INVALID,  0,x5677,  64,  125,  10,  500,  1,  32.000000,  -4.000000,  50.000000,  6.000000,  5.000000, },
    /* x2166[5] */ {  "rifle",  &x44[47],  &x44[48],  &x44[49],  0,x5814,  92,  800,  10,  0,  5,  24.000000,  -2.000000,  0.000000,  0.000000,  5.000000, },
    /* x2166[6] */ {  "ninja",  &x44[44],  &x44[45],  &x44[46],  3,x5951,  96,  800,  10,  0,  9,  0.000000,  0.000000,  40.000000,  -4.000000,  5.000000, },
};

I replaced INVALID parameters with gun parameters. After that I also had to do it in client_data.cpp. Why? Because after joining with normal client (ready to use binary from teeworlds.com) it says "Wrong version". So everybody who wants to join my server, needs my client sad

Can someone help me with removing those INVALID parameters?

2

Re: [SOLVED] Modding and first steps - 'INVALID' is undeclared

wait wait wait...

1. these files are created automatically, you don't have to change anything...
2. a new weapon won't be visible for normal clients
3. start with sth easier
4. do you know C++ ?

#yemDX is a known troll

3 (edited by DBGuy 2013-06-03 19:42:59)

Re: [SOLVED] Modding and first steps - 'INVALID' is undeclared

1. Changing it makes the mod playable.
2. In elder version there was TeeMo mod and people were able to see a special weapon, but I don't know how is it in the newest.
3. Are there any easier things? big_smile
4. Yes.

4

Re: [SOLVED] Modding and first steps - 'INVALID' is undeclared

2. a mod doesn send any pictures, it just makes the client call functions, which are reachable with messages, see protocol.h in generated

#yemDX is a known troll

5

Re: [SOLVED] Modding and first steps - 'INVALID' is undeclared

if you want a new weapon these thing must be done:
1.create the weapon, like add the weapon resource like image and sound in the.python part to generate the data code.
2.make your weapon useable by modifing the character entity and the content in server.
3.code your weapon in the client
4.make sure your protocol can send your weapon's info.
5.release your mod include the client.

such lots of things to do.

Greet from China!
Teeworlds Chinese Website

6

Re: [SOLVED] Modding and first steps - 'INVALID' is undeclared

yes, but i guess he doesn't want to create a client as well

#yemDX is a known troll

7

Re: [SOLVED] Modding and first steps - 'INVALID' is undeclared

Pikotee wrote:

yes, but i guess he doesn't want to create a client as well

i feel that, too

Greet from China!
Teeworlds Chinese Website

8 (edited by DBGuy 2013-06-04 16:45:09)

Re: [SOLVED] Modding and first steps - 'INVALID' is undeclared

SOLVED: I didn't declare and define strips of the new weapon in content.py.

Thanks to my friend and you, people for helping. smile