variable holders for games 08-22-2014, 04:16 AM
#1
A while ago I was making a batch RPG and realized you can save files with the ">" function that can have any ".whatever" extension. This got me thinking.
In a week's time, I'd come up with the system. This is how it went down.
You want to save a character name.
The Code:
what this will do is send the "name" variable, in .txt format, to a newly created file called "charstat.name" (character stat, name) in the specified filepath.
each time the code is executed, it will overwrite the file and use the new name.
New Problem:
how do I use this?
The Code (I think?):
What this does (again, I think) is get the name file and set it to the "name" variable.
This can also be used for any alpha-numeric variable you need stored in your game, from mob HP to Drop Rates.
If there's anything you think could be improved or anything wrong with the code (the second bit especially) feel free to PM me!
Enjoy!
-[blank]
Sidenote: sadly, I never released batventures. It was being produced near the end of the school year and even I have priorities :Not-Amused:
In a week's time, I'd come up with the system. This is how it went down.
Example:
The Problem:You want to save a character name.
The Code:
Code:
@echo off
echo enter character name
set /p name=
;redundancy, just for good measure
goto :a
:a
cls
%name% > C:\[filepath]\charstat.name
echo name: %name%
pause <nuleach time the code is executed, it will overwrite the file and use the new name.
New Problem:
how do I use this?
The Code (I think?):
Code:
@echo off
set /p name=
%name% < C:\[filepath]\charstat.name
echo %name%
pause <nulThis can also be used for any alpha-numeric variable you need stored in your game, from mob HP to Drop Rates.
If there's anything you think could be improved or anything wrong with the code (the second bit especially) feel free to PM me!
Enjoy!
-[blank]
Sidenote: sadly, I never released batventures. It was being produced near the end of the school year and even I have priorities :Not-Amused:
It's often the outcasts, the iconoclasts ... those who have the least to lose because they
don't have much in the first place, who feel the new currents and ride them the farthest.
don't have much in the first place, who feel the new currents and ride them the farthest.
















![[+]](https://sinister.li/images/modern/collapse_collapsed.png)