Page 4 of 5
Re: [WIP] Technical reference library OXP 0.6
Posted: Tue Mar 19, 2013 9:33 pm
by spara
Commander McLane wrote:spara wrote:Other oxps can add their classified ships to the this.$classifiedRoles array of this oxp or I can hardcode them in if preferred.
Instead of editing an array in your OXP (which will force you and everybody else to permanently update it), this would be a good case for using a
script_info
.
Array is set at start up, so that after init any oxp can add roles to it by doing worldScripts.tech_ref_lib.$classifiedRoles.push("foo"). I can also check for a key in script_info, if that's more preferable.
Re: [WIP] Technical reference library OXP 0.6
Posted: Tue Mar 19, 2013 9:41 pm
by Commander McLane
spara wrote:Commander McLane wrote:spara wrote:Other oxps can add their classified ships to the this.$classifiedRoles array of this oxp or I can hardcode them in if preferred.
Instead of editing an array in your OXP (which will force you and everybody else to permanently update it), this would be a good case for using a
script_info
.
Array is set at start up, so that after init any oxp can add roles to it by doing worldScripts.tech_ref_lib.$classifiedRoles.push("foo"). I can also check for a key in script_info, if that's more preferable.
My reasoning is that most ship OXPs don't contain a script at all, just the shipdata.plist. Thus it's most convenient for ship designers to take care of this aspect via the shipdata as well.
Re: [WIP] Technical reference library OXP 0.6
Posted: Tue Mar 19, 2013 9:42 pm
by cim
spara wrote:I can also check for a key in script_info, if that's more preferable.
Both can be good approaches in different circumstances.
script_info
has the big advantage that the Ship OXP author doesn't need to add a worldscript to their OXP solely to push data to another OXP which may or may not be installed - it can all be done in the plist. The JS approach can be useful for an OXP which may want to hide the specs temporarily but release them after a certain stage.
On the JS approach I think that it's better to provide an API function e.g.
this._classifyRole(role)
rather than have people set values directly. Then if you decide to change the internal implementation you don't need to keep that exact array around with that exact format (and other data structures with other formats from other OXP versions) to keep compatibility with other OXPs - you just need to change what's inside
_classifyRole
Re: [WIP] Technical reference library OXP 0.6
Posted: Tue Mar 19, 2013 9:51 pm
by spara
Thanks guys, I'll put them both in.
Re: [Release] Technical reference library OXP 1.0
Posted: Fri Mar 22, 2013 7:59 am
by spara
Now it's finished
. Release version 1.0 is up. I'll add it to the wiki later.
* New wireframe graphics. Graphics are taken from game's wireframe mode.
* Individual backgrounds and wireframes for the core ships.
* Added api-functions for classifying and declassifying ships.
* Added check for script_info key classifiedShip.
* Constrictor, ships from Aliens oxp, Black Monk Gunships, ships with a role bigTrader, Green Gecko and ships from Capisastra oxp are marked as classified by default.
* Textual tweaks, nothing spectacular.
Re: [Release] Technical reference library OXP 1.0
Posted: Fri Mar 22, 2013 11:39 am
by pagroove
Looks excellent but I have a question. When I lock onto a ship and press shift-n and then n the specs are shown neatly in the hud. But how do I view the library. pressing 7 won't work anymore?
Re: [Release] Technical reference library OXP 1.0
Posted: Fri Mar 22, 2013 11:51 am
by spara
pagroove wrote:Looks excellent but I have a question. When I lock onto a ship and press shift-n and then n the specs are shown neatly in the hud. But how do I view the library. pressing 7 won't work anymore?
Press b.
Re: [Release] Technical reference library OXP 1.0
Posted: Fri Mar 22, 2013 12:14 pm
by pagroove
That worked. Excellent oxp!
Re: [Release] Technical reference library OXP 1.0
Posted: Fri Mar 22, 2013 4:51 pm
by Svengali
I get lots of warnings in the log about unknown expansion keys. Maybe it's time to get rid of the approach via descriptions.plist...?
Re: [Release] Technical reference library OXP 1.0
Posted: Fri Mar 22, 2013 8:07 pm
by spara
Svengali wrote:I get lots of warnings in the log about unknown expansion keys. Maybe it's time to get rid of the approach via descriptions.plist...?
Those should only appear if some kind of extended logging (debug?) is used. I have never seen them, as I have the basic 1.77 install. I'll scratch my head a bit, if I can think of another solution.
Re: [Release] Technical reference library OXP 1.0
Posted: Fri Mar 22, 2013 11:22 pm
by Commander McLane
spara wrote:Svengali wrote:I get lots of warnings in the log about unknown expansion keys. Maybe it's time to get rid of the approach via descriptions.plist...?
Those should only appear if some kind of extended logging (debug?) is used. I have never seen them, as I have the basic 1.77 install. I'll scratch my head a bit, if I can think of another solution.
If you're writing OXPs, I would recommend that you get the test install. That's what it's for.
Re: [Release] Technical reference library OXP 1.0.1
Posted: Sat Mar 23, 2013 11:24 am
by spara
Commander McLane wrote:
If you're writing OXPs, I would recommend that you get the test install. That's what it's for.
Thanks, done. Don't really know why I have not done this before.
Svengali wrote:I get lots of warnings in the log about unknown expansion keys. Maybe it's time to get rid of the approach via descriptions.plist...?
Changed the descriptions.plist approach to a missiontext.plist approach (thanks go to Tricky for the hint) and no more errors with the test-build.
Version 1.0.1 upped with fixes to those test-version warnings.
Re: [Release] Technical reference library OXP 1.0.1
Posted: Sun Mar 24, 2013 12:57 am
by Svengali
spara wrote:Changed the descriptions.plist approach to a missiontext.plist approach (thanks go to Tricky for the hint) and no more errors with the test-build.
Looks good, spara .-)
Re: [Release] Technical reference library OXP 1.0.1
Posted: Fri Apr 12, 2013 9:23 pm
by Lestradae
Would it be possible to expand that idea to show that kind of info about ships offered in the shipyard?
Cheers
L
Re: [Release] Technical reference library OXP 1.0.1
Posted: Fri Apr 12, 2013 9:44 pm
by spara
Lestradae wrote:Would it be possible to expand that idea to show that kind of info about ships offered in the shipyard?
Cheers
L
I would like that too, but currently not possible. Check the thread:
https://bb.oolite.space/viewtopic.php?f=6&t=13983.