Planetary system renaming bug
Moderators: winston, another_commander, Getafix
Planetary system renaming bug
Just noticed a little omission when planetary systems are renamed using a name key in a suitable planetinfo.plist.
It works fine for the name as it appears to Javascript and to the in-flight messages and F5 screen, but to legacy script methods (%H and %I especially) and so the mission (F5-F5) screen you still get the original system name being used.
A cosmetic issue, but one that's been overlooked so far I think.
It works fine for the name as it appears to Javascript and to the in-flight messages and F5 screen, but to legacy script methods (%H and %I especially) and so the mission (F5-F5) screen you still get the original system name being used.
A cosmetic issue, but one that's been overlooked so far I think.
My OXPs via Boxspace or from my Wiki pages .
Thargoid TV
Dropbox Referral Link
Thargoid TV
Dropbox Referral Link
- Eric Walch
- Slightly Grand Rear Admiral
- Posts: 5536
- Joined: Sat Jun 16, 2007 3:48 pm
- Location: Netherlands
Re: Planetary system renaming bug
It just does what the wiki says: planet.infoThargoid wrote:A cosmetic issue, but one that's been overlooked so far I think.
But yes. I just added a warning in the wiki that renaming is not a good option.
---
And this inconsistency after renaming makes things quite realistic. A lot of African countries have been renamed themselves since I left school. I still use the old names for a lot of them.
Also news bulletins use sometimes the new, sometimes the old names.
I remember having two guests at home from former Breslau (Polen) at home in the early eighties. This town was renamed into Wrocłav after WWII. The girls (Teachers) claimed to never have heard from the old name Breslau, while Dutch TV at that time mainly used the old, pre WWII name. But maybe Dutch TV only used the old name because they did not know how to pronounce the new name (something like Wrotzwaf, when I remember right).
So when renaming towns and countries in one generation is difficult, renaming worlds will certainly be.
UPS-Courier & DeepSpacePirates & others at the box and some older versions
- Lestradae
- ---- E L I T E ----
- Posts: 3095
- Joined: Tue Apr 17, 2007 10:30 pm
- Location: Vienna, Austria
Re: Planetary system renaming bug
Why not, instead of adding a warning about this ... unintended feature ... onto the wiki, just change this behaviour to a more wanted and consistent one?Eric Walch wrote:... I just added a warning in the wiki that renaming is not a good option.
And this inconsistency after renaming makes things quite realistic. A lot of African countries have been renamed themselves since I left school. I still use the old names for a lot of them.
Also news bulletins use sometimes the new, sometimes the old names.
So when renaming towns and countries in one generation is difficult, renaming worlds will certainly be.
Wondering sometimes
L
- Eric Walch
- Slightly Grand Rear Admiral
- Posts: 5536
- Joined: Sat Jun 16, 2007 3:48 pm
- Location: Netherlands
Re: Planetary system renaming bug
This inconsistency with renaming the system has been in Oolite forever. I don't know if it really was thought through that renaming should be possible. Names are listed everywhere in documentation and a lot of old style scripting has planet names hard-coded in the oxp. e.g. Random Hits or Galactic Navy sends you to a lot of fixed planet names. This would fail when the name changed.Lestradae wrote:Why not, instead of adding a warning about this ... unintended feature ... onto the wiki, just change this behaviour to a more wanted and consistent one?
With JS this is less of a problem. Since the last UPS release I also added a few fixed destinations, but I only stored the planet number in my code and ask Oolite for the system name when I need it.
It seemed very sensible to warn others on the wiki that changing names could cause several inconsistencies. Not only between oxp's but even within Oolite itself. And fixing this problem is probably time consuming as it will need fixing on many places in the code.
UPS-Courier & DeepSpacePirates & others at the box and some older versions
Kaks corrected an update error, when you changed the name or system properties... they where not updated until the f5 short range map was entered... for the trunk version at least
Could this might be related and might already be fixed ?..
Cheers Frame...
Could this might be related and might already be fixed ?..
Cheers Frame...
Bounty Scanner
Number 935
Number 935
I don't think so, although I will of course double-check. The new name was showing up fine in-flight on messages from JS scripting, and on the docked main (F5) screen the system name at the top was the new one.
But when you go into the mission summary screen (F5-F5) the short info mesages for OXPs like Random Hits (which I think is using the %I and/or %N substitutions) was still using the old name.
So for me it's a difference between the data accessible by JS and legacy, and that for me classes it as a bug, albeit a rather cosmetic one.
And I'm not really talking about gameplay inconsistencies (ie being told by an OXP to go to a system that no longer exists as it's name is changed), but that using different scripting functions/methods I'm getting different results that should be the same.
But when you go into the mission summary screen (F5-F5) the short info mesages for OXPs like Random Hits (which I think is using the %I and/or %N substitutions) was still using the old name.
So for me it's a difference between the data accessible by JS and legacy, and that for me classes it as a bug, albeit a rather cosmetic one.
And I'm not really talking about gameplay inconsistencies (ie being told by an OXP to go to a system that no longer exists as it's name is changed), but that using different scripting functions/methods I'm getting different results that should be the same.
My OXPs via Boxspace or from my Wiki pages .
Thargoid TV
Dropbox Referral Link
Thargoid TV
Dropbox Referral Link
A man's work is never done...
I'll have a look when my new 'improved' work schedule allows, hopefully by Friday evening at the latest!
I'll have a look when my new 'improved' work schedule allows, hopefully by Friday evening at the latest!
Hey, free OXPs: farsun v1.05 & tty v0.5! :0)
- Eric Walch
- Slightly Grand Rear Admiral
- Posts: 5536
- Joined: Sat Jun 16, 2007 3:48 pm
- Location: Netherlands
Main problem is that not every function that displays names looks if there is an override for the name. A lot of the places that need the system name just generate the name from the seedvalue, like the one in "OOStringParsing.m" that is used to expand strings:Kaks wrote:A man's work is never done...
Code: Select all
NSString *ExpandDescriptionsWithLocalsForSystemSeed(NSString *text, Random_Seed seed, NSDictionary *locals)
{
// ....deletions
[partial replaceOccurrencesOfString:@"%H"
withString:[UNIVERSE generateSystemName:seed]
options:NSLiteralSearch range:NSMakeRange(0, [partial length])];
[partial replaceOccurrencesOfString:@"%I"
withString:[NSString stringWithFormat:@"%@ian",[UNIVERSE generateSystemName:seed]]
options:NSLiteralSearch range:NSMakeRange(0, [partial length])];
Code: Select all
NSString *name = [self generateSystemName:s_seed];
NSString *inhabitants = [self generateSystemInhabitants:s_seed plural:YES];
NSString *description = DescriptionForSystem(s_seed);
NSString *override_key = [self keyForPlanetOverridesForSystemSeed:s_seed inGalaxySeed:galaxy_seed];
// check at this point
// for scripted overrides for this planet
NSDictionary *overrides = nil;
overrides = [planetInfo dictionaryForKey:PLANETINFO_UNIVERSAL_KEY];
if (overrides != nil) [systemdata addEntriesFromDictionary:overrides];
overrides = [planetInfo dictionaryForKey:override_key];
if (overrides != nil) [systemdata addEntriesFromDictionary:overrides];
overrides = [localPlanetInfoOverrides dictionaryForKey:override_key];
if (overrides != nil) [systemdata addEntriesFromDictionary:overrides];
cachedResult = [systemdata copy];
[systemdata release];
return cachedResult;
e.g. on the long range screen you see the new name on the lower left of the screen when you click on the planet, but the search for the new name will find nothing. Searching for the old name will find it and put the old name on screen.
UPS-Courier & DeepSpacePirates & others at the box and some older versions
On my system searching for the new name finds the planet? The only screen where I see the old name is the mission summary screen (F5-F5).Eric Walch wrote:e.g. on the long range screen you see the new name on the lower left of the screen when you click on the planet, but the search for the new name will find nothing. Searching for the old name will find it and put the old name on screen.
My OXPs via Boxspace or from my Wiki pages .
Thargoid TV
Dropbox Referral Link
Thargoid TV
Dropbox Referral Link
- Eric Walch
- Slightly Grand Rear Admiral
- Posts: 5536
- Joined: Sat Jun 16, 2007 3:48 pm
- Location: Netherlands
I noticed three override situations in the code. I only tested it with changing the name with JS with the System.info.name="myCustomName". Maybe there is even difference by overriding with the planetInfo.plist?Thargoid wrote:On my system searching for the new name finds the planet?
You mean the Ship's Manifest screen? I never had any systemname on that screen at all. (Only in the contract and mission messages)The only screen where I see the old name is the mission summary screen (F5-F5).
Last edited by Eric Walch on Tue May 12, 2009 9:24 pm, edited 1 time in total.
UPS-Courier & DeepSpacePirates & others at the box and some older versions
Ran a quick test
When the planet was renamed from via the planetinfo.plist file... it all works as intended. (don't know about %i and %h)
If the name is changed on the fly by a JS script, or via the debug console, then it does not work... and since planetinfo.plist is "executed" at or after or before each hyperspace jump. then a name set in the planetinfo.plist file will rename the system at each hyperspace jump, thus overriding any name set via a java script.
also i would like to clarify that this is not a bug.. but intended behaviour since
When the planet was renamed from via the planetinfo.plist file... it all works as intended. (don't know about %i and %h)
If the name is changed on the fly by a JS script, or via the debug console, then it does not work... and since planetinfo.plist is "executed" at or after or before each hyperspace jump. then a name set in the planetinfo.plist file will rename the system at each hyperspace jump, thus overriding any name set via a java script.
also i would like to clarify that this is not a bug.. but intended behaviour since
The reasons for this could be that it simply affects to much...Oolite Wiki wrote:Code: Select all
Name The name of the planet.
Example:Warning: This name is only used at the "Short Range Chart" (F6) and the "Data Screen" (F7). On the "Long Range Screen" you still will see the old name. And also %I and %H will refer to the original name. e.g the docking computer and all kind of other stuff uses these codes with original names..Code: Select all
<key>name</key> <string>The planet's name</string>
Bounty Scanner
Number 935
Number 935
I think that wiki comment is very recent, presumably the one Eric said he was going to add since I've flagged this up. And the new text is wrong, you see the change on the long range and main info screens too.
And I'm talking about a planetinfo.plist change not a js one for the name. As I said everything's working except the mission summary screen.
Set a system name with planetinfo and then go to its main station with Random Hits installed. See the name you get on the main info screen when docked (F5) - that should be the new one. Now go to the mission summary screen (F5 again) and see which system's bounty hunter's guild is giving you its rating (scripted via the %N method iirc).
And I'm talking about a planetinfo.plist change not a js one for the name. As I said everything's working except the mission summary screen.
Set a system name with planetinfo and then go to its main station with Random Hits installed. See the name you get on the main info screen when docked (F5) - that should be the new one. Now go to the mission summary screen (F5 again) and see which system's bounty hunter's guild is giving you its rating (scripted via the %N method iirc).
My OXPs via Boxspace or from my Wiki pages .
Thargoid TV
Dropbox Referral Link
Thargoid TV
Dropbox Referral Link
- Eric Walch
- Slightly Grand Rear Admiral
- Posts: 5536
- Joined: Sat Jun 16, 2007 3:48 pm
- Location: Netherlands
Actually I added that comment already a few months ago as I assumed that fixing would never happen.Thargoid wrote:I think that wiki comment is very recent, presumably the one Eric said he was going to add since I've flagged this up.
%H is also used when using the docking computer. The station broadcasts than its old name. Same as vipers that are fining you.
UPS-Courier & DeepSpacePirates & others at the box and some older versions
Fair enuff
But the long-range screen comment isn't right, it's only usages of %I, %H and %N that get it wrong. I don't normally use the docking computer that way (I normally just skip the flight bit) so haven't seen that example of the problem.
But the long-range screen comment isn't right, it's only usages of %I, %H and %N that get it wrong. I don't normally use the docking computer that way (I normally just skip the flight bit) so haven't seen that example of the problem.
My OXPs via Boxspace or from my Wiki pages .
Thargoid TV
Dropbox Referral Link
Thargoid TV
Dropbox Referral Link
Oh..Thargoid wrote:I think that wiki comment is very recent, presumably the one Eric said he was going to add since I've flagged this up. And the new text is wrong, you see the change on the long range and main info screens too.
And I'm talking about a planetinfo.plist change not a js one for the name. As I said everything's working except the mission summary screen.
Set a system name with planetinfo and then go to its main station with Random Hits installed. See the name you get on the main info screen when docked (F5) - that should be the new one. Now go to the mission summary screen (F5 again) and see which system's bounty hunter's guild is giving you its rating (scripted via the %N method iirc).
I can confirm that on the long range chart, when set in planetinfo.plist the name is changed there too, and works with the find function..
But not when you are changing the name via a Java script or debug console..
The behaviour should really be the same.
Cheers Frame..
Bounty Scanner
Number 935
Number 935