Post your coding goofs

Ultimately it’s the finished product that matters, but every now and then everyone will run into a bug in their script or addon while developing. Sometimes it’s nothing more than an annoying error that keeps things from working properly but sometimes they can cause interesting results.

I’ll start:

This was one of my earliest attempts at making a custom tracer. It obviously didn’t come out of the muzzle of the gun like it was supposed to.
[img_thumb]http://i23.photobucket.com/albums/b379/RoguePirate/Scavenger%20Deathmatch/gm_construct0214.jpg[/img_thumb]

Making huntsman-like arrows…

And a nice compilation of NPC and weapon related mistakes
[media]http://www.youtube.com/watch?v=WGV-JeqU2NQ

If you’ve got a misnamed variable or an extra zero or anything that causes something unintended, unexpected, and interesting post it here!

Surfing cyberdemon poops metal caged death:xd:

[editline]03:51AM[/editline]

Oh god just saw the end:v:

I can’t stop laughing at the shitting out explosion at the end

[lua]function banPlayer(ply, target, time, reason) {
…code…
…code…
}[/lua]

Felt dumb when I realized that Lua != Java

hahahahahahaha

[editline]01:22PM[/editline]

DooM

This makes me regret i didnt film my failed attempt with ragdoll AI

My fail attempt with ragdoll AI made 50 ragdolls spawn out of 1 NPC when he died.

Needless to say, lag ensued.

I probably have a couple screenshots of issues I had in the past, will upload when I get home

Unexpected, epic ending to the second video.

I haven’t got any pictures or videos, but when developing PCMod I managed to stop the world from drawing - which didn’t fix across map changes. And once in a zombie survival gamemode I was coding the chem zombie, except I accidently made an infinite loop and so when the chem zombie died - the explosion noise makes your ears bleed, kills any player nearby about 20 times over instantly and throws all props and ragdolls miles into the air. Just a tad overpowered.

For a while I couldn’t figure out what was wrong with one of my aircraft, before I realized I had put the weight variable into a different direction, so the aircraft were all falling sideways.

No particular order chronologically

[img_thumb]http://filesmelt.com/dl/c2_trapped00141.jpg[/img_thumb]
[img_thumb]http://filesmelt.com/dl/gm_flatgrass0000123456789101112131415.jpg[/img_thumb]
[img_thumb]http://filesmelt.com/dl/c1a3b0000.jpg[/img_thumb]
[img_thumb]http://filesmelt.com/dl/c1a3b0001.jpg[/img_thumb]
[img_thumb]http://filesmelt.com/dl/c1a4i0000.jpg[/img_thumb]
[img_thumb]http://filesmelt.com/dl/rp_blackmesa_alpha32_d0023.jpg[/img_thumb]
[img_thumb]http://filesmelt.com/dl/rp_blackmesa_alpha320007.jpg[/img_thumb]

[media]http://www.youtube.com/watch?v=njd0xkX9sB8[/media]
[media]http://www.youtube.com/watch?v=88wyxNGcGzM[/media]

don’t know if this next one counts - never leave Create Multiplayer on overnight

[media]http://www.youtube.com/watch?v=3eKCZGSjNqg

I somehow managed to stop ALL game rendering resulting in just a grid paper like screen.

[img_thumb]http://i45.tinypic.com/2ir3sit.jpg[/img_thumb]

Don’t remember what I did…

Happens when you fuck up with Jinto’s rendering module.

[editline]11:47PM[/editline]

I was working on a script that automaticly ‘unstucks’ the player when it’s stuck in the world. I messed up my calculations and caused this rampage:
[img_thumb]http://mauritsdebruin.com/data/img/March%202010/unstuck%20check%20gone%20wrong...jpg[/img_thumb]

[editline]11:50PM[/editline]

Here I messed up with setting the player position. This was one of the few weird things I’ve experienced in source. When you’re lightyears away from the map origin, everything looks crushed like a cardboard.

[img_thumb]http://mauritsdebruin.com/data/img/July%202009/engine_abuse.jpg[/img_thumb]

[editline]11:52PM[/editline]

Messed up projecting a HTML panel…
[img_thumb]http://mauritsdebruin.com/data/img/August%202009/gm_construct0015.jpg[/img_thumb]

[editline]11:58PM[/editline]

Crush lady CRUSH
[img_thumb]http://mauritsdebruin.com/data/img/January%202009%20%3DO/player_tortue.jpg[/img_thumb]

[editline]11:59PM[/editline]

This isn’t really a fuckup, but I couldn’t resist to post it here.
[img_thumb]http://mauritsdebruin.com/data/img/July%202009/Test%20Passed.png[/img_thumb]

I was trying to make a spam auto ban, but i managed to perma ban everyone on the server. That was great.

http://www.wegame.com/watch/self-replicating-shit/

I didn’t know you had to set owner, the only way you could delete them was with the remover tool, server clean up wouldn’t even work

[editline]12:40AM[/editline]

Oh and I was making a BillBoard type thing and I managed to get a Draw error which caused most of the world to not even render visually.

Oh my god… I laughed so hard at the first movie :smiley:

This isn’t exactly lua, but the biggest fail I’ve ever done with “code” is in expression two when I was only a couple months into it. I made a ragdoll float and “attack” you by lunging at you like a zombie, yet for some reason the version I posted online was flipped upside down, resulting in hillarity. No screens, but here’s the e2:
http://wiki.garrysmod.com/?title=Wire_Expression2:Examples#Bone_Example:Zombie.28by_Shoffing.29

Oh WOW, I know that italian kid (I’m italian too :3)
Well, that guy “kerberos” is a 10 yr old kid named Luigi, and he is the perfect example of noobines… And he can’t even type italian right O.o

Just spent the last twenty minutes trying to figure out why, when I hooked into this function in my clientside Lua file, it didn’t call at all, and yet when I hooked in via console, it worked just fine.

Just found the answer to my problems a few moments ago:

[lua]function InfiniDungeon_PrePlayerDraw(ply)
– stuff
end

hook.Add(“PrePlayerDraw”,“InfiniDungeon - PrePlayerDraw”)[/lua]

:downs: