Page 19 of 22

Re: New ships under development

Posted: Sun Nov 18, 2012 11:39 am
by Smivs
Shipbuilder wrote:
Reading the Shipdata.plist information on the Wiki there is a accutacy ship key for NPC vessels. The available range is -5 to 10.

Does anyone know what value is used as the default if this key is not used ?
From the Wiki
In 1.76 or earlier, when used with NPC ships it slightly enlarges the chance of shooting at greater distances, and makes a small improvement to their aim. Value with NPC ships is between -5 and 10 though all values between -5 and +1 will be increased to +1. When not defined, NPCs will be assigned a random value in the range +1 to +10.
Emphasis added by me.

With regard to the death_actions, I believe this relies on the old legacy scripting methods so may be best avoided. Adding a ship script using a (this.shipDied event handler) is probably a better way to do this these days. Take a look at the cloak and constrictor scripts from the core game to get you started.

Re: New ships under development

Posted: Sun Nov 18, 2012 11:49 am
by cim
Accuracy:
In 1.76 a random value between +1 and +10 will be picked. You will barely notice the difference.

In trunk (and so in 1.77) a random value between -5 and +4.999 will be picked. Values in the +5 to +10 range gradually enable additional combat tactics and improve piloting skill. See[wiki]OXP_NPC_Combat_AI[/wiki] for more details. At +10 they're probably about as good as a Competent human pilot. (The entire -5 to +4.999 range basically covers the "Harmless" rank). If you want to see what this means in practice, download a nightly build of Oolite and my "Combat Arena" testing OXP.

Death actions:
As Smivs says, it's much better to use a ship script for this.

Re: New ships under development

Posted: Sun Nov 18, 2012 12:43 pm
by Shipbuilder
Thanks gents - It looks like the copy of the Shipdata.plist document that I printed some time ago is out of date as it had no mention of the random value selection.

I guess that I should check for updates more often :wink:

Regarding the death actions query I'll have a look at using a scripting method.

Re: New ships under development

Posted: Sun Nov 18, 2012 1:15 pm
by Smivs
Shipbuilder wrote:
Regarding the death actions query I'll have a look at using a scripting method.
This is dead easy - give me a shout if you need any help with it. :)

Re: New ships under development

Posted: Mon Nov 19, 2012 7:34 pm
by Shipbuilder
A quick teaser for one of the variety of textured GalTech Escort Fighters due to be released as an oxp soon. This one is the bounty hunter variant.

Image

Re: New ships under development

Posted: Mon Nov 19, 2012 7:37 pm
by Gimbal Locke
Shipbuilder wrote:
A quick teaser for one of a variety of textured GalTech Escort Fighters due to be released as an oxp soon. This one is the bounty hunter variant.
I love the "six pirates and a thargoid" detail. And I want one!

Edits: typos.

Re: New ships under development

Posted: Mon Nov 19, 2012 7:38 pm
by Tricky
Shipbuilder wrote:
A quick teaser for one of a variety of textured GalTech Escort Fighters due to be released as an oxp soon. This one is the bounty hunter variant.

Image
Inspired by HOTOL? Like the teeth.

Re: New ships under development

Posted: Mon Nov 19, 2012 7:44 pm
by Cody
Those teeth bring to mind this pic... and I'd still like a P-51 Mustang!

Re: New ships under development

Posted: Mon Nov 19, 2012 11:55 pm
by Shipbuilder
Thanks Gents - The ship itself kind of evolved from something entirely different (It actually started life as a shuttle).

I must admit though that the shark teeth were inspired by just the type of WW2 aircraft linked to in El Viejo's above post specifically a Hawker Typhoon.

Re: New ships under development

Posted: Wed Nov 21, 2012 9:07 pm
by Shipbuilder
cim wrote:
Death actions:
As Smivs says, it's much better to use a ship script for this.
Ok I have had a go at a basic script which sends a message from a NPC ship to the player ship upon its destruction which seems to work ok. At the moment it is, however, limited to a single message.

How do I define a list of messages from which Oolite will randomly select one message only and send to the player upon a NPC ship's destruction.

The code I have so far is: -

Code: Select all

this.shipDied = function()
{
	{
		this.ship.commsMessage("Hold fire I surrender");
	}	    
};

Re: New ships under development

Posted: Wed Nov 21, 2012 9:11 pm
by Cody
The Green Gecko has a lot of random shout-outs... you might find a clue in that.

Re: New ships under development

Posted: Wed Nov 21, 2012 9:29 pm
by Commander McLane
Shipbuilder wrote:
How do I define a list of messages from which Oolite will randomly select one message only and send to the player upon a NPC ship's destruction.
Put the messages in an array:

Code: Select all

this.shipSpawned = function()
{
	this.deathMessage = ["Hold fire I surrender", "Help!", "whatever you come up with", "and so on"];
}
And then let one of the messages be displayed randomly:

Code: Select all

this.shipDied = function()
{
	var choice = Math.floor(Math.random() * this.deathMessage.length);	    
	this.ship.commsMessage(this.deathMessage[choice]);
}
As an aside: you don't need double curly brackets.

Re: New ships under development

Posted: Wed Nov 21, 2012 10:07 pm
by Shipbuilder
@ El Viejo and Commander McLane - Thanks for the feedback. :wink:

I'll crack on with this tonight so should have it up an working shortly.

Re: New ships under development

Posted: Fri Nov 23, 2012 10:27 pm
by Shipbuilder
Can someone remind me if I want to define a player ship with forward and rear lasers only what number do I use in the weapon facings key in the shipyard.plist?

I know 1 if for forward lasers only and 15 is for all four lasers.

Re: New ships under development

Posted: Fri Nov 23, 2012 10:34 pm
by cim