1

Topic: TW Mod

Hey i have compiled teeworlds  do so some things with the Code and so on and now i want to now where i have to Change something  in the Code  that riffle is a One Hit weapon. Thank you for help ;D

2

Re: TW Mod

src/game/server/entities/character.cpp
TakeDamage()
if(Weapon == WEAPON_RIFLE)
   Die(...);

Or change the damage to 20, in the FireWeapon() function.

3

Re: TW Mod

Where i have to Write that in Charakter.cpp TakeDamge and so on

4

Re: TW Mod

TakeDamage() is a procedure of teeworlds.
Read this code and you should understand where to add the snippet.

Otherwise (tbh) you might read a c++ book first.

5

Re: TW Mod

If i added that there did always comes an Error that die and takedamage have no Argument or something like that

6 (edited by KillaBilla 2011-08-04 13:01:57)

Re: TW Mod

You don't even know the basics. Learn C++ and read a book before you try to hack on teeworlds source.
If you want to have a onehit laser now just tune the laser damage to 20 and set the gametype to mod.

7

Re: TW Mod

where i have to tune the laserdamage ... laser.cpp ???

8

Re: TW Mod

no, you won't be able to do anything with the code if you don't have any knowledge about coding.

Start the server with the gametype mod and write ingame in the rcon (F2) :
tune laser_damage 20

9

Re: TW Mod

Man its okay when you dont know the basics in c++ (it seems so yikes), but before coding you really should look into the source by your own.
I found loads of helpful shit in the source, just for looking thru the files and so ;D

10

Re: TW Mod

powachill4 wrote:

Man its okay when you dont know the basics in c++ (it seems so yikes)

No it's not.

Not Luck, Just Magic.

11 (edited by KillaBilla 2011-08-06 19:38:46)

Re: TW Mod

powachill4 wrote:

Man its okay when you dont know the basics in c++ (it seems so yikes), but before coding you really should look into the source by your own.
I found loads of helpful shit in the source, just for looking thru the files and so ;D

But looking in the source code of other application will not teach you the basics. You will maybe learn how to do something special in teeworlds, but without the basics, you can't produce good mods.

And why do you think it seems that you don't have to know the basics? I don't think its fun if you dont know the basics and even don't know what to do with an easy error like "an int can't be converted into a char[64]" or whatever. And do you think its fun when you copied something from another mod, changed some texts and the server chashes but you don't know why?