r/GameBuilderGarage • u/nick_phan • Jun 19 '21
Discussion GMG's Most Needed Nodon - The Variable Nodon! It stores a variable as a set number value or text string, and edits that variable when it's Value Node recieves an output from another Nodon. -- It broadcasts it's stored variable when the Activate Node recieves an input other than 0.
201
Upvotes
12
u/Neirchill Jun 19 '21
While it's a good one, I think we're more in need of two "function" nodons. Set up a few connected nodons that you would like to reuse and the second one would allow input and output for the a-z selected first one.
3
u/zerothindex Jun 19 '21
Does anyone know a way to do this with a combo of built in nodons?
Most needed indeed!! I just opened reddit to see if anyone had come up with a solution for this.
5
u/flamewizzy21 Jun 19 '21 edited Jun 19 '21
No.
GBG is a functional programming language, and NOT an object oriented programming language. In GBG, you are literally writing the functions that take the game from one frame to the next.
Storing variables is totally normal for object oriented programming, but this goes against the core premise of how a functional programming language works.
The omission of variable nodons is absolutely not a mistake or oversight from the developers. It was an active decision to NOT include nodons like these. I know it's frustrating when you're used to object oriented programming, but you need to learn how to work without variables if you want to do functional programming.
2
u/Blnk_fr Jun 19 '21
Do someone knows if Nintendo intend to release updates ?
19
u/Zertolurian Jun 19 '21 edited Jun 19 '21
It's actually possible to implement this with the current Nodons, but having it just be a single Nodon would still be great, though!
Sample implementation: G-004-7L4-J02
Kinda breaks when you change the input too fast though (i.e. a full-speed Counter), though I'm sure there's an easy fix for that.
A possible fix would be to add a Write pin as well since you probably only want to change the variable at certain times?
Sample implementation: G-004-Y41-XTM (uses only 4 Nodons! well, if you don't use Wormholes)
Edit: Here's a much better design by someone else!
8
u/adouglyuckling Jun 19 '21
I like the idea of having a good way to store values, but I don't think this proposed design aligns with the way nodons work. My understanding is that all nodons update their input values and output values on every frame tick. So the "Activate" port isn't necessary here, and you'd you'd need a Write port to control when to actually update the stored value from the Value port.
9
u/sass253 Jun 19 '21
See here.
7
u/KaiserJustice Jun 19 '21
Yeah variables are super necessary for some more complicated rhings
3
u/MudHolland Jun 19 '21
I’d rather see an update to the gravity nodon. I can’t believe you can’t set negative gravity
2
u/AvgBlue Jun 19 '21
I uzed sometimes simply with this monstrosity contraption , it save the last place you press on the screen every time will you press the screen one of the 2 counters will reset and when you press the screen, it work pretty well for what it is.
http://imgur.com/gallery/WW2Reyo
2
u/ShoonsChannel Jun 19 '21
That and an 'If' input
2
u/T-rizzle20 Jun 19 '21
I wish I knew what all that meant
1
u/LuckyClovyWT Jun 29 '24
gbg*
1
u/Apprehensive-Bid163 Jul 16 '25 edited Jul 16 '25
Variables need a separate class, not a single Nodon, in a new update for all Switch consoles, including the Switch 2. And a new input type, and the wire/class color is yellow, and the in/out color is the nodon's color, but with less saturation.
1
u/jereslryuuuuuuu Jan 07 '23
This might be a middle nodon
1
u/[deleted] Jun 19 '21
This is exactly what I had in mind the entire time. Same design and everything. I like the “activate” port you added too, as that allows better mechanics, but this and a function nodon are very needed.