accessing random inhabitants descriptions?

Discussion and information relevant to creating special missions, new ships, skins etc.

Moderators: winston, another_commander

Post Reply
User avatar
Commander McLane
---- E L I T E ----
---- E L I T E ----
Posts: 9520
Joined: Thu Dec 14, 2006 9:08 am
Location: a Hacker Outpost in a moderately remote area
Contact:

accessing random inhabitants descriptions?

Post 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?
another_commander
Quite Grand Sub-Admiral
Quite Grand Sub-Admiral
Posts: 6626
Joined: Wed Feb 28, 2007 7:54 am

Post 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 ;-)
User avatar
Lestradae
---- E L I T E ----
---- E L I T E ----
Posts: 3095
Joined: Tue Apr 17, 2007 10:30 pm
Location: Vienna, Austria

!!!

Post by Lestradae »

1.71 is now very close to release
Hear, hear :!: :!: :!: :shock:

:D

Happy L
User avatar
Commander McLane
---- E L I T E ----
---- E L I T E ----
Posts: 9520
Joined: Thu Dec 14, 2006 9:08 am
Location: a Hacker Outpost in a moderately remote area
Contact:

Post by Commander McLane »

Thanks, another_commander, never mind.

As a workaround I just copied the inhabitants descriptions into my own descriptions.plist. 8)
User avatar
Ace Garp
Dangerous
Dangerous
Posts: 86
Joined: Sun Mar 02, 2008 7:15 am
Location: Lancashire, UK
Contact:

Post by Ace Garp »

another_commander wrote:
. . . given that 1.71 is now very close to release . . .

:D :D :D
User avatar
Arexack_Heretic
Dangerous Subversive Element
Dangerous Subversive Element
Posts: 1876
Joined: Tue Jun 07, 2005 7:32 pm
Location: [%H] = Earth surface, Lattitude 52°10'58.19"N, longtitude 4°30'0.25"E.
Contact:

Post 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.
Riding the Rocket!
another_commander
Quite Grand Sub-Admiral
Quite Grand Sub-Admiral
Posts: 6626
Joined: Wed Feb 28, 2007 7:54 am

Post 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.
Post Reply