Some sensible tweaks

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

Moderators: another_commander, winston

User avatar
Svengali
---- E L I T E ----
---- E L I T E ----
Posts: 2370
Joined: Sat Oct 20, 2007 2:52 pm

Re: Some sensible tweaks

Post by Svengali »

Wildeblood wrote:Addendum: Has anyone ever done this in a ship OXP - adding a sound effect to a shipSpawned event to alert the player when a particular ship is about?
Cabal_Common_Music (used in Vector and the demo) does something similiar. It plays the specified musicfile when a specific ship is close to the player. Dunno if it still works in v1.80/v1.82. Oh, and establishing streams is costly.

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

Re: Some sensible tweaks

Post by Wildeblood »

phkb wrote:The problem is that "legality_export" is present on all items. It's just zero for most of them. Which means that the undocumented launch option will be available as long as the player has any cargo at all.
Yeah, nah. If it's zero the condition test (0 & 1) should fail, not pass. Something else is happening.

User avatar
Lone_Wolf
---- E L I T E ----
---- E L I T E ----
Posts: 545
Joined: Wed Aug 08, 2007 10:59 pm
Location: Netherlands

Re: Some sensible tweaks

Post by Lone_Wolf »

Wildeblood wrote: Yeah, nah. If it's zero the condition test (0 & 1) should fail, not pass. Something else is happening.
WildeBlood, that sounds like you assume js treats market[prop].legality_export as a Boolean value where 0 equates false .

legality_export is a number according to wiki, and i think js doesn't convert that into a boolean value, but interprets your condition as "does market[prop].legality_export exist" .
OS : Arch Linux 64-bit - rolling release

OXPs : My user page

I am subscribed to the threads for my oxps, if you need my attention just post in them or send a pm.

User avatar
cim
Quite Grand Sub-Admiral
Quite Grand Sub-Admiral
Posts: 4018
Joined: Fri Nov 11, 2011 6:19 pm

Re: Some sensible tweaks

Post by cim »

Lone_Wolf wrote:WildeBlood, that sounds like you assume js treats market[prop].legality_export as a Boolean value where 0 equates false .
JS treats various things as false in that sort of check - false, 0, "", null and undefined. Usually useful; occasionally a problem when the sort of false something is matters.

Post Reply