Sponateous cargo pickup
Moderators: winston, another_commander, Getafix
Sponateous cargo pickup
I'm coming across an odd bug.
When flying, just out of nowhere, I seem to pick up cargo as if I had picked it up with my fuel scoops. The text of what cargo it is appears on the screen and it's in my hold and counts towards my total. However, I never got the fuel scoop sound effect and never saw it on the main screen or the radar screen. It just appeared in my hold
Has anyone run into this before. I haven't removed any OXPs because it's a rather random occurence, so I can't reproduce it easily. I do have a cargo OXP, Pods 1.03, so that may be involved.
When flying, just out of nowhere, I seem to pick up cargo as if I had picked it up with my fuel scoops. The text of what cargo it is appears on the screen and it's in my hold and counts towards my total. However, I never got the fuel scoop sound effect and never saw it on the main screen or the radar screen. It just appeared in my hold
Has anyone run into this before. I haven't removed any OXPs because it's a rather random occurence, so I can't reproduce it easily. I do have a cargo OXP, Pods 1.03, so that may be involved.
- Greyman
- Dangerous
- Posts: 98
- Joined: Thu Jun 05, 2008 5:54 pm
- Location: somewhere in the Bavarian outback
Yes, I have had this happening to me too. But it won't happen regularly. I even thought it was some really late notification after picking up the cargo.
Greetings,
Greyman
Greetings,
Greyman
Get the Oolite Keymapper for Mac here!
It's a problem with the cargopods.oxp iirc. The old scripting used inside it will sometime add some cargo scooped by an NPC somewhere else in the system to the player's hold.
Hopefully, there's going to be a new version of that oxp using javascript soon. Using javascript will avoid that legacy script bug.
Hopefully, there's going to be a new version of that oxp using javascript soon. Using javascript will avoid that legacy script bug.
Hey, free OXPs: farsun v1.05 & tty v0.5! :0)
Umm he's talking about Pods, which is mine and is written in JS I'll have a look at it when I get a moment (don't hold your breath for that being before new year).
Out of interest, what cargo was it that was awarded, just to narrow things down?
Out of interest, what cargo was it that was awarded, just to narrow things down?
My OXPs via Boxspace or from my Wiki pages .
Thargoid TV
Dropbox Referral Link
Thargoid TV
Dropbox Referral Link
Pods should always award "something different", either something bad or not just a single unit of a given cargo (or fuel or missile). And all the pods are spawned by the game engine itself (they have role "cargopod").
And I think I coded them all to check that the scooper was player before doing any awarding. But I'll certainly double-check that.
And I think I coded them all to check that the scooper was player before doing any awarding. But I'll certainly double-check that.
My OXPs via Boxspace or from my Wiki pages .
Thargoid TV
Dropbox Referral Link
Thargoid TV
Dropbox Referral Link
if(scooper.isPlayer)
All the scripts have that in them, so either that isn't working as intended, or another oxp causes it...
Actually, i've seen other addons use a variation of:
if(scooper == player.ship)
dunno if that helps. (im having the random cargo bug too btw)
<EDIT> Okay, just checked every script in my addons folder, only other addons that use this.shipWasScooped is The Feudal States and Random Hits... They both use a variation of if(scooper == player.ship)
There are also two mentions in the vanilla scripts. (oolite-cloaking-device-pod.js oolite-default-ship-script.js)
All the scripts have that in them, so either that isn't working as intended, or another oxp causes it...
Actually, i've seen other addons use a variation of:
if(scooper == player.ship)
dunno if that helps. (im having the random cargo bug too btw)
<EDIT> Okay, just checked every script in my addons folder, only other addons that use this.shipWasScooped is The Feudal States and Random Hits... They both use a variation of if(scooper == player.ship)
There are also two mentions in the vanilla scripts. (oolite-cloaking-device-pod.js oolite-default-ship-script.js)
Hmmm, I might well be remembering the wrong oxp name.
I'm pretty sure there's some oxp out there that uses legacy scripts to award cargo to the player.
Afaik this is a legacy script bug: in contrast to javascript, legacy script (the one used in v1.65) cannot always tell if cargo has been scooped by the player or not.
I'm pretty sure there's some oxp out there that uses legacy scripts to award cargo to the player.
Afaik this is a legacy script bug: in contrast to javascript, legacy script (the one used in v1.65) cannot always tell if cargo has been scooped by the player or not.
Hey, free OXPs: farsun v1.05 & tty v0.5! :0)
The vanilla script "oolite-default-ship-script.js" uses:
could this be causing it?
Code: Select all
// script_actions handled on shipDidDock() and wasScooped().
if (this.legacy_scriptActions !== undefined)
{
/* legacy script_actions should be called for stations when the player
docks, and for cargo pods when they are is scooped. No sane vessel can
be scooped _and_ docked with. Non-sane vessels are certified insane.
*/
this.otherShipDocked = function (docker)
{
if (docker.isPlayer)
{
/* IMPORTANT: runLegacyScriptActions() is a private function. It
may be removed, renamed or have its semantics changed at any
time in the future. Do not use it in your own scripts.
*/
this.ship.runLegacyScriptActions(docker, this.legacy_scriptActions);
}
};
this.shipWasScooped = function (scooper)
{
/* IMPORTANT: runLegacyScriptActions() is a private function. It may
be removed, renamed or have its semantics changed at any time in
the future. Do not use it in your own scripts.
*/
// Note "backwards" call, allowing awardEquipment: and similar to affect the scooper rather than the scoopee.
scooper.runLegacyScriptActions(scooper, this.legacy_scriptActions);
};
}
- Eric Walch
- Slightly Grand Rear Admiral
- Posts: 5536
- Joined: Sat Jun 16, 2007 3:48 pm
- Location: Netherlands
CargoWreckTeaser.oxp is also a cargo adding oxp. However, it is possible in legacy scripting to determine if it was the player that scooped the cargo. I think it was two years ago that Arexack Heretic added this test to his oxp. He only made the fault that only the scoop message used this test not the awarding itself. In above report it is mentioned that also the scoop message was displayed, so it is probably not this oxp coursing the messages.Kaks wrote:Hmmm, I might well be remembering the wrong oxp name.
I'm pretty sure there's some oxp out there that uses legacy scripts to award cargo to the player.
Afaik this is a legacy script bug: in contrast to javascript, legacy script (the one used in v1.65) cannot always tell if cargo has been scooped by the player or not.
Versions 1.4 or newer of that oxp use the better JS to do this test.
UPS-Courier & DeepSpacePirates & others at the box and some older versions
- Commander McLane
- ---- E L I T E ----
- Posts: 9520
- Joined: Thu Dec 14, 2006 9:08 am
- Location: a Hacker Outpost in a moderately remote area
- Contact:
- Greyman
- Dangerous
- Posts: 98
- Joined: Thu Jun 05, 2008 5:54 pm
- Location: somewhere in the Bavarian outback
Hello,
I've been following this thread with quite some interest since I have the same problem as already stated above.
Having checked my OXPs I only have Pods 1.10.oxp and Pods-UPS 1.10.oxp installed. I haven't used the Cargo_wrecks_teaser.oxp for a very long time now. So maybe there's a small bug in Pods OXP?
I've been following this thread with quite some interest since I have the same problem as already stated above.
Having checked my OXPs I only have Pods 1.10.oxp and Pods-UPS 1.10.oxp installed. I haven't used the Cargo_wrecks_teaser.oxp for a very long time now. So maybe there's a small bug in Pods OXP?
Get the Oolite Keymapper for Mac here!
I just checked all the scripts in both, and they all check if the scooper is the player ship before doing anything (scooper.isPlayer is true).
So I'm not sure what else could be going wrong with the OXP itself, unless it's something in the underlying code somewhere in the trunk. But as I said before, if you can localise exact examples of when it happens and what cargo gets awarded it would be most helpful (from either of you). Also of course if it's repeatable, try the same circumstances with the OXP(s) disabled or removed.
PS @Chrisfs - can you update to v1.10 and see if the problem persists? Given the above input from Greyman it probably will, but it may be worth updating anyway. There was a tweak on scan class in the update plus some adjustment on role assignment, but nothing I think that would affect this question.
So I'm not sure what else could be going wrong with the OXP itself, unless it's something in the underlying code somewhere in the trunk. But as I said before, if you can localise exact examples of when it happens and what cargo gets awarded it would be most helpful (from either of you). Also of course if it's repeatable, try the same circumstances with the OXP(s) disabled or removed.
PS @Chrisfs - can you update to v1.10 and see if the problem persists? Given the above input from Greyman it probably will, but it may be worth updating anyway. There was a tweak on scan class in the update plus some adjustment on role assignment, but nothing I think that would affect this question.
My OXPs via Boxspace or from my Wiki pages .
Thargoid TV
Dropbox Referral Link
Thargoid TV
Dropbox Referral Link
In a roundabout way!ADCK wrote:The vanilla script "oolite-default-ship-script.js" uses:
<snip>
could this be causing it?
What you found is the interface that allows the latest oolite to actually run legacy scripts associated with ships. Without that no legacy scripts defined inside shipdata.plist would actually work. At all.
Hey, free OXPs: farsun v1.05 & tty v0.5! :0)
- Commander McLane
- ---- E L I T E ----
- Posts: 9520
- Joined: Thu Dec 14, 2006 9:08 am
- Location: a Hacker Outpost in a moderately remote area
- Contact: