[UPDATED RELEASE]-Police IFF Scanner 1.3.1 (18/12/11)
Moderators: winston, another_commander
- Capt. Murphy
- Commodore
- Posts: 1127
- Joined: Fri Feb 25, 2011 8:46 am
- Location: UK South Coast.
Re: [UPDATED RELEASE] - Police IFF Scanner Upgrade 1.2 (25/6
Just uploaded version 1.2.
Because I didn't read the JS documentation properly I missed out some brackets on my Timer start/stop functions in the last release. Fortunately this didn't break functionality at all and in the context of this script wouldn't cause a problem. Strangely this error doesn't produce a JS syntax error in the log, and I only realised my error whilst writing the Broken HUD/Scanner OXP script.
Because I didn't read the JS documentation properly I missed out some brackets on my Timer start/stop functions in the last release. Fortunately this didn't break functionality at all and in the context of this script wouldn't cause a problem. Strangely this error doesn't produce a JS syntax error in the log, and I only realised my error whilst writing the Broken HUD/Scanner OXP script.
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
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
- Wildeblood
- ---- E L I T E ----
- Posts: 2453
- Joined: Sat Jun 11, 2011 6:07 am
- Location: Western Australia
- Contact:
Re: [UPDATED RELEASE] - Police IFF Scanner Upgrade 1.2 (25/6
Words cannot express how much I hate the syntax of JS. I might have mentioned it previously.Capt. Murphy wrote:Because I didn't read the JS documentation properly I missed out some brackets on my Timer start/stop functions in the last release. Fortunately this didn't break functionality at all and in the context of this script wouldn't cause a problem. Strangely this error doesn't produce a JS syntax error in the log, and I only realised my error whilst writing the Broken HUD/Scanner OXP script.
I just had an idea:-
As is, you target a ship, the ident computer tells you what model of ship it is, and its legal status. That's all well and good. But recall when Capt. Murphy first revealed this OXP, I complained that pirates aren't likely to carry an "I'm a fugitive" transponder, so how can you tell their legal status? I stand by that criticism, but now realize that it could explain itself: you know a ship is a fugitive because it carries no transponder.
So here's the idea: you target a ship and instead of the ident computer displaying e.g. "Cobra 3 (clean)", "Cobra 3 (offender)" or "Cobra 3 (fugitive)" it displays "Cobra 3 (clean)", "Cobra 3 (offender)" or "No transponder (fugitive)". This way, you'd know a ship was a fugitive (i.e. pirate), but not what model of ship it was. No standing off at the edge of scanner range pinging pirates with the ident computer when they're only two or three pixels on screen and cherry-picking the easy targets, you'd have to move close enough to see them if you wanted to know what they were.
if this.ship.legalStatus some syntax fugitive then this.ship.displayName some syntax "No transponder"
- Capt. Murphy
- Commodore
- Posts: 1127
- Joined: Fri Feb 25, 2011 8:46 am
- Location: UK South Coast.
Re: [UPDATED RELEASE] - Police IFF Scanner Upgrade 1.2 (25/6
Feel free to use the following if you want to do this. Should work from a world-script. Could be built in to your renaming ships OXP. Explicitly excludes Thargoids from having to have a transponder.Wildeblood wrote:if this.ship.legalStatus some syntax fugitive then this.ship.displayName some syntax "No transponder"
Edit - actually you might want to limit the renaming to ships with role pirate - otherwise you might be renaming named ships from a mission OXP......
Code: Select all
this.shipTargetAcquired = function(target)
{
if (target.isPirate && target.bounty > 50)
{
target.displayName = "No Transponder!";
}
}
Last edited by Capt. Murphy on Sun Jun 26, 2011 9:02 am, edited 1 time in total.
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
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
Re: [UPDATED RELEASE] - Police IFF Scanner Upgrade 1.2 (25/6
Brilliant idea!So here's the idea: you target a ship and instead of the ident computer displaying e.g. "Cobra 3 (clean)", "Cobra 3 (offender)" or "Cobra 3 (fugitive)" it displays "Cobra 3 (clean)", "Cobra 3 (offender)" or "No transponder (fugitive)". This way, you'd know a ship was a fugitive (i.e. pirate), but not what model of ship it was. No standing off at the edge of scanner range pinging pirates with the ident computer when they're only two or three pixels on screen and cherry-picking the easy targets, you'd have to move close enough to see them if you wanted to know what they were.
if this.ship.legalStatus some syntax fugitive then this.ship.displayName some syntax "No transponder"
Re: [UPDATED RELEASE] - Police IFF Scanner Upgrade 1.2 (25/6
The only problem I see with this approach is that it may tangle up things like the bounty scanner (and other ones which play with display name).
It will need careful compatability testing I think.
It will need careful compatability testing I think.
My OXPs via Boxspace or from my Wiki pages .
Thargoid TV
Dropbox Referral Link
Thargoid TV
Dropbox Referral Link
- Capt. Murphy
- Commodore
- Posts: 1127
- Joined: Fri Feb 25, 2011 8:46 am
- Location: UK South Coast.
Re: [UPDATED RELEASE] - Police IFF Scanner Upgrade 1.2 (25/6
It would probably be better to include the functionality in an updated bounty scanner....but is Frame around to ask?
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
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
- Wildeblood
- ---- E L I T E ----
- Posts: 2453
- Joined: Sat Jun 11, 2011 6:07 am
- Location: Western Australia
- Contact:
Re: [UPDATED RELEASE] - Police IFF Scanner Upgrade 1.2 (25/6
That's why I was thinking of a script that changed it (the displayName) when it (the ship) was first first created. Leaving it until the the player actually targets the ship is too late.Thargoid wrote:The only problem I see with this approach is that it may tangle up things like the bounty scanner (and other ones which play with display name).
It will need careful compatability testing I think.
Regarding the Bounty Scanner in particular, from a game play point of view, if it did hide the bounty on fugitives, well you know it's at least $50. I think it would only be wrong if it fouled up the bounty display on non-fugitive "offenders".
Re: [UPDATED RELEASE] - Police IFF Scanner Upgrade 1.2 (25/6
I was thinking more that we could end up with less displayName, and more displayEssay.
When those names get too long, they don't look very good.
When those names get too long, they don't look very good.
My OXPs via Boxspace or from my Wiki pages .
Thargoid TV
Dropbox Referral Link
Thargoid TV
Dropbox Referral Link
- Capt. Murphy
- Commodore
- Posts: 1127
- Joined: Fri Feb 25, 2011 8:46 am
- Location: UK South Coast.
Re: [UPDATED RELEASE] - Police IFF Scanner Upgrade 1.2 (25/6
It could be done like that.
Under a
But the trick is to exclude entities that have been given a custom name by another OXP....
Maybe only include entities whose
Something like this......
Under a
this.shipLaunchedFromStation = this.shipExitedWitchspace = function()
handler. But the trick is to exclude entities that have been given a custom name by another OXP....
Maybe only include entities whose
displayName == name
Something like this......
Code: Select all
this.shipLaunchedFromStation = this.shipExitedWitchspace = function()
{
function findfugitives(entity)
{
return (entity.displayName == entity.name && entity.bounty > 50);
}
var targets = system.filteredEntities(this, findfugitives);
if (targets.length > 0)
{
let counter = 0;
for (counter = 0; counter < targets.length;counter++)
{
targets[counter].displayName = "No Transponder";
}
}
}
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
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
- Wildeblood
- ---- E L I T E ----
- Posts: 2453
- Joined: Sat Jun 11, 2011 6:07 am
- Location: Western Australia
- Contact:
Re: [UPDATED RELEASE] - Police IFF Scanner Upgrade 1.2 (25/6
Well then, changing "Vortex - Keeper of Darkness: Bounty: 75cr" to "No transponder" is surely an improvement?Thargoid wrote:I was thinking more that we could end up with less displayName, and more displayEssay.
When those names get too long, they don't look very good.
Re: [UPDATED RELEASE] - Police IFF Scanner Upgrade 1.2 (25/6
Then anyone who has bounty scanner installed will never see any effect from your OXP.Capt. Murphy wrote:Maybe only include entities whosedisplayName == name
My OXPs via Boxspace or from my Wiki pages .
Thargoid TV
Dropbox Referral Link
Thargoid TV
Dropbox Referral Link
Re: [UPDATED RELEASE] - Police IFF Scanner Upgrade 1.2 (25/6
Are you trying to annoy me, or just succeeding?Wildeblood wrote:Well then, changing "Vortex - Keeper of Darkness: Bounty: 75cr" to "No transponder" is surely an improvement?
My OXPs via Boxspace or from my Wiki pages .
Thargoid TV
Dropbox Referral Link
Thargoid TV
Dropbox Referral Link
- Capt. Murphy
- Commodore
- Posts: 1127
- Joined: Fri Feb 25, 2011 8:46 am
- Location: UK South Coast.
Re: [UPDATED RELEASE] - Police IFF Scanner Upgrade 1.2 (25/6
Wouldn't Bounty Scanner just append the Bounty to the "No Transponder" name? Looking quickly at the code it appears to grab displayName, temporarily change it whilst targeted to displayName + the bounty and then changes it back to the originial displayName?Thargoid wrote:Then anyone who has bounty scanner installed will never see any effect from your OXP.Capt. Murphy wrote:Maybe only include entities whosedisplayName == name
Academic anyway, I don't intend to code it into anything I'm planning on releasing - upto Wildeblood if he wants to have a shot at it.
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
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
- 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:
Re: [UPDATED RELEASE] - Police IFF Scanner Upgrade 1.2 (25/6
I have an in-Ooniverse question about this idea: Why would a fugitive lose its transponder in the first place? And how would he automagically regain it when becoming offender again? I don't see this happening, so the idea makes only a limited amount of sense to me.
Just my 0.2 cr.
Just my 0.2 cr.
- Wildeblood
- ---- E L I T E ----
- Posts: 2453
- Joined: Sat Jun 11, 2011 6:07 am
- Location: Western Australia
- Contact:
Re: [UPDATED RELEASE] - Police IFF Scanner Upgrade 1.2 (25/6
Well that's the point, isn't it: it's an idea. Someone has an idea, they say "Here's an idea, what do you think?" Grown-ups can discuss ideas, decide whether they're good ideas, whether they're worth following up or not. It seems to me that around the "Friendliest board this side of Riedquat" only certain people are allowed to have ideas.Commander McLane wrote:I have an in-Ooniverse question about this idea: Why would a fugitive lose its transponder in the first place? And how would he automagically regain it when becoming offender again? I don't see this happening, so the idea makes only a limited amount of sense to me.
Just my 0.2 cr.