OXP idea: Escape capsule locator

An area for discussing new ideas and additions to Oolite.

Moderators: winston, another_commander

Dragonfire
---- E L I T E ----
---- E L I T E ----
Posts: 503
Joined: Sat Jun 11, 2011 7:46 pm

Re: OXP idea: Escape capsule locator

Post by Dragonfire »

The script that runs the file could look for a condition "is_clean" before running. If that condition is not met, the script doesn't run.
User avatar
Thargoid
Thargoid
Thargoid
Posts: 5528
Joined: Thu Jun 12, 2008 6:55 pm

Re: OXP idea: Escape capsule locator

Post by Thargoid »

I meant more in terms of in-game immersion and realism.

I know how to do it in the code (player.bounty can also be used in JS, or the requires_clean entry set true in equipment.plist).
User avatar
Kaks
Quite Grand Sub-Admiral
Quite Grand Sub-Admiral
Posts: 3009
Joined: Mon Jan 21, 2008 11:41 pm
Location: The Big Smoke

Re: OXP idea: Escape capsule locator

Post by Kaks »

In terms of realism, you could have the police scan you when you dock, and depending on your status and / or government type, give you fines/increase your bounty/confiscate the equipment... :twisted:
Hey, free OXPs: farsun v1.05 & tty v0.5! :0)
User avatar
Capt. Murphy
Commodore
Commodore
Posts: 1127
Joined: Fri Feb 25, 2011 8:46 am
Location: UK South Coast.

Re: OXP idea: Escape capsule locator

Post by Capt. Murphy »

The equipment is now now only purchasable for clean pilots and I don't think it is beyond the bounds of realism for the software to be able to disable itself if the player loses the clean status, or renable itself if clean status is regained. Script wise it's done... timer checks legal status and if not clean will remove the equipment entirely and awards some dummy equipment instead so it can be re-awarded once bounty is back to 0 .:)

A question for mac and linux using devs/scripters out there...

On my windows machine ship.roles returns the array with the roles in alphabetical order, not the order they appear in shipdata.plist. My script is relying on this behaviour and it has crossed my mind that this could be OS specific behaviour. Can anyone confirm if this is behaviour common to all OS's?
[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
Eric Walch
Slightly Grand Rear Admiral
Slightly Grand Rear Admiral
Posts: 5536
Joined: Sat Jun 16, 2007 3:48 pm
Location: Netherlands

Re: OXP idea: Escape capsule locator

Post by Eric Walch »

Capt. Murphy wrote:
On my windows machine ship.roles returns the array with the roles in alphabetical order, not the order they appear in shipdata.plist. My script is relying on this behaviour and it has crossed my mind that this could be OS specific behaviour. Can anyone confirm if this is behaviour common to all OS's?
I am not familiar with this part of code but after a quick browse I found:

Code: Select all

- (NSArray *)sortedRoles
{
	return [[_rolesAndProbabilities allKeys] sortedArrayUsingSelector:@selector(caseInsensitiveCompare:)];
}
So I think the code is already explicitly working with a sorted array.
User avatar
Capt. Murphy
Commodore
Commodore
Posts: 1127
Joined: Fri Feb 25, 2011 8:46 am
Location: UK South Coast.

Re: OXP idea: Escape capsule locator

Post by Capt. Murphy »

Thanks Eric.

Version 1.0 is released - see https://bb.oolite.space/viewtopic.php?f=4&t=10590
[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
Eric Walch
Slightly Grand Rear Admiral
Slightly Grand Rear Admiral
Posts: 5536
Joined: Sat Jun 16, 2007 3:48 pm
Location: Netherlands

Re: OXP idea: Escape capsule locator

Post by Eric Walch »

Capt. Murphy wrote:
Version 1.0 is released
I had a quick look and wounder if it is not screwing up missions that release pods. e.g. the constrictor mission launches a pod with the original pilot in the pod. The pod has the default escape pod role. Also in ups I have several missions were escape capsules are released with the original pilots on board. When I read the code correctly, you remove those pods and replace it with new ones. But than all the original pilots are removed. I think the ionics mission will have similar problems.

And what about transports.oxp. The liners in it have ships with multiple escape capsules. The first contains a trader as pilot, the others all contain passengers. (Passengers have a 100% insurance).

I think you must rethink the replacing of the pods, just to get a beacon symbol on it.
User avatar
Kaks
Quite Grand Sub-Admiral
Quite Grand Sub-Admiral
Posts: 3009
Joined: Mon Jan 21, 2008 11:41 pm
Location: The Big Smoke

Re: OXP idea: Escape capsule locator

Post by Kaks »

Hmmm, if you have really high energy, really light & really small beacon drones, they shouldn't be able either to destroy or being destroyed by NPCs...

How would it work if you had a beacon standing still near the ejection site, and have it begin to move towards the actual escape capsule only when the player reaches scanner range?
Hey, free OXPs: farsun v1.05 & tty v0.5! :0)
User avatar
Gimi
---- E L I T E ----
---- E L I T E ----
Posts: 2073
Joined: Tue Aug 29, 2006 5:02 pm
Location: Norway

Re: OXP idea: Escape capsule locator

Post by Gimi »

Kaks wrote:
Hmmm, if you have really high energy, really light & really small beacon drones, they shouldn't be able either to destroy or being destroyed by NPCs...

How would it work if you had a beacon standing still near the ejection site, and have it begin to move towards the actual escape capsule only when the player reaches scanner range?
You are talking about an Oolite version of the distress beacon that is mandatory on most ships in RL:
Image
Sounds like a good idea, and the behaviour you describe also seems realistic.
"A brilliant game of blasting and trading... Truly a mega-game... The game of a lifetime."
(Gold Medal Award, Zzap!64 May 1985).
User avatar
Capt. Murphy
Commodore
Commodore
Posts: 1127
Joined: Fri Feb 25, 2011 8:46 am
Location: UK South Coast.

Re: OXP idea: Escape capsule locator

Post by Capt. Murphy »

Grrrr - me making assumptions again.

You are quite right Eric -UPS and the constrictor (and any other OXP that include a custom pilot in a regular pod) will be broken by this as it stands.

Shame- I was quite pleased with the scripting and the ship data shenanigans needed to make this one work and it's taken a little while to put together.

I'll withdraw the download and go back to my original idea which was as Kaks suggests a tiny, low mass dummy beacon scripted to follow the original type pod around. I just liked the elegance of being able to give the pods themselves the beacons.......

Now if only someone would slip a bit of code into trunk to make ship.beaconCode read/write this kind of thing would be a lot easier.... :wink:
[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
CommonSenseOTB
---- E L I T E ----
---- E L I T E ----
Posts: 1397
Joined: Wed May 04, 2011 10:42 am
Location: Saskatchewan, Canada

Re: OXP idea: Escape capsule locator

Post by CommonSenseOTB »

Capt. Murphy wrote:
Grrrr - me making assumptions again.

You are quite right Eric -UPS and the constrictor (and any other OXP that include a custom pilot in a regular pod) will be broken by this as it stands.

Shame- I was quite pleased with the scripting and the ship data shenanigans needed to make this one work and it's taken a little while to put together.

I'll withdraw the download and go back to my original idea which was as Kaks suggests a tiny, low mass dummy beacon scripted to follow the original type pod around. I just liked the elegance of being able to give the pods themselves the beacons.......

Now if only someone would slip a bit of code into trunk to make ship.beaconCode read/write this kind of thing would be a lot easier.... :wink:
Seconded.

Sorry for suggesting to make the ships have beacons as it appears to have caused a big headache. Cheers.
Take an idea from one person and twist or modify it in a different way as a return suggestion so another person can see a part of it that can apply to the oxp they are working on.


CommonSense 'Outside-the-Box' Design Studios Ltd.
WIKI+OXPs
User avatar
Kaks
Quite Grand Sub-Admiral
Quite Grand Sub-Admiral
Posts: 3009
Joined: Mon Jan 21, 2008 11:41 pm
Location: The Big Smoke

Re: OXP idea: Escape capsule locator

Post by Kaks »

Hmm, sounds like a scripting request for 1.77! It could potentially break the standard game behaviour, but it's always worth considering, I suppose... :)
Hey, free OXPs: farsun v1.05 & tty v0.5! :0)
User avatar
Capt. Murphy
Commodore
Commodore
Posts: 1127
Joined: Fri Feb 25, 2011 8:46 am
Location: UK South Coast.

Re: OXP idea: Escape capsule locator

Post by Capt. Murphy »

[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
Post Reply