1

Topic: Help with programming!

Hey,
My name is //z. and i am a really big teeworlds fan, view weeks ago I had some awesome ideas about a new mod and so I started to learn c++. Now I know the basics from c++ but I don't know the Teeworlds-source.
My question now is if someone can show me how the tw-source is working, maybe he can create a simple tw-mod with me that i know how to do it .

And maybe someone else can show me how to programm with lua.

Pls help me

yours //z.

(sry for my bad english)

2

Re: Help with programming!

//z. wrote:

Hey,
My name is //z. and i am a really big teeworlds fan, view weeks ago I had some awesome ideas about a new mod and so I started to learn c++. Now I know the basics from c++ but I don't know the Teeworlds-source.
My question now is if someone can show me how the tw-source is working, maybe he can create a simple tw-mod with me that i know how to do it .

And maybe someone else can show me how to programm with lua.

Pls help me

yours //z.

(sry for my bad english)

1. There's no LUA atm in the proper Teeworlds code, just for compiling.

2. I'm not sure if what you call "the basics of c++" will be enough, but I won't try to discourage you. Try modifying little stuff in the code in some files where the result can be immediatly seen - that's what I did to learn.

Try with these first two files:

variables.hpp
client/component/hud.cpp

The first file will allow you to easily create more variables in the client console (f1), you can use in nearly all the other files you'll be coding on (at the condition you included the proper header on top). To access the variable you'll have to use g_Config.m_NameOfTheVariable.

The second file is about the HUD on the client screen ingame, it's really easy to change one or two lines and to immediatly see the result :)


Hope this will help, I'm not giving any pre-made code, nothing like "change value at line 566 and that will change the grenade shots by seconds lolololol". It's important you get to know the code by yourself imo. Also, you'll very likely see you lack some programming knowledge, and that will motivate you to look for it to go further in programming.


Good luck!

Not Luck, Just Magic.

3

Re: Help with programming!

thx for drying but i am looking for someone who can explain it exactly to me

4 (edited by BotoX 2012-09-02 12:35:29)

Re: Help with programming!

//z. wrote:

thx for drying but i am looking for someone who can explain it exactly to me

Noone will spend his time with a nab teaching him how to code except a teacher.
Just learn it by yourself ffs.
If you have questions regarding the code you can ask politely in the irc.
But don't expect us to do your stuff.

5

Re: Help with programming!

//z. wrote:

thx for drying but i am looking for someone who can explain it exactly to me

That doesn't exist. The code isn't like a foreign book you can read to someone from page 1 to the end. I already gave you a nice start, now you need to learn by yourself. If there are too much things you can't understand in the code, look for them through the web.

Not Luck, Just Magic.

6

Re: Help with programming!

The best way to learn about the teeworlds code is just reading through it and trying to modify simple things. That's how most of us have started. I don't think it would be very effective if we tried to teach it to you directly. However, feel free to ask specific questions, if you encounter problems or don't understand some things.