Page 1 of 1

accessing random inhabitants descriptions?

Posted: Fri Apr 18, 2008 6:42 am
by Commander McLane
Is there a way to access the random inhabitants description in a script? So you could randomly get something like "a Fierce Green Bony Feline"?

I know that A_H experimented with things like [%i3] in Cargo Wrecks Teaser, but these did obviously not work.

So, can we address the inhabitants-array in descriptions.plist in some way?

Posted: Fri Apr 18, 2008 8:59 am
by another_commander
As far as I am aware we cannot. I have just written up a new JS global function called randomInhabitantsDesc(), which can take one argument or no arguments at all. Without arguments, it generates a pseudo-random inhabitants singular form string, with arguments (like randomInhabitantsDesc(1)), it will generate an inhabitants string in plural.

I hope this is OK for now. But I am a bit hesitant to check it in at this moment, given that 1.71 is now very close to release and I don't really want to add any more features without enough time to check that they work properly. I guess that (if it really works as intended) it could maybe be one of the first features of 1.72 ;-)

!!!

Posted: Fri Apr 18, 2008 9:20 am
by Lestradae
1.71 is now very close to release
Hear, hear :!: :!: :!: :shock:

:D

Happy L

Posted: Fri Apr 18, 2008 11:48 am
by Commander McLane
Thanks, another_commander, never mind.

As a workaround I just copied the inhabitants descriptions into my own descriptions.plist. 8)

Posted: Fri Apr 18, 2008 6:10 pm
by Ace Garp
another_commander wrote:
. . . given that 1.71 is now very close to release . . .

:D :D :D

Posted: Sat May 17, 2008 1:23 am
by Arexack_Heretic
lol.
That is what I did too.
in the new and more fixed Wrex_cargopods.

I added a few more colours though.

Posted: Sat May 17, 2008 11:30 am
by another_commander
Thanks for reminding me about this. It's now in for 1.72. To use it, you will just have to do in your script something like

Code: Select all

let myInhabitantsDescription = randomInhabitantsDescription(inPlural);
The inPlural variable is a boolean type variable that defines whether the description is in plural or singular form. If inPlural is set to true, then an inhabitants description in plural is generated. If it is false, then the description is in singular.

As a shortcut, if you want a description in singular form, you can also write the function call like this:

Code: Select all

let myLonelyInhabitantDescription = randomInhabitantsDescription();
No parameter passed => singular form.