Page 8 of 460

Posted: Mon May 19, 2008 1:00 pm
by Star Gazer
Absolutely! I'm sure Giles is really proud of you guys and the amount of work you've all put into keeping the game growing in stature. 8)

Posted: Mon May 19, 2008 6:57 pm
by CaptKev
Rusty Stingray
Image

Posted: Mon May 19, 2008 9:23 pm
by pagroove
@ CaptKev

How do I add my Lave texture to only Lave? Because now it's a temporarily replacement the System Redux Texture that happened to be layered over the planet Lave.

Please explain it in a sort of dummy guide 8)
I can also send the texture to you if you want.

I now have to add a cloud layer.

Posted: Mon May 19, 2008 9:33 pm
by CaptKev
pagroove wrote:
@ CaptKev

How do I add my Lave texture to only Lave. Because now it's a temporarily replacement the System Redux Texture that happened to be layered over the planet Lave.

Please explain it in a sort of dummy guide 8)
I can also send the texture to you if you want.
Add this code just before the call to system.mainPlanet.setTexture

Code: Select all

		if ((galaxyNumber * 256 + system.ID) == 7) {

			system.mainPlanet.setTexture('my_lave_texture.png');
			return;
		}

Posted: Tue May 20, 2008 4:05 pm
by Svengali
Image
This will come the next days... (maybe as player ship?)

@ CaptKev: Nice new shot :-)

Posted: Tue May 20, 2008 4:22 pm
by TGHC
It's a Lamborghini Mura!

Posted: Tue May 20, 2008 8:42 pm
by pagroove
@CaptKev.

Do I have to make a planetinfo.plist for this and then put these lines of code into it or is more needed?

@Svengali

It's a design beauty!

Posted: Tue May 20, 2008 9:11 pm
by CaptKev
@pagroove, edit script.js in the Config folder (use wordpad or something similar), the system.mainPlanet.setTexture call is near to the bottom.

@Svengali, that looks like one mean machine. 8)

Posted: Tue May 20, 2008 9:39 pm
by pagroove
I added an atmosphere to Lave :D

DomicaL is meant to be Domica (typing error)

Image

Posted: Tue May 20, 2008 10:03 pm
by pagroove
I can't get it to work. The texture name is Lave.png. I have 2 versions. One big sized and one for the 256*128 set. I added this code. Do I have to fill in: galaxynumber = 0 and then the planet number 20, 173??

I did this an then it still isn't working.

Code: Select all

this.homePlanet = function()
{
	if (oolite.compareVersion("1.71") != 1) {


if ((galaxyNumber * 256 + system.ID) == 7) {

         system.mainPlanet.setTexture('Lave.png');
         return;
      } 


system.mainPlanet.setTexture('home_planet' + (((system_info[galaxyNumber * 256 + system.ID] & 0xF000) >> 12) + 1) + '.png');
	} else {
		var radius = system.mainPlanet.radius / 2560;
		var type = (system_info[galaxyNumber * 256 + system.ID] & 0xF000) >> 12;
   
		system.addMoon(type + "planet" + (radius.toFixed(0) - 11));
:shock:

Posted: Tue May 20, 2008 10:15 pm
by Kaks
Hi Pagroove,

It looks like the code should work.

One problem could be the cache. Oolite preloads scripts and textures in order to run faster, and it could still load an old copy of the script. To clear the cache, keep 'shift' pressed as you start oolite.

And if that doesn't do the trick: is Lave.png in the same place as the other planet textures? Maybe oolite can't find it because it's somewhere else...

If the problem is the cached script, you'll see the 'normal' system redux texture on Lave, if it's oolite not being able to find Lave.png, Lave will be untextured...

Hope this helps! :)

Posted: Tue May 20, 2008 10:29 pm
by Svengali
You will need an else block. This code replaces the planets texture with your texture and then with the 'original' system_redux texture. So you won't see your work.

Code: Select all

if ((galaxyNumber * 256 + system.ID) == 7) {

         system.mainPlanet.setTexture('Lave.png');
         return;
      }
else {
           the rest of the code
}

Posted: Tue May 20, 2008 10:35 pm
by Kaks
@svengali: not really! :)

Code: Select all

if(something) {

...blah blah blah....

return;
}
edit: jargon alert!

if something it's true the function returns without executing any of the code after the if block, if it's false, the if block doesn't get executed, and all the remainder of the function is executed.... :)

in other words the else is entirely optional, and just adds the chance of making bracketing mistakes...

Posted: Tue May 20, 2008 10:36 pm
by pagroove
Hi Kaks,

Do you have to include the file extension .png after the name?
Because it still doesn't work.

The texture Lave.png is in the addons/Sytem-Redux.oxp/textures and in the addons/System-Redux.opx/textures 128*256 folder (resized to 129 * 256

I pressed shift when starting up
I jumped out and back into the system

Both things don't work
is the function case sensitive?

Shall I send the texture to you? Maybe you can include it for me?
Anyway thanx for the help.

Posted: Tue May 20, 2008 10:44 pm
by Svengali
Kaks wrote:
@svengali: not really! :)

if something it's true the function returns without executing any of the code after the if block, if it's false, the if block doesn't get executed, and all the remainder of the function is executed.... :)

in other words the else is entirely optional, and just adds the chance of making bracketing mistakes...
Ah. Thanks Kaks for an explanation. I didn't noticed the return, but now I understand some more of your scripts :-)

(One step more, hehe)