Adding numbers from a combo box to on screen text

I have a combo drop down box with numbers in it and every time one of the numbers in the box is used i want them to be added together for a “total” amount in a text block i have and i got everything to work but the numbers don’t add up as i go they just get replaced by the next number.

Any ideas or directions to look would be appreciated

Are you totalling the numbers into a variable and is this variable ‘bound’ to your textbox?

Would Help If you Share your current code

so this is what im trying to do…

and thats the code i have for it, The youtube link would not work for me because he is using actual objects and im only using Widgets so the cast functions and sub functions are way different or im just dumb and over thinking it…i can code my rear off untill it comes time to do this math stuff and then idk what im doing cause i never messed with the math functions much.

see my comment below

ok ill look more into it and see if i can figure it out

thank you!!!

See my comment below, sorry normally i do share my code but i was in a rush to get to work this morning.

The utube link was high lighting the need to bind variables, that’s all ( I pasted the link at the exact time ).

I you bind the variable correctly you can perform all the calcs in the BP and never have to concern yourself with actually talking to the widget.

thats the thing tho i cant cast to my “Character” cause i dont have one, im only using widgets for the entire project.

i appreciate all the help tho

ok so i know how to get it to show up on the screen with this code, how ever i do not know how to setup the math to get it to continuously add them together for a combined total.

the bottom half of the screen it works great i just need to figure out the math to make it add up continuously is all that is left.

the macros are just for the tables to have a number under them to show how many are at the table, that code is irrelevant to the process im trying to do now lol,

as far as the timer tho i dont want it to fire off automatically once the user clicks the number of people i want it to then be added to the combined total.

alright so… when i click on the combo box “first node in code” then i cast to the widget that has the “total number of guest” text block and it adds the number to the spot, after that i need it too keep that first number and then when table 2 is clicked on and a guest count is selected i need it combined to the previous number that was there.

I can’t help thinking you only need to make one table widget. I know you can position it in BP, you can probably bind it in BP ( I’m not particulary hot on widgets ). Then all you have to do is use the level BP to spawn as many widgets as you have tables. The level BP has a SetTimerByEvent node that totals the tables to a single widget in the corner once per second…

Yeah, here you go, I can bind the widget to a given table number, which is coming from an array in the character BP:

Sorry, I’m getting off topic here, but just throwing ideas around… :slight_smile:

Ok, put the variables in the game instance. You can defintely bind to that.

Thing is, I don’t get your code ( I can’t see into those macros ). But if it totals correctly once, just the settimerbyevent to make it happen once per second.

Yeah, whatever’s on the left of that Seq node, that’s where you plug the set timer in :slight_smile:

Ok, so show me a bit of code that gets the number of people on table 1, I don’t see any adding anywhere… :-/

I think we’re talking at cross purposes here. I don’t see any code that reads how many people are on a table, and I don’t see any code that adds that number to the total guest count.