Join us at the Oolite Anniversary Party -- London, 7th July 2024, 1pm
More details in this thread.

Vortex OXP (plus the Maelstrom)

Discussion and information relevant to creating special missions, new ships, skins etc.

Moderators: another_commander, winston

Post Reply
User avatar
Wildeblood
---- E L I T E ----
---- E L I T E ----
Posts: 2290
Joined: Sat Jun 11, 2011 6:07 am
Location: Western Australia

Re: Vortex OXP (plus the Maelstrom)

Post by Wildeblood »

Why can't I just copy the entire manifest with:-

this.backupManifest = player.ship.manifest;

I just tried it and it don' work.
User avatar
SandJ
---- E L I T E ----
---- E L I T E ----
Posts: 1048
Joined: Fri Nov 26, 2010 9:08 pm
Location: Help! I'm stranded down here on Earth!

Re: Vortex OXP (plus the Maelstrom)

Post by SandJ »

Wildeblood wrote:
this.backupManifest = player.ship.manifest;

I just tried it and it don't work.
Whereas, in the Debug Console it does work:
> PS.manifest.gold
5
> fred = PS.manifest
> fred.gold = 123
> PS.manifest = fred
> PS.manifest.gold
123
Flying a Cobra Mk I Cobbie 3 with nothing but Explorers Club.OXP and a beam laser 4 proper lasers for company :D
Dropbox referral link 2GB of free space online + 500 Mb for the referral: good for securing work-in-progress.
User avatar
Wildeblood
---- E L I T E ----
---- E L I T E ----
Posts: 2290
Joined: Sat Jun 11, 2011 6:07 am
Location: Western Australia

Re: Vortex OXP (plus the Maelstrom)

Post by Wildeblood »

Capt. Murphy wrote:
According to the wiki anyway...
Cargo marshalling

When a player launches, all cargo from the manifest is loaded in cargo pods with the role “1t-cargopod”. This has some consequences for handling g and kg commodities when in flight:

Every full t of such an article that the player has is put in a barrel on launch and consumes 1 t cargo space.
Every barrel that the player scoops takes one t of cargo space even when the content is far less in weight.
Every time cargo is added by script, the added amount is added to the hold in one or more 1 t cargo pods.
Every time the cargo is reduced, it is removed from one of the barrels. When the barrel becomes empty in the process, the barrel is removed.
So should be no problem - var gold = manifest.gold;manifest.gold = 0; etc. etc. They are all read/write.
Then this should incinerate all your troublesome empty cargopods, Albee:-

https://www.box.com/s/4cc229ab9d5689dd6475

If it doesn't, Capt. Murphy can explain.
User avatar
Thargoid
Thargoid
Thargoid
Posts: 5525
Joined: Thu Jun 12, 2008 6:55 pm

Re: Vortex OXP (plus the Maelstrom)

Post by Thargoid »

OK, I just uploaded v1.25 of the OXP, which should fix this issue. Using the same trick as noted above of just removing and re-awarding the affected item types, when you scoop something or when you swap bays.

Download via the links below as normal.
User avatar
Thargoid
Thargoid
Thargoid
Posts: 5525
Joined: Thu Jun 12, 2008 6:55 pm

Re: Vortex OXP (plus the Maelstrom)

Post by Thargoid »

Oops :oops: , I just found a typo in the version 1.25 I uploaded earlier.

It's now corrected in version 1.25a, but anyone who has grabbed the new version can you please update to the newer 1.25a.
Albee
Deadly
Deadly
Posts: 154
Joined: Wed Apr 25, 2012 9:49 am
Location: Derby

Re: Vortex OXP (plus the Maelstrom)

Post by Albee »

Thargoid wrote:
...anyone who has grabbed the new version can you please update to the newer 1.25a.
I've downloaded 1.25a from Boxspace. The menu item says vortex_1.25a.zip, but the folder that actually downloads is named vortex_1, and inside the folder are Vortex 1.25.oxp and Vortex v1.25 Readme & Licence.txt. Do I have the correct version?

(Please note, your wiki page needs updating as the menu is still offering me Vortex v1.25, even though it links to 1.25a in Boxspace. I was tempted to correct it myself, but am unsure what the etiquette is where users' own pages are concerned. Is it okay to edit these, or should we contact the individual concerned?)
User avatar
Capt. Murphy
Commodore
Commodore
Posts: 1127
Joined: Fri Feb 25, 2011 8:46 am
Location: UK South Coast.

Re: Vortex OXP (plus the Maelstrom)

Post by Capt. Murphy »

SandJ wrote:
Wildeblood wrote:
this.backupManifest = player.ship.manifest;

I just tried it and it don't work.
Whereas, in the Debug Console it does work:
> PS.manifest.gold
5
> fred = PS.manifest
> fred.gold = 123
> PS.manifest = fred
> PS.manifest.gold
123
You are both running into a trap of treating a JavaScript Object (manifest) as a variable, when it's not.

In SandJ's example above you could change the value of fred.gold or manifest.gold and the new value would be reflected in both fred and manifest. You need to cycle through all of the properties of the manifest Object (gold, alienItems etc) and transfer values to variables to backup the manifest, a technique which Thargoid already uses in the Vortex and HyperCargo scripts.

Anyway we should stop spamming Thargoid's fred thread. If you want an example of a backing up the manifest routine just look at how it's already done to store the manifest contents in a missionVariable in the Vortex script.
[EliteWiki] Capt. Murphy's OXPs
External JavaScript resources - W3Schools & Mozilla Developer Network
Win 7 64bit, Intel Core i5 with HD3000 (driver rev. 8.15.10.2696 - March 2012), Oolite 1.76.1
User avatar
Thargoid
Thargoid
Thargoid
Posts: 5525
Joined: Thu Jun 12, 2008 6:55 pm

Re: Vortex OXP (plus the Maelstrom)

Post by Thargoid »

Albee wrote:
I've downloaded 1.25a from Boxspace. The menu item says vortex_1.25a.zip, but the folder that actually downloads is named vortex_1, and inside the folder are Vortex 1.25.oxp and Vortex v1.25 Readme & Licence.txt. Do I have the correct version?

(Please note, your wiki page needs updating as the menu is still offering me Vortex v1.25, even though it links to 1.25a in Boxspace. I was tempted to correct it myself, but am unsure what the etiquette is where users' own pages are concerned. Is it okay to edit these, or should we contact the individual concerned?)
Yes, you have the correct version. It is still 1.25, I just changed the zip file to ensure people can tell it apart from the one with the typo in it. There is literally about 10 bytes worth of difference between the two, hence I didn't want to fully advance the OXP name just for that.

So everything is where I want it to be at the moment, no correction required.
Albee
Deadly
Deadly
Posts: 154
Joined: Wed Apr 25, 2012 9:49 am
Location: Derby

Re: Vortex OXP (plus the Maelstrom)

Post by Albee »

Thanks, Thargoid. I'll carry on and report back my findings.

(Really like the ship, by the way. The switchable bays and pylons are fun to play with, and I like watching the plasma cannon take down an enemy after I've given him a half-hearted squirt with the laser. I love the look of the vessel too -- menacing as hell. When I see a Vortex NPC, I get a strong feeling this is someone you definitely don't want to mess with! It qualifies as a uber-ship, I suppose, but at this point I just don't care, as I'm having so much fun flying it.) :D
User avatar
SandJ
---- E L I T E ----
---- E L I T E ----
Posts: 1048
Joined: Fri Nov 26, 2010 9:08 pm
Location: Help! I'm stranded down here on Earth!

Re: Vortex OXP (plus the Maelstrom)

Post by SandJ »

Capt. Murphy wrote:
You are both running into a trap of treating a JavaScript Object (manifest) as a variable, when it's not.

In SandJ's example above you could change the value of fred.gold or manifest.gold and the new value would be reflected in both fred and manifest.
I don't think I'll ever grasp object-oriented programming. :(
Thargoid wrote:
Albee wrote:
I've downloaded 1.25a from Boxspace. The menu item says vortex_1.25a.zip, but the folder that actually downloads is named vortex_1, and inside the folder are Vortex 1.25.oxp and Vortex v1.25 Readme & Licence.txt. Do I have the correct version?
Yes, you have the correct version. It is still 1.25, I just changed the zip file to ensure people can tell it apart from the one with the typo in it. There is literally about 10 bytes worth of difference between the two, hence I didn't want to fully advance the OXP name just for that.

So everything is where I want it to be at the moment, no correction required.
Well, there is, because it has caused confusion already.

I know it is a faff to change the version number when changing a file, but you changed the file anyway. How can you be sure you don't make a mistake in the future referring back to the old version yourself? If you have to do a file restore, how will you know which is the right version?

I'm on a mission about this as over the past few weeks there has been four occasions when I have been tripped up by there being more than one release of an OXP kicking about with different functionality but at the same version number. I now keep reference copies of OXPs as downloaded so I can tell whether OXPs have changed or not by doing a byte-by-byte comparison of every OXP I have - I have done this for 1.76 and 1.76.1 and it is a pain in the arse. It would be easier if people didn't use version numbers at all, than fail to update them.

Suggestion to all OXP writers: make a copy of and change the version number of a file as soon as you change it, NOT when you have finished testing it. Then if you want to abandon the change, you just abandon the file and revert back to the previous version.

I'm sorry to whinge, and I know people take pride in the OXPs, and quite rightly so as I do know how hard and time-consuming they are to produce. But a little bit of finishing off by changing the ReadMe and checking files have the new version number would take seconds yet save testers and newbies hours.
Flying a Cobra Mk I Cobbie 3 with nothing but Explorers Club.OXP and a beam laser 4 proper lasers for company :D
Dropbox referral link 2GB of free space online + 500 Mb for the referral: good for securing work-in-progress.
User avatar
Thargoid
Thargoid
Thargoid
Posts: 5525
Joined: Thu Jun 12, 2008 6:55 pm

Re: Vortex OXP (plus the Maelstrom)

Post by Thargoid »

I understand what you mean, but as v1.25 only "existed" for a couple of hours late on a Saturday, with about 4 downloads I didn't see it as necessary. And even though the version number of the OXP itself isn't up'd, the version of the zip file is.

Plus had it been a major or critical change or bugfix then it would have got a version number update. But as it was, I just messed up the storing and restoration of the gemstones, which is a fairly minor matter given the age of this OXP and the fact that the whole issue with the non-ton items only got noticed the other day.

But rest assured, if major or influential script changes get made, the version number is incremented. And aside from the ones people download and store locally, there are no older versions around. My box account only contains the latest version of each of the OXP and is my only download site (my wiki pages point there). I do keep older reference copies, but they are on my dropbox account and are not publicly accessible generally.
Albee
Deadly
Deadly
Posts: 154
Joined: Wed Apr 25, 2012 9:49 am
Location: Derby

Re: Vortex OXP (plus the Maelstrom)

Post by Albee »

I'm happy to report that everything now appears to be working fine.

I made a note of every 'non-ton' item I scooped, and checked that the totals agreed with what was shown in the bays. (I did think I'd found a discrepancy at one point for bay 1, but I'm convinced now that was my error. I was using your Cargo Shepherd, which inevitably results in scooping up pods by the bucketload, so it's all too easy to miss individual items as they go whizzing up the screen. While filling bays 2-5 I allowed the pods to scatter in space, making it possible to scoop them one at a time. The cumulative totals agreed with my manual count thereafter).

Each full bay now contains 27 t of assorted 'ton' cargo, plus a nominal 3 t of 'non-ton' cargo -- 1 t each of gold, platinum and gem-stones -- which accumulates in every bay simultaneously, on an incremental basis. (I realise it may not be working quite this way in practice, but it's what I see as a user, so I'm choosing to think of it in those terms).

Although handling the high value stuff in this manner is utilising 15 cargo 'slots' in total (5 bays at 3 per bay), I'm more than happy with the situation as I scooped up far more than 15 individual 'non-ton' pods, so overall it's to my benefit. Possibly it runs counter to the "put the valuables in the safe and store the empty pod in the hold" storyline, but, speaking personally, that doesn't worry me overmuch.

Thanks, Thargoid, for this fix, and thanks to everyone who contributed.
User avatar
Thargoid
Thargoid
Thargoid
Posts: 5525
Joined: Thu Jun 12, 2008 6:55 pm

Re: Vortex OXP (plus the Maelstrom)

Post by Thargoid »

For both ships now the gold/platinum/gems should only come into play for the cargo hold when you have a huge amount that it starts weighing in tons. Basically whenever you scoop now or swap bays it does the empty-and-nuke-spare-pods function which should keep things neat and tidy.

I think there may still be a little risk of a problem if you end up with some cargo in a later bay, an earlier one full of non-ton cargo and then switch (as you could end up with more cargo in play than the bay can hold), but it's an unlikely scenario in normal gameplay (you need a huge amount of non-ton cargo for it to happen) and there's not much to be done about it anyway.
User avatar
Wildeblood
---- E L I T E ----
---- E L I T E ----
Posts: 2290
Joined: Sat Jun 11, 2011 6:07 am
Location: Western Australia

Re: Vortex OXP (plus the Maelstrom)

Post by Wildeblood »

Albee wrote:
Each full bay now contains 27 t of assorted 'ton' cargo, plus a nominal 3 t of 'non-ton' cargo -- 1 t each of gold, platinum and gem-stones -- which accumulates in every bay simultaneously, on an incremental basis.
That doesn't sound right to me. I think you should have 28t of usable bay, not 27t. Do you really have more than 500kg of gem stones? Or do you have more than 1500kg of gold or platinum? If you have less than 500kg of these commodities they should not take up space in the cargo bay.
Albee
Deadly
Deadly
Posts: 154
Joined: Wed Apr 25, 2012 9:49 am
Location: Derby

Re: Vortex OXP (plus the Maelstrom)

Post by Albee »

Wildeblood wrote:
Albee wrote:
Each full bay now contains 27 t of assorted 'ton' cargo, plus a nominal 3 t of 'non-ton' cargo -- 1 t each of gold, platinum and gem-stones -- which accumulates in every bay simultaneously, on an incremental basis.
That doesn't sound right to me. I think you should have 28t of usable bay, not 27t. Do you really have more than 500kg of gem stones? Or do you have more than 1500kg of gold or platinum? If you have less than 500kg of these commodities they should not take up space in the cargo bay.
No, that's definitely right. Every full bay has 27 t, plus whatever gold, platinum and gem-stones I'd collected up to that point. Below is a screenshot of bay 1 taken right after I'd filled it. (I also have screenshots of the other bays as they were filled, and later shots of bay 1 showing how the 'non-ton' cargo accumulates retrospectively).

Image
Post Reply