Page 86 of 160

Re: Griff's normalmapped ship remakes

Posted: Sun Jun 19, 2011 1:11 pm
by DaddyHoggy
The convenience of all all-in-one is the inconvenience of big download. Given that Griff also offers all the ships as individual downloads I'd say that he's been more than accommodating.

Please leave it alone Griff!

(Although, I'm sure those with thinner pipes and less machines would appreciate smaller textures - providing it doesn't spoil this beautiful OXP)

Re: Griff's normalmapped ship remakes

Posted: Sun Jun 19, 2011 10:51 pm
by DGill
Possibly still need to add AIs folder to the individual download of griff_alloys_and_wreckage

Re: Griff's normalmapped ship remakes

Posted: Fri Jun 24, 2011 10:46 am
by DGill
Hmmm - still seem to be getting an error or two:

11:29:00.803 [script.javaScript.exception.ooliteDefinedError]: ***** JavaScript exception (griff_spawn_sparks 1.0): Error: Vector3D.distanceTo: Could not construct vector from parameters (undefined) -- expected Vector, Entity or array of three numbers.
11:29:00.803 [script.javaScript.exception.ooliteDefinedError]: ../AddOns/griff_alloys_and_wreckage.oxp/Scripts/griff_spawn_sparks.js, line 9.
11:29:06.279 [script.load.world.listAll]: Loaded 29 world scripts:

Re: Griff's normalmapped ship remakes

Posted: Sat Jun 25, 2011 9:54 am
by Griff
Thanks for spotting the mix up with the missing AIs DGill, i've copied them into the alloys and wreckage oxp (they're still also in the current all in 1 bundle too i'll remove them next time i've got something bigger to update that oxp with)

hmm, not sure about the script error, here's the offending script in case there're any passing script wizards :D

Code: Select all

this.name = "griff_spawn_wreckage"; 
this.author = "Thargoid"; 
this.copyright = "© 2008 the Oolite team."; 
this.description = "Spawn wreckage and sparks from dead ship"; 
this.version = "1.0"; 

this.shipDied = function() // event that occurs when the entity (ship) whose script this is dies
	{

	if(!player.ship || !this.ship || this.ship.position.distanceTo(player.ship.position) > 50000) return; // exit the script if the explosion happens far from the player

 		this.largeCount = (Math.ceil(Math.random() * 3)); // between 0-3 pieces of wreckage
		this.tinyCount =  (Math.ceil(Math.random() * 10) + 5); // between 5-10 tiny spark fragments
		this.sparkCount =  (Math.ceil(Math.random() * 20) + 10); // between 10-20 spin spark fragments
		this.ship.spawn("griffspark", this.tinyCount); // spawn the tiny spark fragments

	if(this.largeCount > 0) // if there is large wreckage
		{
		this.ship.spawn("griffwreckage", this.largeCount); // spawn the larger wreckage
		this.ship.spawn("spinspark", this.sparkCount); // spawn the spin sparks
		}

	}

Re: Griff's normalmapped ship remakes

Posted: Sat Jun 25, 2011 10:50 am
by Svengali
I'm using the following and don't get any errors. This is with your All-In-One1.2 and griff_alloys_and_wreckage.
I've changed the random number stuff to get the results as in the comments .-)

Code: Select all

this.name = "griff_spawn_wreckage";
this.author = "Thargoid";
this.copyright = "(C)2008-2011";
this.description = "Spawn wreckage and sparks from dead ship";
this.version = "1.2";

this.shipDied = function()
{
	if(!player.ship.isValid || this.ship.position.distanceTo(player.ship.position) > 50000) return;
	let largeCount = Math.floor(Math.random() * 4); // 0-3
	let tinyCount =  Math.floor(Math.random() * 6) + 5; // 5-10
	let sparkCount =  Math.floor(Math.random() * 11) + 10; // 10-20
	this.ship.spawn("griffspark", tinyCount);
	if(largeCount){
		this.ship.spawn("griffwreckage", largeCount);
		this.ship.spawn("spinspark", sparkCount);
	}
}

Re: Griff's normalmapped ship remakes

Posted: Sat Jun 25, 2011 11:13 am
by Thargoid
It looks like the if statement needs tweaking. Because they are logical AND rather than logical AND (|| is OR, && would be AND) the whole statement is getting checked. Hence if the player ship has ceased to exist, then player.ship.position will be undefined (which is what is happening if you look at the error in the log) but the expression will still be evaluated.

Either use Svengali's suggestion above, or split the if into two separate ones:

Code: Select all

if(!player.ship || !this.ship || this.ship.position.distanceTo(player.ship.position) > 50000) return; // exit the script if the explosion happens far from the player
into

Code: Select all

if(!player.ship.isValid || !this.ship.isValid) return; 
if(this.ship.position.distanceTo(player.ship.position) > 50000) return;
// exit the script if the explosion happens far from the player
That way the second if statement will not be reached if the player ship is non-existent (the function will bail out due to the first if statement being true and the return command getting executed), and so the error cannot happen. The other way would be to re-jig the statement a bit:

Code: Select all

if(!this.ship || (player.ship.isValid && this.ship.position.distanceTo(player.ship.position) > 50000)) return; // exit the script if the explosion happens far from the player
It amounts to the same kind of thing in the end.[/color]

Re: Griff's normalmapped ship remakes

Posted: Sat Jun 25, 2011 5:23 pm
by Griff
Thanks for the script fix T! :D I've added in the 2nd example (where it's all on one line) and re-uploaded the oxp

Re: Griff's normalmapped ship remakes

Posted: Fri Jul 01, 2011 7:20 pm
by tachyon
Hello all. This is my first post here.

At first a big thank for your work, Griff. The ships are looking great.

Although I have a little problem which only seems to apply on the ship you start the game with:
It still looks "ugly". It uses the standard textures and not the new ones. I can buy a new Cobra Mk.III from the vendor which then uses the Griff textures. But the start Cobra Mk.III does not use them. Any ideas what may cause this.

PS: Maybe this issue has already been discussed here, but I don't know what to search for and reading 86 pages is somewhat cumbersome.

Re: Griff's normalmapped ship remakes

Posted: Fri Jul 01, 2011 7:51 pm
by Cody
Hi tachyon and welcome... this post should help you.

Re: Griff's normalmapped ship remakes

Posted: Fri Jul 01, 2011 8:50 pm
by Mauiby de Fug
Don't worry, it's a fairly common problem. Would it make sense for the solution to be added to the 1st post of this thread, on the assumption that newbies are more likely to check there first than trawl through 86 pages trying to find it?

Re: Griff's normalmapped ship remakes

Posted: Fri Jul 01, 2011 9:25 pm
by Griff
that's a good idea, i'll edit my post on page one and add in a link to Capt. Murphy's guide

Re: Griff's normalmapped ship remakes

Posted: Fri Jul 01, 2011 9:35 pm
by tachyon
Thanks, that worked for me. I too think, that ir would be a good idea to add the hint on the first page.

Re: Griff's normalmapped ship remakes

Posted: Sat Jul 02, 2011 7:47 am
by Capt. Murphy
@ Griff - perhaps you could add it as a little add-on OXP for download (Default_Jameson_Ship_is_Griff_Cobra.OXP) on the assumption the not many newbies will be comfortable to immediately start making there own OXP.

Re: Griff's normalmapped ship remakes

Posted: Sat Jul 02, 2011 5:11 pm
by Eldon
As an add on OXP it would probably be best as a shipdata-overrides.plist. On my system I've also got deepspace ships loaded so the stations and ships which haven't been replaced by Griff versions don't look so incredibly plain, but that means that if I just use a shipdata.plist the deepspace version gets used instead of the Griff version.

Re: Griff's normalmapped ship remakes

Posted: Sun Jul 03, 2011 4:03 am
by Capt. Murphy
Thanks Eldon - spot on - I was in my first week of Oolite when I worked out the original trick and had to append the add-on OXP with a Z at the beginning to stop the Neolite version Cobra displaying. Load order is alphabetical in Windows, but not other OS's necessarily.... Just changed it to a shipdata-override.plist and it works irrespective of load order.