Jump to content
  • Advertisement

Jonte Jinx Carrera

Member
  • Content Count

    20
  • Joined

  • Last visited

Community Reputation

194 Neutral

About Jonte Jinx Carrera

  • Rank
    Member
  1. Jonte Jinx Carrera

    Passing 2d char array through functions in c

    Thank you Guys! I managed to solve the problem by changing the declaration to name[][10] like you said Alberth!   And scanf_s is just like scanf, the difference is that with scanf_s you have to define the number of character you want to enter.
  2. Hi!  I tried to learn how to pass a 2D char array through a function and then printing every value as a string.   this is how my code looks like: void printName(char *name, int *players); int main() { char name[8][10]; int players; printf("Enter how many players there are: "); scanf_s("%d", &players, sizeof(stdin)); getchar(); for (int i = 0; i < players; i++) { printf("\nEnter name: "); scanf_s("%s", name[i], 10); getchar(); } printName((char*)name, &players); getchar(); return 0; } void printName(char *name, int *players) { printf("\n%s", &name[0]); for (int i = 1; i < *players; i++) { printf("\n\n%s", &name[i]); } } How is it that the for loop cuts down the second name instead of going through the array and print all the names? What should i do to print out all the names as strings?
  3. Jonte Jinx Carrera

    c++ and Excel?

    Thank you guys very much! I guess ill try and stick with CSV so far and see where ill land. The reason behind my thought of using Excel was that i saw an interview with a game programmer that used Excel spreadsheets to calculate drop chance values and such. I just need something easy to look at and change. A file that can hold a list of items with stats that will automatically change the characters stats when equipped.   Do you guys have any idea what bigger game companies normally use when they program similar code? Or do you guys often prefer to use. csv when storing variables and values?  
  4. Jonte Jinx Carrera

    c++ and Excel?

    Hi! I am working on a Inventory and loot system for a Text-based RPG. I want to use an excel spreadsheet in order to list my items and stats modifiers. My goal to be able to read and write items and variables to the spreadsheet and make an easy and more accessable way of editing the loot system. My thought is to have some sort of Random generated stat to all items and a drop rate system. Kind of like the drop system in diablo 1. Are there any tutorials that might shine a bit more light on the subject? So far I've only found tutorials on how to read/write strings to excel files, but never a tutorial on how to handle integers in such way. I've also heard that managing .xlsx are quite hard and that i should use .csv instead. Since i'm more of like a beginner at programming (I've managed to make a fully working text-based RPG though. Trying to advance by finding different solutions and making the game more complicated such as in-game currency rates.) i need to find something that isn't to advanced to understand.
  5. Jonte Jinx Carrera

    Text Based RPG help

    Thanks Sunsharior! Ill inspect the code and see if i can understand it! haha. I recently learned how to use Classes and header files so im not a hundred percent sure on what im doing! I appreciate the help! really!
  6. Jonte Jinx Carrera

    Text Based RPG help

    Im sorry Josh! Im quite new to this and i though it was easier for you guys to see what i did wrong! By any means i didn't mean to be rude! It was refering to my main function where i refered a function called ClassInfo("","");   //Game.cpp int main() {     bool EXIT = 0;     do     { Prologue::NameSelect("");        Prologue::ClassInfo("",""); and in the .h   class Prologue { std::string NAME = ""; std::string CLASS = ""; public: static void NameSelect(std::string NAME); static void ClassInfo(std::string CLASS,std::string NAME); I get the NameSelect() to work, but not the ClassInfo() And i understood by now that i haven't defined the function in the main, but im not really sure how to do it?
  7. Jonte Jinx Carrera

    Text Based RPG help

    Hi! I've recently started making a text based RPG using different cpp and h files. And i have been having some problems with function calls and variable calls. I keep getting an Error LNK2019. I just started programming so i might make alot of bad coding. In that case, if you see something i do wrong please correct me!
  8. Jonte Jinx Carrera

    Advice for simple 2D game

      I even fixed some of the other problems. It feels like ive done something wrong with the additional library includes but i can't really figure it out. I followed the tutorial i showed you guys earlier step by step.
  9. Jonte Jinx Carrera

    Advice for simple 2D game

    Thanks Servant! that explains a thing or two!   i followed this tutorial since the installer and tutorial on the sfml homepage didn't work for me:
  10. Jonte Jinx Carrera

    Advice for simple 2D game

    Thanks for the help Satharis! But that didn't help, only got more Errors.   In my C++/general tab under "Additional include directories" i added my include map adress. Same goes with the linker tab under Additional library directories but with the lib map instead. Then in the Linker/input ive added all the "smfl-XXX.lib, smfl-XXX-d.lib, smfl-XXX-s-d.lib depending if it was debug, static debug, release, static release.   And in C++/preprocessor under "preprocessor definitions" i added SFML_STATIC.
  11. Jonte Jinx Carrera

    Advice for simple 2D game

    Ahh! ofcourse! Pardon my confused brain. Anyhow, i tried to install SFML on Visual Studio 13. I know that the latest version of SFML isn't compatible with Visual 13. So i tried using Cmake, everything went on smooth untill i stumbled upon this Error:   Error    1    error LNK2019: unresolved external symbol _WinMain@16 referenced in function ___tmainCRTStartup    C:\documents\visual studio 2013\Projects\sfml 2.0\sfml 2.0\MSVCRTD.lib(crtexew.obj) Error    2    error LNK1120: 1 unresolved externals    C:\documents\visual studio 2013\Projects\sfml 2.0\Debug\sfml 2.0.exe Im not sure what ive done wrong, might it be that ive included wrong library's? I know i atleast included SFML_STATIC in the C++ Preprocessor that many seem to miss.
  12. Jonte Jinx Carrera

    Advice for simple 2D game

    Unity3diy Yeah sorry about that! im trying to be as active as i can! But work and trying to learn what Servant taught me has pulled me away from the post from time to time. But feel free to use this topic if you also have any thoughts or problems. We could all help each other out! :)
  13. Jonte Jinx Carrera

    Advice for simple 2D game

    Glad to hear that Mesmaroth! If you'd like, mabey we could study together and share thoughts with each other? I know i learn faster when i hear others thoughts and opinions.
  14. Jonte Jinx Carrera

    Advice for simple 2D game

    I see!! Well since i learned some new stuff i tried to rewrite all my code in the RPG to tailor suit the description you taught me. It has helped me ALOT and i finally understand how classes work for the most part! But the thing is that i want to make the player able to enter his name, then be able to call the name through out the other dialoges in the game. I also want to access the Profession integer so that your able to advance classes from adventurer to knight or priest for example. I find that if i initilize it inside a function in another .cpp im not able to retrive that integer from all my files unless its a global in a .h file. And that's where i met the problem you corrected me on earlier.
  15. Jonte Jinx Carrera

    Advice for simple 2D game

    haha yeah! i kinda understood that! that explination of OOP was the best ive seen of the many articles i searched and read on the web.     yeah i started looking into it all :) trying to learn as much as posible. Since i got rejected from the course i wanted to study at the university i thought i might as well take up the studies in my own hands. Hoping to enter next year! And thank you very much for the link! i appreciate it!
  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!