Login Register






variable holders for games filter_list
Author
Message
variable holders for games #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.

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 <nul
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?):
Code:
@echo off set /p name= %name% < C:\[filepath]\charstat.name echo %name% pause <nul
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:
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.

Reply

variable holders for games #2
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.

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 <nul
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?):
Code:
@echo off set /p name= %name% < C:\[filepath]\charstat.name echo %name% pause <nul
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:
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.

Reply

variable holders for games #3
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.

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 <nul
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?):
Code:
@echo off set /p name= %name% < C:\[filepath]\charstat.name echo %name% pause <nul
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:
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.

Reply

RE: variable holders for games #4
With the help of the saved file, it'll always remember the name.

Pretty smart! Smile

Reply