Proper Use of Plurals With $race and $class?
Hey folks. I recently got a big batch of log files and have been sifting through all the aggro speak and such for NPCs. Here's a quick example:
Quote:
That's why I'm asking for ideas :) Thanks for any help, guys and gals. |
Instead of using $race, use ${race}s
The {} is not normally needed around the variable name in a string if it is immediately followed by something that is obviously not part of the name, like a space. so if $race = "Ogre" then quest::say("$race"); prints Ogre quest::say("${race}s"); print Ogres quest::say("$races"); gives an error because there is no variable $races Code:
quest::say("${race}s like you are better left dead than alive."); |
Fantastic! Thank you!
Any way to account for Dark Elves becoming Dark Elfs, or should we just accept it? |
Easiest to just accept it unless you feel like adding a some extra code to build the plurals yourself. Best would be a lookup table for plurals rather than trying to implement some sort of rule based determination since there aren't that many you would want plurals for anyway.
|
All times are GMT -4. The time now is 10:21 PM. |
Powered by vBulletin®, Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.