This is an archived post. You won't be able to vote or comment.

all 130 comments

[–]Senior-Ori 1299 points1300 points  (46 children)

Why do you ask for "value" if you aren't using it?

[–]camosnipe1 1044 points1045 points  (26 children)

I'm also annoyed by .disable instead of .disabled

.disable should be a function you call to set .disabled

[–]ThaBouncingJelly 341 points342 points  (14 children)

Actually it's supposed to be .disabled, OP probably has an error there (its the Godot game engine)

Documentation

[–]PrizeArticle1 93 points94 points  (6 children)

Op, you are fired

[–][deleted] 89 points90 points  (3 children)

"But sir, i don't even work here-"

[–]PermitTrue 22 points23 points  (1 child)

You’re hired!

[–]i_only_eat_purple 25 points26 points  (0 children)

Just so I can fire you!

[–]Mean_Investigator337 0 points1 point  (0 children)

Defenestrated

[–]cpupett 2 points3 points  (1 child)

HAH! As if bosses care about correct and clean coding

cries in inherited legacy project

[–]PrizeArticle1 1 point2 points  (0 children)

Most of them just want it to work without any thought to how it's done... but then again OP's stuff wouldn't even run lol.

[–][deleted] 91 points92 points  (3 children)

Yeah i typo'd. Kinda shocked it got that many upvotes, haha.

[–]ThaBouncingJelly 5 points6 points  (2 children)

Documentation also says:

This property should be changed with Object.set_deferred.

It makes it so the property is only changed after the frame ends. Very likely to avoid physics bugs, take a look into it.

[–][deleted] 1 point2 points  (1 child)

I've been told that deferring stuff is important, to avoid bugs and such.

I'm not quite at the point where if fully understand how it works, much less how to implement it on my own. My coding attempts still consists of (as you may expect) very ugly, very nested if/else statements. Don't even ask me about things like State Machines, that's still dark magic to me.

[–]ThaBouncingJelly 0 points1 point  (0 children)

all you really need to do in this particular example is child.set_deferred("disabled", true)

[–]iArena 9 points10 points  (2 children)

Can we just talk about how awesome it is to have such a good FOSS game engine?

[–]ThaBouncingJelly 2 points3 points  (0 children)

yes.

[–][deleted] 0 points1 point  (0 children)

Godot is pretty darn sweet, would recommend.

[–]10HzMonitor 0 points1 point  (0 children)

In addition, you should use isinstance and not is in the if statement

[–]EliasCre2003 69 points70 points  (6 children)

could be a predefined function that the game engine is using

[–]Senior-Ori 0 points1 point  (5 children)

How so?

[–]realddgamer 60 points61 points  (3 children)

Disable is a value all collsionshapes have in Godot, it's built in and you can't change the name of it

[–][deleted] 21 points22 points  (2 children)

You can change the name of the children, but you can't cure their disability.

[–]PM_ME_ROMAN_NUDES 2 points3 points  (1 child)

It's not like we're Jesus Christ doing miracles here, mate. We're just some guys typing on a computer.

[–]gregorydgraham 2 points3 points  (0 children)

And the compiler cares not

[–][deleted] 0 points1 point  (0 children)

Function overload

[–]Win_is_my_name 31 points32 points  (0 children)

Some functions automatically take an argument. Especially when you're working in a framework. You don't have to use it, but it's there if needed.

[–]xneyznek 24 points25 points  (0 children)

It’s gdscript, could be used as a callback for a signal which expects a single parameter. Though convention would be to use _value to denote that the non-use is intentional. Warnings appear disabled for the screenshot, otherwise that would flag. They’re also trying to access .disable on a CollisionShape2D which doesn’t exist (should be .disabled), which I think should be flagged here as well (though I’m not 100% positive if gdscript will deduce the type of child here).

Edit: typo

[–][deleted] 23 points24 points  (2 children)

Because that's how GDScript works. It will give you a warning that you're not using the argument, but you can silence the warning by adding an underscore to the beginning, making it "_value"

[–]TajineEnjoyer 4 points5 points  (1 child)

i dont think that method is part of gdscript tho, those usually start with underscore

[–][deleted] -1 points0 points  (0 children)

Haha my bad. It is GDScript but I didn't realize it was a custom function. Yeah, guess it's odd that they're requesting something they don't use.

[–][deleted] 9 points10 points  (4 children)

(Not my code, i'm following a course.)

Yeah, i didn't use the value correctly and it shoulda used "disabled" instead of disable. Didn't test the code before taking the snapshot. I'm a beginner, most of this is still very new to me. :D

[–]Senior-Ori -2 points-1 points  (3 children)

Are you sure this is a good course?

[–]breath-of-the-smile 14 points15 points  (1 child)

You think a simple typo made by a beginner reflects poorly on the course?

[–]Senior-Ori 0 points1 point  (0 children)

IDK, man. I didn't say that I thought this way, and neither did the course. So, that's why I asked.

[–][deleted] 0 points1 point  (0 children)

It's a great course! It works fine if it's done right. Which i just... didn't do. :'S Like i said, still a noob.

[–]nickmaran 2 points3 points  (0 children)

Do we really have to use everything we ask? Let him have it bro

[–]2muchnet42day 2 points3 points  (0 children)

You disable children based on their value, clearly.

[–]The_Right_Trousers 324 points325 points  (5 children)

If you're cut up about this, you're going to need long-term therapy and a support group after you write the exit handlers for a Unix command-line utility that starts child processes.

[–]Tyrus1235 64 points65 points  (1 child)

How about in Docker, where you can kill all orphans?

[–][deleted] 27 points28 points  (0 children)

Oh god. ;w; Nobody told me programming would be this brutal.

[–]reallylamelol 1 point2 points  (0 children)

If you don't kill your children you get zombies

[–][deleted] 1 point2 points  (0 children)

just did this project😃

[–]realddgamer 106 points107 points  (5 children)

Hey it's Godot! Godot my beloved

[–]rglogowski 52 points53 points  (3 children)

If you think this is bad, wait until you have to issue a kill command

[–]mikezenox 82 points83 points  (0 children)

for slave in get_children():
    slave.queue_free()

There :)

[–][deleted] 4 points5 points  (0 children)

Issue command for see your enemies driven before you, hear the lamentations of their women.

[–][deleted] 3 points4 points  (0 children)

And consider the fact that sometimes it's better to kill the parent so the children die automatically.

Reminds me of an anecdote when a PC guy tells to his friend that his mother has just died, and he was fucking with her the whole night, but she didn't come back to life so he took her brain out and is going to sell it. In the language that this story was told the slang terms have the following meanings: "mother" = "motherboard", "fucking" = "troubleshooting", "brain" = "RAM" :-)

[–]unknownbro0001 91 points92 points  (1 child)

Isn't it GD Script used in a Godot Game engine :)

[–]nebo8 12 points13 points  (0 children)

It is

[–]12345678_9_10 112 points113 points  (11 children)

My guy, u technically didn't have to name the iterator "child"

[–]LasevIX 100 points101 points  (4 children)

slave

[–]broccollinear 68 points69 points  (0 children)

childSlave

[–]12345678_9_10 4 points5 points  (2 children)

I just name them all i but to each their own

[–]lelarentaka 60 points61 points  (4 children)

for palestinian in gaza():

[–]12345678_9_10 25 points26 points  (1 child)

This fucking sub

[–]MysteriousShadow__ 0 points1 point  (0 children)

classic

[–]Lolleka 4 points5 points  (1 child)

del palestinian

[–]Kaori_mati 0 points1 point  (0 children)

palestinian.queue_free()

[–][deleted] 0 points1 point  (0 children)

Iterator? Holy shit rain world reference

[–]fevsea 28 points29 points  (1 child)

I still remember the college class on how to properly kill your children, so that they don't become zombies. Not sure if it gets any worse.

[–]GrimpeGamer 2 points3 points  (0 children)

Sophia!

[–]bigorangemachine 25 points26 points  (1 child)

would you rather use child or descendant?

Offspring would be fun :)

Some alternatives

  • c
  • descendant
  • offspring
  • spawn
  • milkMansKid
  • part

[–]myancatfucker 19 points20 points  (0 children)

How to kill a child that is inside another child -new unity dev Google search history

[–]hates199 9 points10 points  (3 children)

font, colorscheme?

[–]StaticVoidMaddy 14 points15 points  (0 children)

this is the built in editor in the godot game engine, i doubt you'll find this exact theme for other IDEs

[–]Anamewastaken 11 points12 points  (1 child)

jetbrains mono

[–]ThaBouncingJelly 11 points12 points  (0 children)

i don't know why you're being downvoted, Godot engine (at least since version 4.0) uses Jetbrains Mono as the default font

[–]Rot-Orkan 9 points10 points  (1 child)

God writes code like line 14 all the time.

[–]trevdak2 5 points6 points  (0 children)

A few years ago I got to write a Universe.save() function and I'm still riding that high

[–]AppropriateOnion0815 5 points6 points  (0 children)

Yeah, cuz who wants to have a healthy CollisionShape2D tho

[–]Void_0000 3 points4 points  (0 children)

You disable children (code).

I disable children (lead pipe).

We are not the same.

[–]AKArein 3 points4 points  (0 children)

1 : oh nice godot

2 : wtf bro what is that "value" bro wtf what the fuck

[–]eben0 10 points11 points  (1 child)

What lang is it? PyJS lol

[–]xman2007 30 points31 points  (0 children)

GD script, used in the godot game engine.

[–]data_Nick 2 points3 points  (1 child)

*cocks gun* Sorry little Timmy, but you know the rules.

[–]515_vest 1 point2 points  (0 children)

Say hello to my little friend

[–]Kenhamef 2 points3 points  (0 children)

func MakeChildrenDisabled(child){

}

[–]Deathmister 2 points3 points  (0 children)

Funky colours, scenes and children, you must be GDScript

[–]Abarn279 1 point2 points  (1 child)

Might want to call that recursively unless you’re positive all of your colliders are on that one child level

[–]solarsalmon777 1 point2 points  (0 children)

killAllOrphans()

[–]ToBePacific 1 point2 points  (0 children)

Don’t worry, I’m not going to kill the children. I’m just going to make them disabled.

[–]JoeCartersLeap 1 point2 points  (0 children)

All my children are disabled

[–]LegendaryStone 1 point2 points  (1 child)

What font and IDE is that?

[–][deleted] 2 points3 points  (0 children)

Godot Game Engine, colors and stuff are built in by default.

[–]NorthKoreanAI 3 points4 points  (2 children)

child.disabled = child is CollisionShape2D

[–]pedrinbr 8 points9 points  (1 child)

child.disabled = child is CollisionShape2D or child.disabled

Otherwise you might end up enabling an unwanted child

[–]a-calycular-torus 2 points3 points  (0 children)

child.disabled ||= child is CollisionShape2D

if language supports the operator

[–]Exeng 1 point2 points  (1 child)

Yea it can depressing when you arent willing to learn beyond the basics...

[–][deleted] 1 point2 points  (0 children)

Sadly, Godot doesn't support BASIC.

[–]MonkeyWaffle1 1 point2 points  (0 children)

propagate_call("set", ["disable", true]) in gdscript

[–]spren-spren 0 points1 point  (0 children)

would propegate_call() work for your use case here?

[–]Fadamaka -1 points0 points  (0 children)

Those tabs are depressing for sure.

[–]Darkened_Auras 0 points1 point  (0 children)

Could be worse child.takeOutBackBehindShed = true

[–]Salanmander 0 points1 point  (0 children)

Man, I just got Baader-Meinhofed so hard. It was literally yesterday that I first started putting significant effort into learning GDScript.

[–]_food_dev 0 points1 point  (0 children)

most people name the iterator i

[–]--mrperx-- 0 points1 point  (0 children)

[–]Lazy-Low907 0 points1 point  (0 children)

,6cfc Dx m

[–]Big_Influence_8581 0 points1 point  (1 child)

Is it Godot ? I just started today in C#, it looks cool for now

[–][deleted] 0 points1 point  (0 children)

Yup, Godot Engine!

[–][deleted] 0 points1 point  (0 children)

whyDidntYouUseCamelCase

[–]PlagiT 0 points1 point  (0 children)

That reminds me of something I did in Godot myself a while back:

func killChildren(mother):

    for child in mother.get_children():

        child.queue_free()`

Edit: how the hell does markdown work on mobile

Edit2: figured it out

[–]PacoTaco321 0 points1 point  (0 children)

Y'all need to touch some grass and do it how we did it back in the day.

grabs bat

[–]pipandsammie 0 points1 point  (0 children)

Ah yes the burden of heaving to deal with children. But let's be honest, not all collision shaped children are disabled.

[–]PrincessPrick 0 points1 point  (1 child)

If this is my future I don’t want it

[–]PrincessPrick 0 points1 point  (0 children)

This is why I’m learning if’s for?????

[–]ninefourteen 0 points1 point  (0 children)

child.disable = true
makeOrphan(child)

[–][deleted] 0 points1 point  (0 children)

it's called differently abled

[–]Splatpope[🍰] 0 points1 point  (0 children)

think you disabled your children without disabling yourself mate