Random Names for Characters in Game

For questions about using Classic.

Post » Sun Nov 16, 2008 1:22 pm

Hey I was wondering is it possible to create a list of possible NPC Names in a text file and then Randomly assign them to characters when you first talk to them?
B
5
S
2
G
4
Posts: 632
Reputation: 2,829

Post » Sun Nov 16, 2008 3:50 pm

You could place a bunch of names into a text file. When you run the game, load them up into a list box. NPCs could have two variables: "name" and "pickname". Pickname should be set to 1 and name should be a string. When you talk to an NPC, if the NPC's "pickname" variable is equal to 1, pick a random line from the listbox, assign the text in said line to the "name" variable, and set "pickname" to 0 so it's name is permenant. Hope that made sense. :P
Moderator
B
98
S
37
G
19
Posts: 1,584
Reputation: 17,817

Post » Sun Nov 16, 2008 6:59 pm

You could even make that one variable. Use 'name', and set its initial value to "pick name". Then, if 'name' is "pick name", pick a name, and set 'name' to it.
Moderator
B
88
S
32
G
33
Posts: 3,005
Reputation: 27,432


Return to Help & Support using Construct Classic

Who is online

Users browsing this forum: No registered users and 4 guests