forward_weapon_type in shipyard/shippdata.plist

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

Moderators: winston, another_commander, Getafix

Post Reply
User avatar
montana05
---- E L I T E ----
---- E L I T E ----
Posts: 1166
Joined: Mon May 30, 2016 3:54 am
Location: lurking in The Devils Triangle (G1)

forward_weapon_type in shipyard/shippdata.plist

Post by montana05 »

Could somebody please explain to me what the forward_weapon_type or lasers in general in shipyard.plist are doing ? As discussed and tested here viewtopic.php?p=283537#p283537 shipdata.plist always overwrites the settings of shipyard.plist. Any laser in shipyard.plist is ignored as long as there is no entry in shipdata.plist so at a first look this field(s) seems pretty useless.
Scars remind us where we've been. They don't have to dictate where we're going.
User avatar
Old Murgh
Wiki Wizard
Wiki Wizard
Posts: 640
Joined: Sat Dec 04, 2021 11:01 pm

Re: forward_weapon_type in shipyard/shippdata.plist

Post by Old Murgh »

montana05 wrote: Sun May 01, 2022 2:13 pm
Could somebody please explain to me what the forward_weapon_type or lasers in general in shipyard.plist are doing ? As discussed and tested here viewtopic.php?p=283537#p283537 shipdata.plist always overwrites the settings of shipyard.plist. Any laser in shipyard.plist is ignored as long as there is no entry in shipdata.plist so at a first look this field(s) seems pretty useless.
I'm assuming you are applying it to a player-only ship, in which case it is useless, but in an NPC entry it is useful. It's like what's the point of view position coords on an NPCship?

But the moment a playership or NPCship is a tiny brief entry drawing its bulk info from an is_template ship, it doesn't hurt to have all the parameters..
I was young, I was naïve. [EliteWiki] Jonny Cuba made me do it!
User avatar
montana05
---- E L I T E ----
---- E L I T E ----
Posts: 1166
Joined: Mon May 30, 2016 3:54 am
Location: lurking in The Devils Triangle (G1)

Re: forward_weapon_type in shipyard/shippdata.plist

Post by montana05 »

Old Murgh wrote: Sun May 01, 2022 2:49 pm
montana05 wrote: Sun May 01, 2022 2:13 pm
Could somebody please explain to me what the forward_weapon_type or lasers in general in shipyard.plist are doing ? As discussed and tested here viewtopic.php?p=283537#p283537 shipdata.plist always overwrites the settings of shipyard.plist. Any laser in shipyard.plist is ignored as long as there is no entry in shipdata.plist so at a first look this field(s) seems pretty useless.
I'm assuming you are applying it to a player-only ship, in which case it is useless, but in an NPC entry it is useful. It's like what's the point of view position coords on an NPCship?

But the moment a playership or NPCship is a tiny brief entry drawing its bulk info from an is_template ship, it doesn't hurt to have all the parameters..
I might be wrong but shipyard.plist is for player-ships only, it doesn't affect any NPC as much as I know. While I usually even set default values (just to be sure) it is kind of confusing to have a seemingless useless parameter. While testing the individual shipyard, I saw several ships getting their lasers reduced because their authors believed, same like me in the past, that shipyard.plist will overwrite shipdata.plist.
Scars remind us where we've been. They don't have to dictate where we're going.
User avatar
Old Murgh
Wiki Wizard
Wiki Wizard
Posts: 640
Joined: Sat Dec 04, 2021 11:01 pm

Re: forward_weapon_type in shipyard/shippdata.plist

Post by Old Murgh »

montana05 wrote: Sun May 01, 2022 11:51 pm
I might be wrong but shipyard.plist is for player-ships only, it doesn't affect any NPC as much as I know. While I usually even set default values (just to be sure) it is kind of confusing to have a seemingless useless parameter. While testing the individual shipyard, I saw several ships getting their lasers reduced because their authors believed, same like me in the past, that shipyard.plist will overwrite shipdata.plist.
Sorry, my brain dyslexed your word order. Yes you're right, that' shouldn't be the case. I'll test when I get a chance.
I was young, I was naïve. [EliteWiki] Jonny Cuba made me do it!
User avatar
Nite Owl
---- E L I T E ----
---- E L I T E ----
Posts: 556
Joined: Sat Jan 20, 2018 4:08 pm
Location: In The Dark

Re: forward_weapon_type in shipyard/shippdata.plist

Post by Nite Owl »

Pure speculation on my part but...

If the shipdata.plist designates a specific laser, lets say a Military Laser for the sake of discussion, and the shipyard.plist designates no laser at all. Does it then follow that any Shipyard could offer that ship with a less powerful laser, say a Pulse or Beam Laser, instead of the desired Military Laser from the shipdata.plist. Does that make sense of it? Basically the entry in the shipyard.plist is there only to ensure that the desired type of laser is the minimum that could be offered at a Shipyard for that specific ship. It then follows that the two entries from each .plist should match to get the desired result or that no entry should be entered in either .plist to allow any laser to be fitted at a Shipyard.

Have not even gone into the Standard Equipment versus Optional Equipment aspects of the shipyard.plist. Just trying to make sense of the entries that are under discussion here.
Humor is the second most subjective thing on the planet

Brevity is the soul of wit and vulgarity is wit's downfall

Good Night and Good Luck - Read You Soon
User avatar
Old Murgh
Wiki Wizard
Wiki Wizard
Posts: 640
Joined: Sat Dec 04, 2021 11:01 pm

Re: forward_weapon_type in shipyard/shippdata.plist

Post by Old Murgh »

My first tests are like Montana says.
The shipdata overrides the standard shipyard designation. Then weirdly, when writing military laser in the shipyard and a pulse in the shipdata, the ship is sold with no laser (though ML was present in the optional list). To me it seems like something resembling a bug, but a more systematic tester might see the explanation..
I was young, I was naïve. [EliteWiki] Jonny Cuba made me do it!
User avatar
montana05
---- E L I T E ----
---- E L I T E ----
Posts: 1166
Joined: Mon May 30, 2016 3:54 am
Location: lurking in The Devils Triangle (G1)

Re: forward_weapon_type in shipyard/shippdata.plist

Post by montana05 »

Nite Owl wrote: Mon May 02, 2022 9:18 pm
Pure speculation on my part but...
Basically the entry in the shipyard.plist is there only to ensure that the desired type of laser is the minimum that could be offered at a Shipyard for that specific ship.
Good thought, but while in my test-runs I had a rear laser who wasn't defined in the shipdata.plist but in the shipyard.plist as military. The result when I bought the ship was no rear laser at all.
Scars remind us where we've been. They don't have to dictate where we're going.
User avatar
Slartibartfast
Deadly
Deadly
Posts: 175
Joined: Mon Jan 21, 2008 3:54 pm

Re: forward_weapon_type in shipyard/shippdata.plist

Post by Slartibartfast »

Hello
Basically the entry in the shipyard.plist is there only to ensure that the desired type of laser is the minimum that could be offered at a Shipyard for that specific ship.
hmm
maybe ... but my eyes, that would make no sense to set a "minimum"
-- why should a "big ship" not be able to carry small lasers?

i think, only the other way round makes sense
define "max-laser_(power)" in shipdata

- shipdata (technical part) should define the ability of the "hull" to carry equipment

- shipyard should define, how a new ship is equipped and what you can buy
( regarding to the maximum, which is set in shipdata)

matthias
Oolite 1.91 / Imp. Trader ( slighly modified :wink: ) on Lubuntu 22.04 LTS on AMD64 2x 3800+ ,
ATI Radeon R7240 XFS / Samsung TV 40" 1080p
C-Media CMI8738 / Yamaha RX-V575 / DIY-Speaker
Logitech Attack3 & standard german keyboard
User avatar
Slartibartfast
Deadly
Deadly
Posts: 175
Joined: Mon Jan 21, 2008 3:54 pm

Re: forward_weapon_type in shipyard/shippdata.plist

Post by Slartibartfast »

hi
O.K. then we need a "2nd part" for equipment in "shipdata"
-EQ , that is set fo npc-ships, (only npc! ), because you have no shipyard
( which should also fit to the "hull-data" )
---------
or ..... a "virtual" shipyard - that equips npc-ships randomly
( regarding to the hull-data " set in shipdata )
....
oh .. i see that would cause a lot of work :-(
matthias
Oolite 1.91 / Imp. Trader ( slighly modified :wink: ) on Lubuntu 22.04 LTS on AMD64 2x 3800+ ,
ATI Radeon R7240 XFS / Samsung TV 40" 1080p
C-Media CMI8738 / Yamaha RX-V575 / DIY-Speaker
Logitech Attack3 & standard german keyboard
User avatar
montana05
---- E L I T E ----
---- E L I T E ----
Posts: 1166
Joined: Mon May 30, 2016 3:54 am
Location: lurking in The Devils Triangle (G1)

Re: forward_weapon_type in shipyard/shippdata.plist

Post by montana05 »

phkb wrote: Thu May 05, 2022 5:44 am
Sorry, I missed this originally. I'll check out what the source is doing and report back.
Ahem, Ahem, any news regarding this ?
Scars remind us where we've been. They don't have to dictate where we're going.
User avatar
phkb
Impressively Grand Sub-Admiral
Impressively Grand Sub-Admiral
Posts: 4830
Joined: Tue Jan 21, 2014 10:37 pm
Location: Writing more OXPs, because the world needs more OXPs.

Re: forward_weapon_type in shipyard/shippdata.plist

Post by phkb »

OK, I've had a look at what's going on, and can confirm this is a bug. The weapon info is is picked up from the shipyard data, but never actually applied into the final ship object. I have a fix, which I'll try and publish in the next few days.

If you want to compile and play yourself, add these two lines to "Universe.m" at line 8630 (if should be just below this statement: OOWeaponType aftWeapon = OOWeaponTypeFromEquipmentIdentifierSloppy(aftWeaponString);)

Code: Select all

			if (fwdWeapon && fwdWeaponString) [shipDict setObject:fwdWeaponString forKey:KEY_EQUIPMENT_FORWARD_WEAPON];
			if (aftWeapon && aftWeaponString) [shipDict setObject:aftWeaponString forKey:KEY_EQUIPMENT_AFT_WEAPON];
User avatar
montana05
---- E L I T E ----
---- E L I T E ----
Posts: 1166
Joined: Mon May 30, 2016 3:54 am
Location: lurking in The Devils Triangle (G1)

Re: forward_weapon_type in shipyard/shippdata.plist

Post by montana05 »

phkb wrote: Sat May 28, 2022 7:11 am
OK, I've had a look at what's going on, and can confirm this is a bug. The weapon info is is picked up from the shipyard data, but never actually applied into the final ship object. I have a fix, which I'll try and publish in the next few days.

If you want to compile and play yourself, add these two lines to "Universe.m" at line 8630 (if should be just below this statement: OOWeaponType aftWeapon = OOWeaponTypeFromEquipmentIdentifierSloppy(aftWeaponString);)

Code: Select all

			if (fwdWeapon && fwdWeaponString) [shipDict setObject:fwdWeaponString forKey:KEY_EQUIPMENT_FORWARD_WEAPON];
			if (aftWeapon && aftWeaponString) [shipDict setObject:aftWeaponString forKey:KEY_EQUIPMENT_AFT_WEAPON];
Thank you for your effort, phkb, I did suspect that much after my tests. Slartibartfast was right.

Since you already checked the source here, another one, longtime reported but never solved:

scan_description in the shipdata.plist seems to crash the game, no hints in the log to find. When used in a script, there are no obvious problems. It could be a matter of numbers, back then I tried to create a complete new category, "navy ship", and therefore quite some ships had this description assigned when I left the station.
Scars remind us where we've been. They don't have to dictate where we're going.
User avatar
phkb
Impressively Grand Sub-Admiral
Impressively Grand Sub-Admiral
Posts: 4830
Joined: Tue Jan 21, 2014 10:37 pm
Location: Writing more OXPs, because the world needs more OXPs.

Re: forward_weapon_type in shipyard/shippdata.plist

Post by phkb »

Looks like another_commander has just checked in a fix for the scan_description bug!
User avatar
montana05
---- E L I T E ----
---- E L I T E ----
Posts: 1166
Joined: Mon May 30, 2016 3:54 am
Location: lurking in The Devils Triangle (G1)

Re: forward_weapon_type in shipyard/shippdata.plist

Post by montana05 »

phkb wrote: Sat May 28, 2022 8:30 am
Looks like another_commander has just checked in a fix for the scan_description bug!
Hurray :D , the last time I mentioned this bug was 2018, and I am sure I reported it the first time ways before. :roll:
Scars remind us where we've been. They don't have to dictate where we're going.
Post Reply