Adventure Game Studio

AGS Support => Beginners' Technical Questions => Topic started by: Saberteeth on Sat 18/11/2006 12:59:51

Title: Calculating
Post by: Saberteeth on Sat 18/11/2006 12:59:51
Hi!

I want to make a calcualtor in a way. I want the script to remember the values of each item in the list box and then when I write the numbers into the text box, the calculator would display the result(eg. item ammount+number I typed into).
I also want all the items to start with 0 and when they are clicked upon, the calculator would add the ammount I type into the text box to the item ammount and when I click another item and write an ammount, it would add it again etc. How would I make such a calculator. I know it has something to do with ints but my scripting knowlege is to small to make something as complex as this.
Title: Re: Calculating
Post by: Khris on Sat 18/11/2006 13:23:23
I'd help you but I have a hard time understanding what you wrote.
Could you maybe post an excel screenshot or something to explain your problem?
Title: Re: Calculating
Post by: Saberteeth on Sat 18/11/2006 13:44:02
ok sorry for not being clear. i'll try to rephrase:

Lets say that you have a lot of different types of items. And you want to calculate how many items you have in total. Eg. ribbons. You have 10 red ribbons, 15 blue ribbons and 94 green ribbons. Now, I make an item into a list box, called ribbons. I want(when you click on the ribbons) to see how many ribbons have been added.
So when I write 10 into the textbox and press +(button), the total number of ribbons would be 10. But when I write 15 into the textbox and press + again, it would display 25 in total in the label.
I hope I've made this a little more clear.
Title: Re: Calculating
Post by: Khris on Sat 18/11/2006 17:54:42
So you have a GUI that looks something like this, correct?
(http://img504.imageshack.us/img504/5159/guisabhy4.png)

Just want to make sure before I start to explain stuff.
Title: Re: Calculating
Post by: Saberteeth on Sun 19/11/2006 07:46:47
Yes, it would look like that, it's just that I would have like 30-40  items in the list box.