[RM2K3] [DYNRPG] ADVANCED FILE MANAGEMENT
Posts
Pages:
1
So, two issues really. I have updated my computer to Windows 8.1 and as a result, copy-pasting the old CodeBlocks didn't seem to work. I need a sort of "all-on-one-page" instruction on how to set up CodeBlocks again so I can build plugins again.
Second, on making KazString, I discovered in addition to the DynRpg code (which I mainly only understand how to work with switches, variables, and the whole onComment part), plugins can also run using conventional C++ code, leading me to figure out how to make a ton of temporary variables outside the traditional ones including a sort of int matrix, and using fstream creation.
http://www.cplusplus.com/doc/tutorial/files/
So, basically, the latter is what I'm interested in. I made something similar to this the last time around, but what I actually want to do is expand on this. For instance, making a "treasure chest" event that does the following:
1. Creates a named file using comments (basically the way I have it set up, it only saves to one file, "dynstore.txt". I want it be able to do @create_file "filename1" and have it make a .txt file by that name)
2. Append information to the file (currently I overwrite stuff), making a new line each time.
3. Is there a way to search for a string within a file? As in, I want the plugin to search for a string with Chest2 (inputted when Chest2 was open), and turns a switch called ChestOpened ON (because it is in a separate file, this is reusable, you just turn ChestOpened OFF after the event)
(Something like this: http://stackoverflow.com/questions/12463750/c-searching-text-file-for-a-particular-string-and-returning-the-line-number-wh)
Second, on making KazString, I discovered in addition to the DynRpg code (which I mainly only understand how to work with switches, variables, and the whole onComment part), plugins can also run using conventional C++ code, leading me to figure out how to make a ton of temporary variables outside the traditional ones including a sort of int matrix, and using fstream creation.
http://www.cplusplus.com/doc/tutorial/files/
So, basically, the latter is what I'm interested in. I made something similar to this the last time around, but what I actually want to do is expand on this. For instance, making a "treasure chest" event that does the following:
1. Creates a named file using comments (basically the way I have it set up, it only saves to one file, "dynstore.txt". I want it be able to do @create_file "filename1" and have it make a .txt file by that name)
2. Append information to the file (currently I overwrite stuff), making a new line each time.
3. Is there a way to search for a string within a file? As in, I want the plugin to search for a string with Chest2 (inputted when Chest2 was open), and turns a switch called ChestOpened ON (because it is in a separate file, this is reusable, you just turn ChestOpened OFF after the event)
(Something like this: http://stackoverflow.com/questions/12463750/c-searching-text-file-for-a-particular-string-and-returning-the-line-number-wh)
Pages:
1














