Griff's normalmapped ship remakes
Moderators: winston, another_commander
- DaddyHoggy
- Intergalactic Spam Assassin
- Posts: 8515
- Joined: Tue Dec 05, 2006 9:43 pm
- Location: Newbury, UK
- Contact:
Re: Griff's normalmapped ship remakes
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)
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)
Oolite Life is now revealed hereSelezen wrote:Apparently I was having a DaddyHoggy moment.
Re: Griff's normalmapped ship remakes
Possibly still need to add AIs folder to the individual download of griff_alloys_and_wreckage
Re: Griff's normalmapped ship remakes
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:
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:
- Griff
- Oolite 2 Art Director
- Posts: 2483
- Joined: Fri Jul 14, 2006 12:29 pm
- Location: Probably hugging his Air Fryer
Re: Griff's normalmapped ship remakes
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
hmm, not sure about the script error, here's the offending script in case there're any passing script wizards
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
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 .-)
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
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:
into
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:
It amounts to the same kind of thing in the end.[/color]
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
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
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
My OXPs via Boxspace or from my Wiki pages .
Thargoid TV
Dropbox Referral Link
Thargoid TV
Dropbox Referral Link
- Griff
- Oolite 2 Art Director
- Posts: 2483
- Joined: Fri Jul 14, 2006 12:29 pm
- Location: Probably hugging his Air Fryer
Re: Griff's normalmapped ship remakes
Thanks for the script fix T! I've added in the 2nd example (where it's all on one line) and re-uploaded the oxp
Wiki homepage for my OXP: http://wiki.alioth.net/index.php/Griff_Industries
Re: Griff's normalmapped ship remakes
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.
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.
- Cody
- Sharp Shooter Spam Assassin
- Posts: 16081
- Joined: Sat Jul 04, 2009 9:31 pm
- Location: The Lizard's Claw
- Contact:
Re: Griff's normalmapped ship remakes
Hi tachyon and welcome... this post should help you.
I would advise stilts for the quagmires, and camels for the snowy hills
And any survivors, their debts I will certainly pay. There's always a way!
And any survivors, their debts I will certainly pay. There's always a way!
- Mauiby de Fug
- ---- E L I T E ----
- Posts: 847
- Joined: Tue Sep 07, 2010 2:23 pm
Re: Griff's normalmapped ship remakes
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?
- Griff
- Oolite 2 Art Director
- Posts: 2483
- Joined: Fri Jul 14, 2006 12:29 pm
- Location: Probably hugging his Air Fryer
Re: Griff's normalmapped ship remakes
that's a good idea, i'll edit my post on page one and add in a link to Capt. Murphy's guide
Wiki homepage for my OXP: http://wiki.alioth.net/index.php/Griff_Industries
Re: Griff's normalmapped ship remakes
Thanks, that worked for me. I too think, that ir would be a good idea to add the hint on the first page.
- Capt. Murphy
- Commodore
- Posts: 1127
- Joined: Fri Feb 25, 2011 8:46 am
- Location: UK South Coast.
Re: Griff's normalmapped ship remakes
@ 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.
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: Griff's normalmapped ship remakes
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.
- Capt. Murphy
- Commodore
- Posts: 1127
- Joined: Fri Feb 25, 2011 8:46 am
- Location: UK South Coast.
Re: Griff's normalmapped ship remakes
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.
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