|
Random Names
#121345
04/04/07 00:32
04/04/07 00:32
|
Joined: Aug 2006
Posts: 128 Papua New Guinea
Impaler
OP
Member
|
OP
Member
Joined: Aug 2006
Posts: 128
Papua New Guinea
|
hi everyone, I am making a first person shooter set in WWII in Normandie, and I want to be able to have a big library of names for soldiers, so that messages can come up like "You killed <name>" and that. The only problem is, I want to give random names to soldiers without having to script: my.skill1 = int(random(100)) if(my.skill1 == 1) {my.name = <something>;} if(my.skill1 == 2) {my.name = <something else>;}
and so on until 100. That would be really long and ugly code. is there an easier way to do this?
Murphey's Law: << if anything can go wrong, it will >> (Murphey was an optimist).
|
|
|
Re: Random Names
[Re: Xarthor]
#121349
04/05/07 06:46
04/05/07 06:46
|
Joined: Aug 2006
Posts: 128 Papua New Guinea
Impaler
OP
Member
|
OP
Member
Joined: Aug 2006
Posts: 128
Papua New Guinea
|
Thanks for those ideas! Storing the names in an array at the start of the game sounds like the best option
Murphey's Law: << if anything can go wrong, it will >> (Murphey was an optimist).
|
|
|
|