0 votes

Hi! I am very, very new to programming in general. I took up this mini project as my first one, but I'm unsure how to figure it out. Any pointers, tips, nudges in the right direction would be really appreciated.

I thought I'd make a little app that output the most complicated calculations for a tabletop RPG.

Example image
This is what I have so far. The calculation is 0.5y * (100-x). Nodes are TextEdits and Button...

Any tips for how to have it take in the numbers written in xTextbox and yTextbox, store them as x and y, and then carry out the Calculation with these values (and then display it underneath)?

I think studying this working code would really clear up a ton of things about Godot for me.

Thanks so much if you take a look at this!

Godot version 3.5
in Engine by (14 points)

1 Answer

+1 vote

Generally, you'll want to use the Expression class to do the heavy lifting here. There are some basic guidelines and examples of expression evaluation here - including passing variables to expressions.

Additionally, here's a somewhat lengthy discussion from a similar question with some valid input and pointers.

by (19,268 points)

Thank you so much! I'm still in the stage of "beginner" where I am struggling with what exactly to even Google search. :)

You're welcome.

Welcome to Godot Engine Q&A, where you can ask questions and receive answers from other members of the community.

Please make sure to read Frequently asked questions and How to use this Q&A? before posting your first questions.
Social login is currently unavailable. If you've previously logged in with a Facebook or GitHub account, use the I forgot my password link in the login box to set a password for your account. If you still can't access your account, send an email to [email protected] with your username.