• Advertisement
Sign in to follow this  

Something like a script...

This topic is 4396 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

I'm trying to create a simple application that involves the use of scripts. It simplay just has to load the script file once the program is started, display whats in the script, be able to edit the script, and calculate stuff and a few other things. I got the other parts basicly thought out in my head already, but the script part I don't really know what to do. In the script it will have names of foods, and thier prices. Also the program will have a calculation input field that would calculate the price of a certain number of quantites of one food, or add all the prices of selected foods. I'm making the program to help myself not only with coding, but so I don't have to do all the math in my head when I want to buy food...(hehe). Anyway, I'd appreciate anything that would tell me how I go about making this, how I can use it, load it, save it, edit it, and implement it into my program. Eventually I might use a script in game programming, but fr now, I just want to learn how to use scripts first. Language is c++ Compiler is mingw32 API is Windows API and nothing else *hiss* Thanks!

Share this post


Link to post
Share on other sites
Advertisement
sounds like you're a little confused as to what a script is. why dont you just use ms excel?

in programming terms a script is simply a list of instructions(usually a text file) interpreted by your program. there's a pretty good explaination at wikipedia

Share this post


Link to post
Share on other sites
I thought a script was when u load a text file that is similar to code and it can show string types integers and other stuff. Thats what i got off of my directx book anyway. It talked about a Mad Lib Script system, but it was geared more towards dialouge and attack points and stuff. Not to mention its in directx :-\

Isn't a script a text file that is good for like dalouge said by a character without having to recompile the program?

Share this post


Link to post
Share on other sites
well to me it sounds like you're describing a datafile, not a script. You should re-read your book so that you get a better understanding. Did you read the first link I gave you? Your second explaination is more like what a script is, but maybe you need to describe exactly what you want to do again?

this tutorial gives a good start on working with files. If I understand you correctly, you want to have a file that contains food names, and prices. You want your program to read this file and get all the data. Then using the program you can calculate the cost of different quantities, kinda like making a shopping list. And finally you want the program to be able to edit the prices stored in the file. Is that right?

Share this post


Link to post
Share on other sites
Exactly! My program is a shopping list. (I'm gonna use it for when I want to spend my money on a whole bunch of food =) )

Well yea the program should read the info from the data file or script or w/e then change the number of foods, prices, and some other stuff. The program itself would take the values read from the file and use it to calculate the # of items, the total price, and a list of each item that was chosen.

P.S. I saw the first link, and I knew what a script was already. It just explained that it was another programming language on the wikepedia link. If what i just said was wrong, please tell me because I haven't done anythign with scripts, and this would be my first experience with them.

*Havent looked at your 2nd link just yet, I'm going to do that tomorrow. Been busy with homework today :-\*

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement