using [commander_name] etc. in descriptions.plist

For test results, bug reports, announcements of new builds etc.

Moderators: winston, another_commander, Getafix

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:

using [commander_name] etc. in descriptions.plist

Post by Commander McLane »

[commander_name] etc. don't work when used in descriptions.plist, they are not expanded.

Is there a workaround for that? Or can they be made expandable also if used in descriptions.plist?

That would come in handy for randomized hails which contain the player's name, or ship name, etc.
User avatar
JensAyton
Grand Admiral Emeritus
Grand Admiral Emeritus
Posts: 6657
Joined: Sat Apr 02, 2005 2:43 pm
Location: Sweden
Contact:

Re: using [commander_name] etc. in descriptions.plist

Post by JensAyton »

Commander McLane wrote:
[commander_name] etc. don't work when used in descriptions.plist, they are not expanded.
This, as stated, is not true. However, descriptions.plist is used in at least a dozen ways. In what context are expansions not working?
User avatar
Eric Walch
Slightly Grand Rear Admiral
Slightly Grand Rear Admiral
Posts: 5536
Joined: Sat Jun 16, 2007 3:48 pm
Location: Netherlands

Re: using [commander_name] etc. in descriptions.plist

Post by Eric Walch »

Ahruman wrote:
Commander McLane wrote:
[commander_name] etc. don't work when used in descriptions.plist, they are not expanded.
This, as stated, is not true. However, descriptions.plist is used in at least a dozen ways. In what context are expansions not working?
Coincidence or not, but I stumbled over this one hour ago. In the console:

Code: Select all

expandDescription("[commanders_name]")
expands correct but

Code: Select all

expandDescription("[who_is_there]")
with in descriptions.plist who_is_there = ("My name is [commanders_name]); expands into:

Code: Select all

"My name is commanders_name"
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 »

Eric: It's [commander_name], without an "s".

Ahruman: Okay, let me fiddle some more. Perhaps I'll get it working.
User avatar
Kaks
Quite Grand Sub-Admiral
Quite Grand Sub-Admiral
Posts: 3009
Joined: Mon Jan 21, 2008 11:41 pm
Location: The Big Smoke

Post by Kaks »

Fixed in trunk.

Looking at the code, it left all '[commander_xxx]' tokens unexpanded - 'intentionally' - in 'some' circumstances, like nested string expansion...

Mission variables do expand properly, for the moment you can use those instead.
Hey, free OXPs: farsun v1.05 & tty v0.5! :0)
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 »

So it's not my stupidity. :)

Thanks for fixing it! :D
Post Reply