Page 2 of 2

Posted: Tue Jul 24, 2007 3:28 pm
by Arexack_Heretic
re-using a rockhermit from the basic game and a advertisement board from DrNil, maybe a few extra struts, and you have a "Ye olde Hermitage" shop.
:D

Posted: Tue Jul 24, 2007 3:44 pm
by The Dreamcatcher
Arexack_Heretic wrote:
re-using a rockhermit from the basic game and a advertisement board from DrNil, maybe a few extra struts, and you have a "Ye olde Hermitage" shop.
:D
I really like the idea of that, but unfortunately have no idea whatsoever of how to go about it.

Posted: Tue Jul 24, 2007 3:53 pm
by Disembodied
Arexack_Heretic wrote:
re-using a rockhermit from the basic game and a advertisement board from DrNil, maybe a few extra struts, and you have a "Ye olde Hermitage" shop.
:D
That's true... people must do something with old asteroid mines, once they've been completely hollowed out. Set one spinning and you could even get some gravity inside.

Posted: Tue Jul 24, 2007 4:03 pm
by Arexack_Heretic
The Dreamcatcher wrote:
Arexack_Heretic wrote:
re-using a rockhermit from the basic game and a advertisement board from DrNil, maybe a few extra struts, and you have a "Ye olde Hermitage" shop.
:D
I really like the idea of that, but unfortunately have no idea whatsoever of how to go about it.
hmm... it would require a bit of playing around with the positionings of the subentities as the models are all in .dat format, but it should be doable.

-----
A small 10 step tutorial on how you could go about this:

Code: Select all

1- learn how plist dictionaries work (similar to XML)
2- make an empty shipdata.plist in /Addons/YOUROXP/Config/
3- copy/paste into shipdata: from the oolite game data hermitage (including subentity entries referred to)
3a- rename the entitykey to hermitage_my_shop
3b- delete all entries but the subentities and roles.
3c- add the key like_ship and refer this to the rock-hermit.
3d- add into subentities the billboard and optional extra struts.
3e- change the role to 'my_shop_role'
4- copy/pasteinto shipdata: from Dr.Nil's YourAddHere_oxp, the shipadata entry for a billboard.
4a change again the entity-keys and make sure this corresponds to the names used in the hermitage subentities.
4b set roles to shop_subentity_sign
5- copy paste into /models/ that bilboard 
6- copy/paste it's associated texture to /textures/.
6a- edit the texture and rename it.
6b open with a texteditor the .dat in /models/,  rename references to the texture you renamed to the new name.
7- open the texture with a grafics program.
7a- change the texture-image, to a shop sign. (save as PNG, overwrite the old file) 

8- download a small testscript from one of the boards, (so that you can observe the new shop in-game). put the file in /config/.
(8a- you could also use the demoships.plist file, but I found that is pretty buggy with subentities sometimes) 

9-run the game
9a - meet your shop. look at subentity placement. make notes. exit game.

10a- adjust the quaternion coordinates for the subentities. 
10b- goto: 9
9 and 10 will probably be the hardest part.
And are usually a good reason to just make your own models. ;)
Maybe the SHIPYARD-utility could be of use here, as it can manipulate .dat files (IIRC). Only available for Mac though.

Edit: I forgot about adding shipyard and equipment data etc, but you have info on that already.

Disclaimer: as with all my code, this tut is probably crawling with bugs. ;)

Posted: Tue Jul 24, 2007 8:03 pm
by JensAyton
Disembodied wrote:
OK, thanks. Just so I'm clear: the conditions key would specify a percentage chance of an item being available for sale, so (despite the strident objections from certain anti-competitive types) it would be possible, with <key>conditions</key><string>d100_8</string> to make Nodding Trumbles twice as common as <key>conditions</key><string>d100_4</string> The Machine That Goes PING?
The syntax is “d100_number lessthan 4” (or 8, as the case may be), but yes.
Disembodied wrote:
And I'm assuming that available_to_all means that these pieces of equipment could be found on NPC ships and ships available for purchase.
No, it means that the player can buy it regardless of what ship is being used. Equipment which is not marked available_to_all can only be bought if your ship’s shipyard.plist entry specifies it as optional equipment.

NPCs will never use equipment not specified in their shipdata.plist entry.

Posted: Wed Jul 25, 2007 9:48 am
by Arexack_Heretic
that is one minor problem with equipment oxps:
NPCs don't have them, unless the EQ can be fitted into a class like MISSILE or such.
Could I make a request for an additional file that defines the format of shipdata entries?

(ie: I make Ping-machine.
now I add to this shipdata_syntax.file the information that makes a new entry <key>hasPing</key>, which accepts /True, /False, 0.0-1.0.
or returns <key>hasPing<key> <False/> unless overriden by the shipdata.)
Obviously the form of accepted input (bool/ integer/ string/ etc) for the newentry would need to be described as well in the syntaxfile.

Posted: Wed Jul 25, 2007 12:17 pm
by JensAyton
Nah. The proper way to handle that sort of thing would be to add an extra_equipment array (or possibly dictionary) to shipdata.plist entries. It would also be necessary to make internal changes to make NPC ships handle the extra equipment. In general, this is part of making NPC ships more like player ships, which is something I’d like to do but which is not going to happen until after the next stable release. (I’ve already got way to much stuff scheduled for that…)

Posted: Wed Jul 25, 2007 3:29 pm
by Disembodied
Thanks, all! All very interesting... gradually, the mental fog begins to lift... whether it will ever clear enough for me to do anything more than guddle around to no real purpose is, as yet, unknown: but who knows? Stranger things have happened. Not often, admittedly -- but every bell curve has those little pointy bits at either end.

Posted: Thu Jul 26, 2007 8:50 pm
by Eric Walch
what would be a good way of making them relatively rare, apart from giving them stupidly high tech levels? Is it possible to make types of equipment only available in certain places?
Some methods have been showed. The best method with "available to all" works only with version 1.68 or newer. I used a method that works with older versions. Set the technical level to high to be purchased. Then define the conditions on witch the item should show up. If true he gets a level of 1, if false, it is reset to its original tech-level and won't show up at that station.
<key>conditions</key>
<array>
<string>status_string equal STATUS_DOCKED</string>
<string>systemGovernment_number equal 0</string>
</array>
<key>do</key>
<array>
<string>set: mission_TL_FOR_EQ_UPS_POLICE_SCANNER 1</string>
</array>
<key>else</key>
<array>
<string>reset: mission_TL_FOR_EQ_UPS_POLICE_SCANNER</string>
</array>
Eric Walch

Re: Useless Junk

Posted: Sun Mar 07, 2021 12:06 am
by Cholmondely
Is this still true for Oolite v.1.90?

Or is it now Useless Junk?