Best code comments

How, what and why to code in BYOND.
User avatar
Cyberboss
Code Maintainer
Joined: Mon Sep 26, 2016 7:58 pm
Byond Username: Cyberboss
Github Username: Cyberboss
Location: Ontario, CA
Contact:

Re: Best code comments

Post by Cyberboss » #336071

ImageImage
User avatar
Qbopper
Joined: Fri Jul 10, 2015 6:34 pm
Byond Username: Qbopper
Github Username: Qbopper
Location: Canada

Re: Best code comments

Post by Qbopper » #336113

pfft
Limey wrote:its too late.
User avatar
ShizCalev
Code Maintainer
Joined: Wed Apr 23, 2014 3:12 am
Byond Username: ShizCalev
Github Username: ShizCalev

Re: Best code comments

Post by ShizCalev » #358898

Code: Select all

	var/fuck_you_dir = get_dir(src, user) // Because fuck you...
	if(!fuck_you_dir)
		fuck_you_dir = pick(GLOB.cardinals)

Code: Select all

//Shit fucking piece of crap that doesn't work god fuckin damn it
function linkify(text) {
	var rex = /((?:<a|<iframe|<img)(?:.*?(?:src="|href=").*?))?(?:(?:https?:\/\/)|(?:www\.))+(?:[^ ]*?\.[^ ]*?)+[-A-Za-z0-9+&@#\/%?=~_|$!:,.;]+/ig;
	return text.replace(rex, function ($0, $1) {
		if(/^https?:\/\/.+/i.test($0)) {
			return $1 ? $0: '<a href="'+$0+'">'+$0+'</a>';

Code: Select all

//SPACE BEARS! SQUEEEEEEEE~     OW! FUCK! IT BIT MY HAND OFF!!
/mob/living/simple_animal/hostile/bear/Hudson

Code: Select all

////////////// I don't know who made this header before I refactored alcohols but I'm going to fucking strangle them because it was so ugly, holy Christ
// ALCOHOLS //
//////////////
ImageImage
>Be ling
>Spread misinformation about how SM works to sabotage it
OOC: ChemicalRascal: Lying about game mechanics in relation to an engine that is poorly understood by most isn't cool, though
User avatar
duncathan
Joined: Mon May 25, 2015 4:12 pm
Byond Username: Dunc
Github Username: duncathan

Re: Best code comments

Post by duncathan » #359054

fuck_you_dir is an age old classic. remie's naming conventions are certainly easy to distinguish
Image
Players can and will create their own fun.
User avatar
RandolfTheMeh
Joined: Thu Aug 14, 2014 2:56 am
Byond Username: RandolfTheMeh

Re: Best code comments

Post by RandolfTheMeh » #359056

Code: Select all

var/list/all_circuits = SScircuit.all_circuits // It's free. Performance. We're giving you cpu time. It's free. We're giving you time. It's performance, free. It's free cpu time for you jim!
Pity it's only for Jim
Rarely posts
User avatar
Remie Richards
Joined: Thu Apr 17, 2014 7:11 pm
Byond Username: CrimsonVision
Location: England, UK, Earth, Sol, Milky Way, Local Group, Virgo Supercluster, Known Universe
Contact:

Re: Best code comments

Post by Remie Richards » #359060

duncathan wrote:fuck_you_dir is an age old classic. remie's naming conventions are certainly easy to distinguish
What can I say, I'm perfect.
私は完璧
User avatar
DemonFiren
Joined: Sat Dec 13, 2014 9:15 pm
Byond Username: DemonFiren

Re: Best code comments

Post by DemonFiren » #359073

i'd almost agree with you but your name is remie
Image
Image
Image
ImageImageImageImageImage

non-lizard things:
Spoiler:
Image
User avatar
Remie Richards
Joined: Thu Apr 17, 2014 7:11 pm
Byond Username: CrimsonVision
Location: England, UK, Earth, Sol, Milky Way, Local Group, Virgo Supercluster, Known Universe
Contact:

Re: Best code comments

Post by Remie Richards » #359079

Not a fan of a french name? (on a brit, lmao)
私は完璧
User avatar
DemonFiren
Joined: Sat Dec 13, 2014 9:15 pm
Byond Username: DemonFiren

Re: Best code comments

Post by DemonFiren » #359081

it's culturally weird i suppose

i mean i was originally going to post a dragon meme here but i don't feel like it
Image
Image
Image
ImageImageImageImageImage

non-lizard things:
Spoiler:
Image
User avatar
Anonmare
Joined: Sun Mar 15, 2015 8:59 pm
Byond Username: Anonmare

Re: Best code comments

Post by Anonmare » #393145

Code: Select all

/datum/reagent/toxin/acid/fluacid/on_mob_life(mob/living/M)
	M.adjustFireLoss(current_cycle/10, 0) // I rode a tank, held a general's rank
	. = 1 // When the blitzkrieg raged and the bodies stank
..() // Pleased to meet you, hope you guess my name
Image
Image
Image
User avatar
DemonFiren
Joined: Sat Dec 13, 2014 9:15 pm
Byond Username: DemonFiren

Re: Best code comments

Post by DemonFiren » #393170

i don't get it
Image
Image
Image
ImageImageImageImageImage

non-lizard things:
Spoiler:
Image
User avatar
Dax Dupont
In-Game Admin
Joined: Sun Apr 20, 2014 9:07 pm
Byond Username: DaxYeen
Github Username: DaxDupont
Location: Belgium

Re: Best code comments

Post by Dax Dupont » #393216

It's Sympathy for the Devil lyrics as a comment for no reason.
User avatar
DemonFiren
Joined: Sat Dec 13, 2014 9:15 pm
Byond Username: DemonFiren

Re: Best code comments

Post by DemonFiren » #393279

ah, so there is no reason
good
Image
Image
Image
ImageImageImageImageImage

non-lizard things:
Spoiler:
Image
User avatar
kevinz000
Joined: Fri Nov 14, 2014 8:41 am
Byond Username: Kevinz000
Github Username: kevinz000
Location: Dorm Room 3

Re: Best code comments

Post by kevinz000 » #407757

Image
User avatar
Denton
Joined: Wed Aug 23, 2017 3:53 pm
Byond Username: Denton-30
Github Username: 81Denton

Re: Best code comments

Post by Denton » #407803

Code: Select all

new/obj/item/reagent_containers/food/snacks/pastatomato(get_turf(H)) //now that's what I call spaghetti code
Image
User avatar
CreationPro
Joined: Sat Apr 19, 2014 11:11 am
Byond Username: Solar Marine
Location: Commiefornia

Re: Best code comments

Post by CreationPro » #427445

signal_redirect.dm wrote:

Code: Select all

// This should only be used by non components trying to listen to a signal
// If you use this inside a component I will replace your eyes with lemons ~ninjanomnom
terranaut wrote:Scared? My stand 「CLOWN WORLD」 and it's 「FUNNY COMPANY」will defeat your weak stand in moments.
Terry the Moth, Melody Jean the roboticist and S.O.L. the cyborg.
I will not change my avatar but if I did I'd have this good KVADRATNIY boy.
Spoiler:
Image
IkeTG wrote:love is okay
CreationPro wrote: i love you
IkeTG wrote:love is no longer okay
Old quotes and stuff
Spoiler:
obscolene wrote:I super glued my PC case shut please don't ask why.
<Pretendo> well Ia ksed in banbus
<AurxSS13> IA KSED! IA KSED! THE BLACK TYPO WITH A THOUSAND ERRORS!

<scaredofshadows> I randomly take buttons away from people
<scaredofshadows> because I am now rogue
<hornygranny> host is rouge
<Ikarrus> blow the admins
trytryagain66 wrote: I accidently axed a guy said I was sorry to him, then he punched me so I axed his head off.
Hibbles wrote:Man, I love CP. I wish we had more CP on the server.
Antonkr wrote:<antonkr> tfw you will never lick hg|works delicious sexy mustache
<antonkr> ;_;
User avatar
DemonFiren
Joined: Sat Dec 13, 2014 9:15 pm
Byond Username: DemonFiren

Re: Best code comments

Post by DemonFiren » #427466

CreationPro wrote:
signal_redirect.dm wrote:

Code: Select all

// This should only be used by non components trying to listen to a signal
// If you use this inside a component I will replace your eyes with lemons ~ninjanomnom
I'd rather have my ears replaced tbh but that aside I'm all for it
Spoiler:
Image
also
lib_machines.dm, line 159 wrote:

Code: Select all

/*
 * Library Computer
 * After 860 days, it's finally a buildable computer.
 */
// TODO: Make this an actual /obj/machinery/computer that can be crafted from circuit boards and such
// It is August 22nd, 2012... This TODO has already been here for months.. I wonder how long it'll last before someone does something about it.
// It's December 25th, 2014, and this is STILL here, and it's STILL relevant. Kill me
Image
Image
Image
ImageImageImageImageImage

non-lizard things:
Spoiler:
Image
User avatar
bandit
Joined: Thu Apr 17, 2014 7:35 pm
Byond Username: Bgobandit

Re: Best code comments

Post by bandit » #468758

Code: Select all

description = "<span class='warning'>I feel a lot better, but wow that was disgusting.</span>\n" //when you read the latest felinid removal PR and realize you're really not that much of a degenerate
"I don't see any difference between ERP and rape." -- erro

admin feedback pls
User avatar
PKPenguin321
Site Admin
Joined: Tue Jul 01, 2014 7:02 pm
Byond Username: PKPenguin321
Github Username: PKPenguin321
Location: U S A, U S A, U S A

Re: Best code comments

Post by PKPenguin321 » #514796

If a light corner abstract object is deleted, which should never happen:

Code: Select all

	stack_trace("Ok, Look, /tg/, I need you to find whatever fucker decided to call qdel on a fucking lighting corner, then tell him very nicely and politely that he is 100% retarded and needs his head checked. Thanks. Send them my regards by the way.")
i play Lauser McMauligan. clown name is Cold-Ass Honkey
i have three other top secret characters as well.
tell the best admin how good he is
Spoiler:
Image
User avatar
Whoneedspacee
Joined: Mon May 21, 2018 2:07 am
Byond Username: Whoneedspacee

Re: Best code comments

Post by Whoneedspacee » #514816

Code: Select all

//I will need to recode parts of this but I am way too tired atm //I don't know who left this comment but they never did come back
my tgcode life
retired ss13 coderman
Reyn
Joined: Tue Aug 02, 2016 2:13 am
Byond Username: ReynTime13
Location: Canada

Re: Best code comments

Post by Reyn » #515221

No specific examples but in class I had a habit of sneaking shitposts into code via comments.
I play Trevor Fea on Bagil, And Giorno Giovanna on terry. Yes, I'm THAT raging asshole. Sorry for being such a cunt.
Have I told you how much I hate engineering, by the way?
User avatar
bandit
Joined: Thu Apr 17, 2014 7:35 pm
Byond Username: Bgobandit

Re: Best code comments

Post by bandit » #517353

found by shaps

Code: Select all

//Aiming for 1.5 hours to max R&D
	//[88nodes * 5000points/node] / [1.5hr * 90min/hr * 60s/min]
"I don't see any difference between ERP and rape." -- erro

admin feedback pls
User avatar
XDTM
Github User
Joined: Fri Mar 04, 2016 8:38 pm
Byond Username: XDTM
Github Username: XDTM
Location: XDTM

Re: Best code comments

Post by XDTM » #517474

It's clearly accounting for time dilation
a.k.a. Duke Hayka

Coder of golems, virology, hallucinations, traumas, nanites, and a bunch of miscellaneous stuff.
User avatar
bandit
Joined: Thu Apr 17, 2014 7:35 pm
Byond Username: Bgobandit

Re: Best code comments

Post by bandit » #520794

from modules/food_and_drinks/food/snacks_salad.dm

Code: Select all

eatverb = pick("devour","nibble","gnaw","gobble","chomp") //who the fuck gnaws and devours on a salad
"I don't see any difference between ERP and rape." -- erro

admin feedback pls
User avatar
Sandshark808
Joined: Wed Sep 04, 2019 6:56 pm
Byond Username: Sandshark808

Re: Best code comments

Post by Sandshark808 » #522930

Not a comment, but...
/obj/item/reagent_containers/food/snacks/urinalcake
Image
cacogen
Forum Soft Banned
Joined: Sat Jun 02, 2018 10:27 am
Byond Username: Cacogen

Re: Best code comments

Post by cacogen » #522955

>see paprika thread in unread posts
>briefly panic until I see the creation date
technokek wrote:Cannot prove this so just belive me if when say this
NSFW:
Image

Image
ATHATH
In Game PermaBanned
Joined: Thu Aug 09, 2018 6:41 am
Byond Username: ATHATH

Re: Best code comments

Post by ATHATH » #527507

The comments in hydroponics.dm (https://github.com/tgstation/tgstation/ ... oponics.dm) are quite good, both in how they explain what's happening/what does what and in humor in the section for dealing with adding special chemicals to a plant tray.
ATHATH
In Game PermaBanned
Joined: Thu Aug 09, 2018 6:41 am
Byond Username: ATHATH

Re: Best code comments

Post by ATHATH » #527508

The comments in revenant_abilities.dm that specifically warn admins not to give non-revenants revenant powers (right next to the code that makes those powers still able to work (and not cost any essence) when cast by non-revenants) are pretty funny: https://github.com/tgstation/tgstation/ ... ilities.dm
User avatar
terranaut
Joined: Fri Jul 18, 2014 11:43 pm
Byond Username: Terranaut

Re: Best code comments

Post by terranaut » #527595

Code: Select all

if(!is_operational()) //you cant use broken machine you chumbis
[🅲 1] [🆄 1] [🅼 1]

Image
User avatar
Yenwodyah
Joined: Mon Jan 15, 2018 10:47 pm
Byond Username: Yenwodyah
Github Username: Yenwodyah

Re: Best code comments

Post by Yenwodyah » #528628

Code: Select all

/obj/item/melee/touch_attack/fleshtostone/afterattack(atom/target, mob/living/carbon/user, proximity)
	if(!proximity || target == user || !isliving(target) || !iscarbon(user)) //getting hard after touching yourself would also be bad
		return
Image
Post Reply

Who is online

Users browsing this forum: No registered users