Guild icon
Teeworlds
discord.gg/teeworlds / general
Teeworlds Discord Server.
Between 2025-08-30 00:00 and 2025-08-31 00:00
Avatar
chillerdragon BOT 2025-08-30 05:57
A teeworlds instagib (grenade/laser capture the flag/death match/catch) mod based on DDRaceNetwork (gctf/ictf/idm/gdm/zcatch) - ddnet-insta/ddnet-insta
05:59
Here is the entire code if you need it. Works for both 0.6 and 0.7. You can also download a precompiled binary in the releases section. Make sure to include sv_gametype gdm In your config file
06:05
@lawlion278: do you have a server to run it on? Hosting Teeworlds servers at home is usually not ideal. Because other players will likely have a high ping and you have to fight your NAT.
06:06
I offer fully managed game servers for 2 euros a month. If you don’t want to do anything.
Avatar
lawlion278 2025-08-30 11:57
i wanna change some things about how the mode works and i wanted to know if there is a place where i could learn that
11:57
cause it will be 1vs1's and after a person gets a kill both should respawn
11:57
and some things with the ammo system
11:57
are things id want to change
Avatar
chillerdragon BOT 2025-08-30 13:36
Ah okay then you need to touch the code yes. First you have to get it to compile
13:37
Once you managed to compile I can send you the code for respawn on kill it’s quite simple @lawlion278
13:41
I would also be open to adding a config that respawns a player on kill to ddnet-insta if you are interested in that
13:41
There is also already a configurable ammo system
Avatar
lawlion278 2025-08-30 14:18
i did compile it
14:18
14:19
but the votes are fucked
14:19
14:19
Avatar
chillerdragon BOT 2025-08-30 14:23
Looks like you loaded a client config instead of a server one. How did you name your config file?
Avatar
lawlion278 2025-08-30 14:23
not at all ;-;
Avatar
chillerdragon BOT 2025-08-30 14:24
Well first you need a config before you can complain about config issues xd
Avatar
lawlion278 2025-08-30 14:24
yeah
Avatar
chillerdragon BOT 2025-08-30 14:25
Should be called autoexec_server.cfg you can put it next to the server binary
14:25
There you can add votes and also turn off the map listing if you don’t want it
Avatar
lawlion278 2025-08-30 14:26
ahh i see
14:27
okay ehm for the ammo system the way i would want it is like 3-4 grenades when out of range of another tee and infinite ammo when like in 10-12 tiles worth of distance of another tee
14:27
not just not infinite ammo
Avatar
chillerdragon BOT 2025-08-30 14:28
There is no ammo config based on distance yet you would have to code that
Avatar
lawlion278 2025-08-30 14:29
and where do i learn how to code anything or where i would put that code cause rn i have no clue where i would start
Avatar
chillerdragon BOT 2025-08-30 14:29
Start with the easy stuff
14:29
Death on kill
Avatar
lawlion278 2025-08-30 14:31
i dont know anything
14:32
i wont be able to find where i would be able to code and i wouldnt be able to code
14:32
its cuz i havent ever touched anything proggraming related ever and i dont know shit about it
14:32
;-;
Avatar
chillerdragon BOT 2025-08-30 14:32
I think there is a method called OnKill
14:32
Do you know how to search code?
Avatar
lawlion278 2025-08-30 14:32
whats a method
Avatar
chillerdragon BOT 2025-08-30 14:33
Piece of code with name
Avatar
Avatar
chillerdragon
Do you know how to search code?
lawlion278 2025-08-30 14:33
nope
Avatar
Avatar
chillerdragon
Piece of code with name
lawlion278 2025-08-30 14:33
i see
Avatar
chillerdragon BOT 2025-08-30 14:33
Idk how vs works
14:33
I only know vscode
Avatar
lawlion278 2025-08-30 14:34
i will switch to it right now
Avatar
chillerdragon BOT 2025-08-30 14:34
No need
14:34
If you don’t know something
14:34
You google
14:34
Then you go to stack overflow
14:34
I am using Visual Studio. Say for instance I have a static public method named FooBar() in class Utils. Let's also say that I use this method in a lot of .aspx files. Let's say I change the method
14:34
They say it’s strg+shift+f (you have a German keyboard right?)
Avatar
lawlion278 2025-08-30 14:34
ja
14:35
actually no
14:35
xD
Avatar
chillerdragon BOT 2025-08-30 14:35
Schnitzelsemmel
Avatar
lawlion278 2025-08-30 14:35
koennen auch auf deutsch reden wenns dir lieber ist?
Avatar
chillerdragon BOT 2025-08-30 14:35
Strg/ctrl whatever
14:35
Nein kein Deutschland in diese channel!
Avatar
lawlion278 2025-08-30 14:35
okay i understando
Avatar
chillerdragon BOT 2025-08-30 14:36
Only speak london here
14:36
Okay you found OnKill ?
Avatar
lawlion278 2025-08-30 14:36
nop
Avatar
chillerdragon BOT 2025-08-30 14:37
Where are you stuck?
Avatar
lawlion278 2025-08-30 14:37
i dont know anything its genuinly a miracle i got it to compile
14:37
14:37
is that it?
Avatar
chillerdragon BOT 2025-08-30 14:38
Very good
14:39
okay copy the one from base_pvp.h to gdm.h
Avatar
lawlion278 2025-08-30 14:41
where is gdm.h
14:41
Avatar
chillerdragon BOT 2025-08-30 14:41
You know how to find files?
Avatar
lawlion278 2025-08-30 14:41
i dont know anything😭
14:42
but i google
14:43
where would i put it?
14:43
Avatar
chillerdragon BOT 2025-08-30 14:43
Inside of the class
14:43
Boundaries of the class are the curly braces
14:43
Order inside doesn’t matter
Avatar
lawlion278 2025-08-30 14:44
like that?
Avatar
chillerdragon BOT 2025-08-30 14:46
yes very gamer
14:46
now you need it in the gdm.cpp too
14:47
try to figure out the shape it needs to have in gdm.cpp by looking at the existing code
Avatar
lawlion278 2025-08-30 14:47
what do you mean shape?
Avatar
chillerdragon BOT 2025-08-30 14:48
once you are done with that you are a programmer equipped with all the skills needed to write any software: compile, ask right question, know how to answer any question, copy and paste code
14:48
its not as easy as copy paste this time
14:48
you need to adapt it
14:48
look at the Tick method for example
14:48
how it looks in gdm.h and how it looks in gdm.cpp
Avatar
lawlion278 2025-08-30 14:49
the problem i have is i dont know in which set of curly brackets i would need to put it
Avatar
chillerdragon BOT 2025-08-30 14:49
do it like the tick
14:49
give it a try and send ur attempt
Avatar
@lawlion278 are you making your own ddnet insta mod? xd
Avatar
chillerdragon BOT 2025-08-30 14:50
yes
14:50
he is becoming developer RIGHT NOW
14:50
very fresh
Avatar
lawlion278 2025-08-30 14:50
it autfofilled for me
14:50
Avatar
chillerdragon BOT 2025-08-30 14:50
hax
Avatar
lawlion278 2025-08-30 14:50
yeah
Avatar
chillerdragon BOT 2025-08-30 14:51
when the colors look off either your editor is fucked or you broke the code
14:51
if you use good editor its usually you fucking up
14:51
i see two closing curleys after each other } on the same height
14:51
where do they open?
14:51
i think there is 1 too much
Avatar
chillerdragon BOT 2025-08-30 14:52
okay better
14:52
but still try to look closely
14:52
is yours structured the same way as the other methods?
Avatar
You must put the { after the OnKill
Avatar
chillerdragon BOT 2025-08-30 14:52
spoiler
Avatar
chillerdragon BOT 2025-08-30 14:53
omg state level hacker
14:53
very good
14:53
now you compile!
14:53
check for errors before writing any new code
Avatar
lawlion278 2025-08-30 14:54
70 warnings and it failed to complie
14:54
lets gooo
Avatar
chillerdragon BOT 2025-08-30 14:54
oh i forgot one VEEEEEEEEEEEERYY IMPORTANT SKILL
14:54
you have to learn!
14:54
and you have good oppuirtinity now
14:54
it is debugging and reading error messages
Avatar
lawlion278 2025-08-30 14:54
and what would that be?
14:54
oke
Avatar
chillerdragon BOT 2025-08-30 14:54
wat the erro say
Avatar
lawlion278 2025-08-30 14:54
i mean the servor opened
14:54
but it also said build failed
Avatar
chillerdragon BOT 2025-08-30 14:55
so no erro?
Avatar
lawlion278 2025-08-30 14:55
continue anywas
Avatar
chillerdragon BOT 2025-08-30 14:55
then its trash vs being crash
14:55
you need a passing build
14:55
why it fail
Avatar
chillerdragon BOT 2025-08-30 14:55
it should tell u
14:55
try to spot the critical error
14:55
what does it say
Avatar
lawlion278 2025-08-30 14:55
i recompiled it
14:56
and it fixed itsaelf
Avatar
chillerdragon BOT 2025-08-30 14:56
lmao maybe u forgot to save the file
Avatar
lawlion278 2025-08-30 14:56
i wanted to say that
Avatar
chillerdragon BOT 2025-08-30 14:56
ok so u sure it fully compiles all good?
Avatar
lawlion278 2025-08-30 14:56
i think i did
14:56
i didnt save
14:56
i saved
Avatar
chillerdragon BOT 2025-08-30 14:56
ok now
Avatar
lawlion278 2025-08-30 14:56
and complied it again
Avatar
chillerdragon BOT 2025-08-30 14:56
it gets excting my friend
14:57
go to gdm.cpp
14:57
you see there is now the method OnKill
14:57
methods take arguments
14:57
they are in the parenthesis after the method name
14:57
could you try to figure out for me what are the arguments of OnKill?
Avatar
lawlion278 2025-08-30 14:57
uhm this seems important no?
Avatar
chillerdragon BOT 2025-08-30 14:57
that seems important indeed
14:57
but u say it builds?
Avatar
lawlion278 2025-08-30 14:57
yeah
Avatar
Seems he didn't save gdm.h
Avatar
chillerdragon BOT 2025-08-30 14:58
so lets carry on for now xd
14:58
idk how bad vs rly is
14:58
i think he did now maybe the error got stuck idk
14:58
ok gogo tell me OnKill arguments
14:58
wat are they
Avatar
lawlion278 2025-08-30 14:59
class CPlayer *pVictim,
Avatar
chillerdragon BOT 2025-08-30 14:59
is matrix being slow or did lawlion explode?
14:59
ok ok
Avatar
lawlion278 2025-08-30 14:59
class CPlayer *pKiller,
Avatar
chillerdragon BOT 2025-08-30 14:59
that looks goodish
14:59
yes
14:59
you even split them right
14:59
very gamer
Avatar
lawlion278 2025-08-30 14:59
and this no? int Weapon
Avatar
chillerdragon BOT 2025-08-30 14:59
so as i said between the parenthesis
14:59
and separated by comma ,
14:59
yes weapon too
14:59
so how many in total?
Avatar
lawlion278 2025-08-30 15:00
3
Avatar
chillerdragon BOT 2025-08-30 15:00
pro
15:00
ok arguments are variables
15:00
variables are piece of value with name
15:00
variables also have types cuz c++
15:00
`int Weapon`
15:00
type is int short for integer which is just a number
15:00
and Weapon is the name
Avatar
lawlion278 2025-08-30 15:00
int declares type and weapon is name?
15:00
ahh
Avatar
chillerdragon BOT 2025-08-30 15:00
yes
15:01
then we also have CPlayer *pKiller
15:01
CPlayer is the type its a class in a file called player.h
15:01
every connected gamer has one player instance
15:01
and pKiller is variable name
15:01
the * is a pointer thats to fuck ur program up and make ur server crash
Avatar
lawlion278 2025-08-30 15:01
i see
15:01
so delete it?
Avatar
chillerdragon BOT 2025-08-30 15:01
nono
Avatar
lawlion278 2025-08-30 15:01
(xD)
Avatar
chillerdragon BOT 2025-08-30 15:02
you need it also makes your program fast
Avatar
lawlion278 2025-08-30 15:02
pog
Avatar
chillerdragon BOT 2025-08-30 15:02
its rule of c++ go fast and explode hard
15:02
so be careful with pointer
15:02
if your server crashes it might be pointer
Avatar
lawlion278 2025-08-30 15:02
oke oke
Avatar
chillerdragon BOT 2025-08-30 15:02
ok ok so wat ur plan now?
15:02
in english
15:02
not code
Avatar
lawlion278 2025-08-30 15:03
well we put in the onkill method which allows us to put sometihing that gets kalled when onkill happens and that something is that both players respawn
Avatar
chillerdragon BOT 2025-08-30 15:03
ok nice
15:03
so the pVictim is the victim ... duh
15:03
thats the one that just got killed
Avatar
lawlion278 2025-08-30 15:03
uh huh
Avatar
chillerdragon BOT 2025-08-30 15:03
so he ded anyways
15:04
so we only need to kill the pKiller ez
Avatar
lawlion278 2025-08-30 15:04
makes sense
Avatar
chillerdragon BOT 2025-08-30 15:04
there are bunch of methods in the CPlayer type you can see them in player.h
15:04
but i will spoiler you
15:04
there is one called KillCharacter()
Avatar
lawlion278 2025-08-30 15:04
wait
15:04
dont say anything
15:04
KillCharacter(class CPlayer *pKiller)
Avatar
Avatar
chillerdragon
if your server crashes it might be pointer
@Pointer
Avatar
lawlion278 2025-08-30 15:04
boom
15:04
i think
15:05
ahh you can say again
Avatar
chillerdragon BOT 2025-08-30 15:05
yesnt
15:05
xd
15:05
so what you can do is just `pKiller->KillCharacter();`
15:05
bbut
15:05
i freestyled this code in my head
15:05
so chances are you server crashes now xd
15:06
15:06
colours are working
15:06
should be fine trust
Avatar
chillerdragon BOT 2025-08-30 15:06
nana
15:06
pKiller->KillCharacter();
15:07
C++ if(pKiller->GetCharacter() && pKiller->GetCid() != pVictim->GetCid()) { pKiller->GetCharacter()->Die(pKiller->GetCid(), WEAPON_GAME); }
15:07
this should crash less btw
Avatar
lawlion278 2025-08-30 15:08
like that?
15:08
ohh
Avatar
chillerdragon BOT 2025-08-30 15:08
yes like that very nice
Avatar
chillerdragon BOT 2025-08-30 15:08
that should compile but might crash
15:08
that looks good
15:08
the basedm onkill at the end
15:08
do you see it?
15:09
it calls another method with the same name OnKill defined in some base dm file
Avatar
lawlion278 2025-08-30 15:09
i do not see shit
Avatar
chillerdragon BOT 2025-08-30 15:09
there is already logic happening on kill
Avatar
lawlion278 2025-08-30 15:09
xD
Avatar
chillerdragon BOT 2025-08-30 15:09
bliet dis
15:09
ah i cant send images gg
Avatar
lawlion278 2025-08-30 15:09
get of irc
Avatar
chillerdragon BOT 2025-08-30 15:09
15:09
dis
Avatar
lawlion278 2025-08-30 15:09
and go dc like normal functiuoning human
Avatar
chillerdragon BOT 2025-08-30 15:10
so dis method call of basedm on kill
15:10
does a bunch of kill stuff
Avatar
lawlion278 2025-08-30 15:10
i see i see
Avatar
chillerdragon BOT 2025-08-30 15:10
i forgot which things like print a kill message in the top right and play a sound and give score and so on do killing sprees
15:10
so you can decide of your killing the killer should happen before or after that
15:10
by reordering the code
15:11
i think in this case it doesnt matter much but just u know
Avatar
lawlion278 2025-08-30 15:11
oke oke
Avatar
chillerdragon BOT 2025-08-30 15:11
ok now build and test
Avatar
lawlion278 2025-08-30 15:11
no save?
Avatar
chillerdragon BOT 2025-08-30 15:11
yes save
Avatar
lawlion278 2025-08-30 15:12
woaah
15:12
it work
Avatar
chillerdragon BOT 2025-08-30 15:12
i just tested the simpler pKiller->KillCharacter(); version and it worked too lol
15:12
i had so many concerns about it
Avatar
lawlion278 2025-08-30 15:12
xD
Avatar
chillerdragon BOT 2025-08-30 15:12
sooo many
15:12
xd
Avatar
lawlion278 2025-08-30 15:12
you know the thing i proposed built aswell and there was a server
15:12
it did give 3 errorstho
15:12
so i just switched
Avatar
chillerdragon BOT 2025-08-30 15:12
ok now we make the server crash
15:13
you need to learn how to debug crashes
Avatar
lawlion278 2025-08-30 15:13
and how do we make the server crash?
Avatar
chillerdragon BOT 2025-08-30 15:13
on the top of your method put pKiller->KillCharacter();
15:13
this will delete the character
15:13
ah wait the code below doesnt crash yet sec
Avatar
lawlion278 2025-08-30 15:13
like that?
Avatar
chillerdragon BOT 2025-08-30 15:14
C++ pKiller->KillCharacter(); pKiller->GetCharacter()->Die(pKiller->GetCid(), WEAPON_GAME);
15:14
remove if
15:14
its too safe
Avatar
lawlion278 2025-08-30 15:14
is good?
Avatar
chillerdragon BOT 2025-08-30 15:15
nono has to build
15:15
but crash on kill
15:15
by remove the if i meant remove if plus condition in parenthesis and its curly braces
Avatar
lawlion278 2025-08-30 15:15
i pressed yes and the server exists now
Avatar
chillerdragon BOT 2025-08-30 15:15
so only add the two lines i sent
15:15
go make kill
15:15
see if it dies
Avatar
lawlion278 2025-08-30 15:16
this?
Avatar
chillerdragon BOT 2025-08-30 15:16
you miss the die line
15:16
we need kill and die
Avatar
lawlion278 2025-08-30 15:17
like so or?
Avatar
chillerdragon BOT 2025-08-30 15:17
im gonna crashout xd
15:17
put both of the lines in there i sent
15:17
first kill then die
Avatar
chillerdragon BOT 2025-08-30 15:18
epic
15:18
build
15:18
and make kill
Avatar
lawlion278 2025-08-30 15:19
ehm
15:19
i press kill ingame
Avatar
chillerdragon BOT 2025-08-30 15:19
it crashged the server?
15:19
and i just respawn
Avatar
chillerdragon BOT 2025-08-30 15:19
and it crashed?
Avatar
lawlion278 2025-08-30 15:19
no
Avatar
chillerdragon BOT 2025-08-30 15:19
then connect dummy
Avatar
lawlion278 2025-08-30 15:19
prob cause im not in right mode
Avatar
chillerdragon BOT 2025-08-30 15:19
do kill with grenade
15:20
you tested the code earlier the one that worked didnt you?
Avatar
lawlion278 2025-08-30 15:20
i dont know how to change modes xD
Avatar
chillerdragon BOT 2025-08-30 15:21
BRUU
15:21
you said "it worked"
15:21
without testing=?=?????
Avatar
lawlion278 2025-08-30 15:21
xD
Avatar
chillerdragon BOT 2025-08-30 15:21
not cool
15:21
you do sv_gametype gdm
15:21
in rcon or config
15:22
ok here is the lesson learned for the non working code:
15:22
the thing is that in teeworlds there is the player instance as i said everyone has one who is connected and there is also something called character its another class defined in character.h and that thing only exists while you are alive. So while a player is spectator or in death screen there is no character. And because we use evil pointers the ones with * and -> if you try to access a character of a dead player the server explodes. Very common mistake actually.
15:22
i do laundry now
15:22
on crash vs should tell you the line you crashed in
15:22
if you access a pointer with -> such as pKiller-> or pVictim-> it might be nullpointer thats the issue
15:22
gz your developer now
Avatar
lawlion278 2025-08-30 15:23
oke
15:23
it did crash now
Avatar
chillerdragon BOT 2025-08-30 15:23
did it tell you the line?
Avatar
lawlion278 2025-08-30 15:23
yeah
15:24
i clicked on analyze with coipilot
Avatar
chillerdragon BOT 2025-08-30 15:24
get used to it it will happen a lot :P
15:24
ok pro
15:24
then try to fix it by going back to the old version that doesnt kill twice and does not access a dead character
15:25
if you are serious about programming you probably want to figure out what the following things are: variable, method, class, object, loop, type, pointer
15:25
you can do that in so many places like blogs, videos and chatgpt and so on
15:26
oh and you also want to learn about if statements they are op
Avatar
lawlion278 2025-08-30 15:26
i just want ranked gDM :p
Avatar
chillerdragon BOT 2025-08-30 15:26
then you need to write some by hand to get comfy with where to put the {{((()));;;;
Avatar
lawlion278 2025-08-30 15:26
i see i see
Avatar
chillerdragon BOT 2025-08-30 15:27
if you just want ranked gdm and not learn to code you should have told me to build it
15:27
you would already be done :p
15:27
but i have to go now xd
Avatar
lawlion278 2025-08-30 15:27
xD
15:27
good luck with laundry <3
Exported 346 message(s)
Timezone: UTC+0