Jump to content

johnnyv

Members
  • Posts

    960
  • Joined

  • Last visited

Everything posted by johnnyv

  1. It is mainly single player, multiplayer is a work in progress.
  2. I have played a few of the earlier versions and it was pretty good then except for the graphics the engine supported decent graphics but there weren't many good models availible, with this release there has been a huge amount of work done on the models and other graphic stuff so it is looking heaps better. Most of the games config is in xml files you can do a lot of tweaking if you are prepared to do abit of reading and if you know python you can script new effects etc. I have not played 0.4 yet as i have just noticed its release, will be downloading it tonight.
  3. Nice multiplatform space sim weighing in at 170mb now ready. Also a startrek mod for VS is availible as well http://vegastrike.sourceforge.net/
  4. Oh for square root in c++ you need to include the math header file #include <math.h> y = sqrt(x); ref: http://www.cplusplus.com/ref/cmath/sqrt.html
  5. In regards to "answer answer;" you are declaring an instance of the structure answer and calling it answer. it's like int X; you could have called it answer bob; then you would call bob.multiply , bob.add etc.... The structure definition below is just that, it's a definition, the stuct name(in this case answer) becomes a sort of new variable type. struct answer{ int multiply; int add; int divide; int subtract; }; To make use of this new variable type you need to create in instance of it, hence "answer answer;" . You can actually define instances of a stucture when you define the structure as follows struct answer{ int multiply; int add; int divide; int subtract; } answer, bob; Here two instances of the struct answer have been defined, answer and bob which can be used later in the program. I hope that explains it a bit better. You could look at this page for some more examples. http://www.cplusplus.com/doc/tutorial/tut3-5.html Oh and another thing, there is an error in your code in the addition part "answer.add = mulnumone + mulnumtwo;" should be addnumone + addnumtwo;. Once you understand this then you should improve you program by adding protections like not allowing a divide by zero error to occur, and preventing users from entering other than ints, eg currently adding a number and letter together gives a rather bad result.
  6. Okay firstly your structure definition needs to end with a semicolon }; you must create an instance of your structure before you can use it "answer answer;"(created an instance of the answer structure named answer, it could be done when you make the structure). you had { before main() not after as was mentioned you needed to declare what type main() is eg "int main()" so g++ will know what main will return you could use void main() but thats not recommended. enclose your else if statment code in brackets if there is a fair bit of it. that was about it, here is a version that compiles #include <iostream.h> struct answer{ int multiply; int add; int divide; int subtract; }; int main() { int Choice; int mulnumone; int mulnumtwo; int addnumone; int addnumtwo; int divnumone; int divnumtwo; int subnumone; int subnumtwo; answer answer; while (1) { // Menu Heading cout << "ttt//////////////////////////n"; cout << "ttt/////// CALCULATOR ///////n"; cout << "ttt//////////////////////////n"; //Menu Choices cout << "nttt1) Multiply Numbers n"; cout << "ttt2) Add Numbers n"; cout << "ttt3) Divide Numbers n"; cout << "ttt4) Subtract Numbers n"; cout << "ttt5) Exit the calculator n"; cout << "ntttPlease Enter your choice: "; // Find users choice cin >> Choice; // Accordng to choice Calculate users input // Multiplication if (Choice == 1) { cout << "ntttYou chose to Multiply Numbers.nttt"; cout << "ntttEnter the numbers that you want to Multiply, after you type each nimber, press enternttt"; cout << "ntttEnter First Number: nttt"; cin >> mulnumone; cout << "ntttEnter Second Number: nttt"; cin >> mulnumtwo; // Calculate the Multiplication Equation answer.multiply = mulnumone * mulnumtwo; cout << mulnumone << " times " << mulnumtwo << " equals " << answer.multiply << "n"; } // Addition else if (Choice == 2) { cout << "ntttYou chose to Add Numbers.nttt"; cout << "ntttEnter the numbers that you want to Add, after you type each nimber, press enternttt"; cout << "ntttEnter First Number: nttt"; cin >> addnumone; cout << "ntttEnter Second Number: nttt"; cin >> addnumtwo; // Calculate the Addition Equation answer.add = mulnumone + mulnumtwo; cout << addnumone << " plus " << addnumtwo << " equals " << answer.add << "n"; } // Division else if (Choice == 3) { cout << "ntttYou chose to Divide Numbers.nttt"; cout << "ntttEnter the numbers that you want to Divide, after you type each nimber, press enternttt"; cout << "ntttEnter First Number: nttt"; cin >> divnumone; cout << "ntttEnter Second Number: nttt"; cin >> divnumtwo; // Calculate the Division Equation answer.divide = divnumone / divnumtwo; cout << divnumone << " divided by " << divnumtwo << " equals " << answer.add << "n"; } // Subtraction else if (Choice == 4) { cout << "ntttYou chose to Subtract Numbers.nttt"; cout << "ntttEnter the numbers that you want to Subtract, after you type each nimber, press enternttt"; cout << "ntttEnter First Number: nttt"; cin >> subnumone; cout << "ntttEnter Second Number: nttt"; cin >> subnumtwo; //Calculate the Subtraction Equation answer.subtract = subnumone / subnumtwo; cout << subnumone << " minus " << subnumtwo << " equals " << answer.subtract << "n"; } // If users choice was to exit the calculator, exit else if (Choice == 5) { cout << "ntttYou chose to Exit the Calculator. Bye.nttt"; break; } // If users Choice is not valid, must enter again else { cout << "ntttYour choice is NOT valid!n"; cout << "tttPlease enter a CORRECT choice!nnttt"; } } return 0; }
  7. Oh well at least if your desperate too play you can set your time back and you can play then
  8. I don't mind as it will not be hard to disable Besides if it helps mandrake stay afloat financially then good, it's not like i use screen savers anyway.
  9. ??????????????? Who's Mr Ungrateful?
  10. bugger used ravages installer it installed fine but i get this: [john@bob mohaa]$ mohaa *************************************************************************** *************************************************************************** *************************************************************************** *************************************************************************** *************************************************************************** *************************************************************************** *************************************************************************** *************************************************************************** Thanks for participating in the Medal of Honor: Allied Assault beta test! This beta copy has now expired. Please visit http://mohaa.ea.com/ for a non-beta release. [john@bob mohaa]$
  11. Hi, the is a project called binary php which converts php code into c++ code which i really wanna try. The version of php shipped with Mdk doesn't have the tokenizer functions enabled which is needed for binary php to work. any one know if its possible to add the extra configure argument when rebuilding the php src rpm? eg) add "--enable-tokenizer" I guess i will just have to edit the spec file then rpm -i php.src.rpm cd usr/src/RPM/SPECS edit the php.spec file, removed the line that deleted the tokeniser extension added --enable-tokenizer to the configure arguments. rpm -ba php.spec cd /usr/src/RPM/RPMS/i586/ upgrade the rebuilt rpms
  12. look at this link very good explanation http://www.stat.vt.edu/UNIX_BOOKS/upt/ch45_21.htm 1>&2 1 = standard output 2 = standard error send standard output to standard error which makes sense as they are error msgs in the shell script eg) if not a directory send "$1 is not a directory!" to standard error and exit the echo command in bash normally goes to standard output so need the 1>&2 to send it to standard error. btw i really no nothing about shell scripting, so go read up on it for yourself
  13. wget -O blah http://www.userfriendly.org && cat blah | sed -n /SRC=.*xuf.*.gif/p I don't know if this is what you want but i can't think how to redirect wget to standard output Booyah had a better idea but i think lynx -source will work better as with lynx -dump is formated so no <SRC> tags
  14. Greetings If you need to use html forms for web database apps there can be a few annoying problems. Say you have a selects which contain product names, you select a product then fill in the qty etc.. you will find that when you have several thousand items in your select that it is a pain in the ass to use. Also you may want to allow multiple items to be submitted, but how many will you need? loading a page with 20 selects each having several thousand options takes a long time, and is pretty wastefull if the user only ends up using 2 of them, also it just looks fugly doing it that way. So i will show you a method of splitting up your selects into two and there by reducing the amount of options that users have to deal with, aswell as showing you a way to make more dynamic (i can't think of a better term) form elements. Oh this will probably only work in Mozilla as i use w3c dom stuff but you never know untill you try i guess. basically it works as follows: you query your database in php and generate a bunch of javascript arrays which contain select option values and text descriptions grouped by catergory (i won't explain the php stuff because php is so easy by the time i wrote out an explanation you could have learn't the language). you have a <div> containing your form line(contains inputs selects whatever) with the div's style set to not display, this is the template from with we create the form elements as we need them you then have javascript functions that clone the template div and insert in into the form (using a <span> within the form as the parent node)while changing the elements names and id's so that you get unique values usefull for the form processing after submission. <html> <head> <title>Muaahahaahahahahahahahaahaaa</title> <meta content=""> <style></style> <script language="javascript"> <!-- /* here is the array list where the select gets it's values from */ var pick_a_catergory = new Array("0","Pick a code"); var catergory1 = new Array("item1","cat","item2","dog","item3","cow","item4","frog","item5","fish"); var catergory2 = new Array("item6","car","item7","bus","item8","truck","item9","crane"); var catergory3 = new Array("item10","blah","item11","blah2","item12","blah3","item13","blah4","item14","blah5","item15","blah6"); function find_the_next_element(element) { /* Possible infinite loop here if no siblings maybe should just use a i < 100 or something */ var condition = true; while(condition == true) { if(element.nodeType != 1) { element = element.nextSibling; } else { condition = false; } } return element; } function swapOptions(the_select) { var the_array = eval(the_select.options[the_select.selectedIndex].text); var next_select = document.getElementById(the_select.id).nextSibling; next_select = find_the_next_element(next_select); setOptionText(next_select, the_array); } function setOptionText(the_select, the_array) { the_select.options.length = the_array.length/2; for (loop=0; loop < the_select.options.length; loop++) { var value_counter = loop * 2; var text_counter = value_counter + 1; the_select.options[loop].value = the_array[value_counter]; the_select.options[loop].text = the_array[text_counter]; } } var counter = 0; // counter for naming the elements function moreFields() { counter++; var newFields = document.getElementById('readroot').cloneNode(true); newFields.id = ''; newFields.style.display = 'block'; var newField = newFields.childNodes; for (var i=0;i<newField.length;i++) { var theName = newField[i].name if(theName) { newField[i].name = theName + counter; /* we need the name for php processing $_POST later */ newField[i].id = theName + counter; /* need an id for the javascript manipulation because there is no getElementByName() only Id*/ } } var insertHere = document.getElementById('writeroot'); insertHere.parentNode.insertBefore(newFields,insertHere); } // --> </script> </head> <body onload="moreFields()"> <div id="readroot" style="display: none"> <input type="button" value="Remove" style="font-size: 10px" onClick="this.parentNode.parentNode.removeChild(this.parentNode);"> <select id="catergory" name="catergory" onChange="swapOptions(this);"> <option>pick_a_catergory</option> <option>catergory1</option> <option>catergory2</option> <option>catergory3</option> </select> <select id="selected_item" name="selected_item" STYLE="width: 450px"> <option></option> </select> <input type=number name=qty size=6 value=0 align=right> </div> <form method=post> <span id="writeroot"></span> <p class="hr"> </p> <input type="button" value="Add New Line" onClick="moreFields()"><br> <input type="submit" value="Send form"> </form> </body> </html> Ok so a little more info. javascript function moreFields() This function clones the "readroot" template div and inserts it within the form. counter++; used for making unique id and names for the dom elements. var newFields = document.getElementById('readroot').cloneNode(true); find the element readroot and clone it newFields.id = ''; remove the "readroot" id from the cloned div newFields.style.display = 'block'; display the div, the template is not displayed var newField = newFields.childNodes; for (var i=0;i<newField.length;i++) { var theName = newField[i].name if(theName) { newField[i].name = theName + counter; /* we need the name for php processing $_POST later */ newField[i].id = theName + counter; /* need an id for the javascript manipulation because the is no getElementByName() only Id*/ } } Ok so for each of the cloned divs child nodes, if the node has a name change the name to the name + the value of the variable counter, do the same for id. var insertHere = document.getElementById('writeroot'); insertHere.parentNode.insertBefore(newFields,insertHere); We find the span that has the id of "writeroot" and insert the div before the span. the parentNode will be the <form> element in this case. javascript function swapOptions(the_select) this function is called when one of the catergory selects values is change by the user It graps the value of the selects selected index and then calls the find_the_next_element(element) function to find the location of the second select. Once found the setOptionText(the_select, the_array) is called which populates the second selects options using the array the matches the catergory of the first select. Confused? Good I just posted this because it was so hard to find info on this particular sort of thing and it might make it a bit easier for somebody here in the future.
  15. Drak GateWay. What do I win??? :wink: An invoice from SCO as you are obviously using SCO's draktools :P
  16. Possibly you tried a while ago i got blue shift counterstrike and day of defeat running great(some slight menu probs but nothing detracting from play) but the thing is i don't find the games very good anymore. I now play Wolfmp and ET as my multiplayer fps of choice as they are really fun to play.
  17. those rank numbers look like what you get from mysql full text search queries. I assume you have set a result limit?
  18. johnnyv

    Getting annoyed :x

    yes use a download manager Some servers do not support resuming downloads in which case you would be out of luck. wget from console wget -c filepath btw what a crappy ISP i assume you have no alteratives.
  19. Well festival is free and you can get different voice packs for it. And you can create you own voice pack for it if you wanted too. IBM has impressive text to sound software you may have to pay an impressive price for it.
  20. here you go. ftp://speakeasy.rpmfind.net/linux/Mandrak...3-2mdk.i586.rpm or http://distro.ibiblio.org/pub/Linux/distri...3-2mdk.i586.rpm maybe of use http://distro.ibiblio.org/pub/Linux/distri...1mdk.noarch.rpm http://distro.ibiblio.org/pub/Linux/distri...1mdk.noarch.rpm http://distro.ibiblio.org/pub/Linux/distri...1mdk.noarch.rpm http://distro.ibiblio.org/pub/Linux/distri...1mdk.noarch.rpm http://distro.ibiblio.org/pub/Linux/distri...1mdk.noarch.rpm http://distro.ibiblio.org/pub/Linux/distri...1mdk.noarch.rpm
  21. I didn't have any problems installing it on 8.2 or 9.0 that i can remember. I can only find rpms for mandrake 9.1 not 9.0 sorry.
  22. It could be done with mozilla, there are search projects over at mozdev, but none have the feature that copernic has that i know of.
  23. I find it quicker to do it the way i stated rather then working with the layers in gimp, like i said i don't do hardly any graphic stuff. Oh course if i took the time to learn more about it.. but i'm doing other stuff that i find more interesting.
  24. I havent read this thread in totallity but in regards to gifs i like make them like this 1)use gimp to create the individual frames, usually as bmp or jpeg. 2)then use imagemajic from the command line to merge the frames into a gif file 3)then open the gif in gimp and adjust the timings between frames etc.. I find this easier than actually making a gif in gimp from scratch probably cause i hardly ever do any graphical work.
×
×
  • Create New...