I'm working on a tool for creating fantasy world histories in detail (Yes, in batch, it's all I know. It actually works too! Just trying to make it better now.). At present I am stuck trying to find a way to set the right adjective for a race. For example, if a kingdom is populated by dwarves, I want the script to set raceadj to "dwarvern". That way it can generate text along the lines of "Mournhold is a dwarven town..." Now I could just make a TON of text files and have the variable raceadj loaded from racename.txt as needed... But that feels kinda like a bad practice. Especially since I want this to be easily user configurable. Ideally the end user could open one text file and make sure each race had its additive (and plural if possible) listed in the file simply by typing them all in.
Currently, my thought is I could have one text file with each line reading something like "dwarf:dwarvern", and then somehow use a findstr to detect which line the currently loaded race is on, then select the string after the : and make whatever that is get set as the adjective. Unfortunately, I have no clue at all how I would do that. Can anyone here help me out? Also if that's not the best practice for this, please tell me what is, and what I should be using instead. How to use it would also be appreciated.
How can I make two variables related, so setting one sets the other?
Moderator: DosItHelp
-
- Posts: 1
- Joined: 17 Jun 2022 21:08
-
- Posts: 9
- Joined: 23 Sep 2022 22:13
Re: How can I make two variables related, so setting one sets the other?
Not sure it can help as don't too understand your requirement. However,
1. If want user easy configurable, you can create separate ini file or prompt use input.
2. If you want only ONE file, it seems that the file will modify itself. It is possible but difficult and will have many bug.
if further help, please explain more detail. What is input and expected output. If possible, put sample script.
1. If want user easy configurable, you can create separate ini file or prompt use input.
2. If you want only ONE file, it seems that the file will modify itself. It is possible but difficult and will have many bug.
if further help, please explain more detail. What is input and expected output. If possible, put sample script.