Re: My projects and demos
Posted: Wed Jul 20, 2016 9:47 am
Thanks very much for the links and examples from your work Zorg. That helps a whole bunch.
Update:
One important part of the program, that aids in immersion is having a rich list of names for NPCs. It can also be used to give the player a name if the player can't decide for himself. My method was to search google for a name list. Luckily there are many. Unfortunately the data is not often in the best format for using in a table.
Assuming someone else might want to do this, I will explain the method that I used to extract and prepare the list for use in the program. Because nobody wants to manually edit 7000 lines of information.. Sed is the answer.
First I copy and paste the name list into a file. This unfortunately contained information I didn't need at the moment, like ranking and frequency.
The first thing to do is remove all non alphabet characters from the file.
Now I have a file (girlnames2.txt), that contains a big list of names. Only problem is putting them into a table now I still need to add quote marks. That could get old after 4k of names... But luckly Sed again will save me much work.
Your notice also that I wanted to make sure that the comma was added to the end of the line. Now I have the data in a form I can use in lua. (with a little work on the last line) Your remove the last comma and add a curly brace at the start and the end. There you now have your table.
finally I remove the intermediate files that I have used. and I do the same thing with the boys names. I also did this with the surname list.
I now have a list of names in a series of tables that I can randomly assign in the game. Thousands upon thousands of names and when coupled with Surnames you have to play a lot of games to get a repeat name.
Female first names Male first names White surnames
Update:
One important part of the program, that aids in immersion is having a rich list of names for NPCs. It can also be used to give the player a name if the player can't decide for himself. My method was to search google for a name list. Luckily there are many. Unfortunately the data is not often in the best format for using in a table.
Assuming someone else might want to do this, I will explain the method that I used to extract and prepare the list for use in the program. Because nobody wants to manually edit 7000 lines of information.. Sed is the answer.
First I copy and paste the name list into a file. This unfortunately contained information I didn't need at the moment, like ranking and frequency.
The first thing to do is remove all non alphabet characters from the file.
Code: Select all
sed 's/[^a-zA-Z]//g' girlnames.txt > girlnames2.txt
Code: Select all
sed 's/.*/\"&\",/g' girlnames2.txt > girlnames3.txt
finally I remove the intermediate files that I have used. and I do the same thing with the boys names. I also did this with the surname list.
I now have a list of names in a series of tables that I can randomly assign in the game. Thousands upon thousands of names and when coupled with Surnames you have to play a lot of games to get a repeat name.
Female first names Male first names White surnames