Just a quick note that in the latest trunk version, I think you need to change the script to player.ship.target.bounty as player.target.bounty does not seem to work.
Thanks...
does player.ship work in 1.71.2 ? In that case I will make the corrections right away...
Edit
Answering that one myself.. and that is a negative... player.ship.target.bounty does not work in 1.71
Just a quick note that in the latest trunk version, I think you need to change the script to player.ship.target.bounty as player.target.bounty does not seem to work.
This change will affect more that 50% of the oxp's with JS. e.g. all mission oxp's won't work proper anymore. Most check for "player.docked" which becomes "player.ship.docked".
I already started changing things in some of my oxp's to let them work with both Oolite versions, I a similar way as Frame showed above.
Most JS methods should still work in trunk, but may give warnings. For some reason a few of them dont work properly. I think player.target is one of them. But it could be that I have broken it in my copy
if (0 < oolite.compareVersion("1.72"))
{
// 1.71.x or earlier
this.thePlayerShip = player;
}
else
{
// 1.72 or later
this.thePlayerShip = player.ship;
}
Cmdr James wrote:
Just a quick note that in the latest trunk version, I think you need to change the script to player.ship.target.bounty as player.target.bounty does not seem to work.
Weird, player.target.bounty works here (with a warning). Have you rebuilt the cache since I last changed the prefix script? :-)
if (0 < oolite.compareVersion("1.72"))
{
// 1.71.x or earlier
this.thePlayerShip = player;
}
else
{
// 1.72 or later
this.thePlayerShip = player.ship;
}
yeah missed 1.71.1, but when i print out to tthe debug console, i get "1,71,2" not "1.71.2".. so does this mean we got different outputs for mac and windows, or can this might be keyboard langauge related ?
I’m rather surprised that it happens in that context, but this is down to a bug in the C standard library implementation in Windows – in violation of the spec, it applies locale settings in certain contexts by default. Anyway, you’ll get commas or points depending on system language settings, but only under Windows, and your test won’t work at all on English-language installations. It’s entirely possible that this means oolite.compareVersion() and requires.plist don’t work properly in non-English versions of Windows, though.
I’m rather surprised that it happens in that context,
The same with me on a Mac. When I type "oolite.version" in the console I get the version comma separated. But compare version works for me. There I use points however.
The reason is simple: oolite.version is not a string but an array. oolite.versionString is a string. The idea that [1, 72] == "1,72" hadn’t occurred to me.
V1.03 still seems to be reporting a spawned Thargoid Warship (role "oolite-thargoid") as a bounty of 460c, even though on nuking it yields 100c?
i´ll make a special check for thargoids with bounty more than 100 cr... and show the correct bounty awarded, which will be maximum 100 cr... in version 1.04...
... show the correct bounty awarded, which will be maximum 100 cr... in version 1.04...
Why the 100Cr maximum?
dunno, just is so... Thargoid bounty is max 100, not sure for the robot fighters though... i known theire bounty goes up if they hit a police ship... wheter or not it maxs out at 100, i dont know.
in case anyone wonders. this has nothing to do with this OXP, it is a hard-coded max bounty for Thargoids...