Page 2 of 2

Re: Questions on nebula and star textures

Posted: Thu Nov 12, 2015 8:00 am
by mh82
Whoa! I totally overlooked that one... Damn flu... :cry:
This seems to do exactly what I was looking for. I will play around with this a bit. I think the solution would be to run this while

Code: Select all

this.systemWillPopulate
is executed.

Thanks another_commander!!! :D :D :D

Re: Questions on nebula and star textures

Posted: Thu Nov 12, 2015 9:51 am
by Amah
another_commander wrote:
I did a test on Lave using

Code: Select all

system.info.sky_n_stars = 500;
(default for me is 50000) and it worked.
50000? *sigh* I linger at 6000. 50000 and I get 12fps with no ships or any other objects around.

Re: Questions on nebula and star textures

Posted: Thu Nov 12, 2015 4:58 pm
by pagroove
mh82 wrote:
@Wildeblood: Not exactly... Reading those values is not a problem. My question was more about setting things according to those readings especially for stars and nebulae. But I had a closer look a the scripting reference and there doesn't seem to be a possibility to do so. I think I'll have to do things by design. At least I'll try...

@pagroove: Sounds nice. I'll have a look at it. I'm using Logic Pro 9. That's because I still use some older plugins which don't offer 64bit support. At the moment I've put all audio related stuff on hold because I got an evil flu and my ears won't work right... I haven't tested my early versions against other OXPs. So I can't say if there will be conflicts. But I'm sure that there will be conflicts/multiple sounds/musics playing if they are used alongside each other. I use Scripts for all sounds that can't be set directly via customsounds.plist. So I think it won't be a good idea to do so. I will see if I can add a menu to switch those sounds on and off. By the way: my "cinematic ooniverse" will be a collection of OXPs and no gigantic bundle. So one can decide what he/she wants to add to the game. I'll have a look at BGS though...
Ok Sounds nice. Hope you get better soon.
More choice the better :D .

Re: Questions on nebula and star textures

Posted: Fri Nov 13, 2015 3:35 pm
by mh82
another_commander wrote:
mh82 wrote:
@Wildeblood:. But I had a closer look a the scripting reference and there doesn't seem to be a possibility to do so.
I am pretty sure you can set values via the system.info object and, according to the wiki, they are stored in the savefile. I did a test on Lave using

Code: Select all

system.info.sky_n_stars = 500;
(default for me is 50000) and it worked. The catch is, you need to jump out and back, as the game will have to regenerate the system in order for the changes to take effect.. In the same way, you can change many other sky properties apart from number of stars.
Tried this yesterday... ..but all I get is a log entry which tells me to exit/re-enter the system for the changes to take effect. :cry:
By the way: it seems like the color parameters of the planetlist.plist can't be altered by script. At least I got no error messages when I did my experiments BUT I didn't get different colors for stars and/or nebulae either...

Re: Questions on nebula and star textures

Posted: Sat Nov 14, 2015 6:23 am
by Wildeblood
mh82 wrote:
another_commander wrote:
mh82 wrote:
@Wildeblood:. But I had a closer look a the scripting reference and there doesn't seem to be a possibility to do so.
I am pretty sure you can set values via the system.info object and, according to the wiki, they are stored in the savefile. I did a test on Lave using

Code: Select all

system.info.sky_n_stars = 500;
(default for me is 50000) and it worked. The catch is, you need to jump out and back, as the game will have to regenerate the system in order for the changes to take effect.. In the same way, you can change many other sky properties apart from number of stars.
Tried this yesterday... ..but all I get is a log entry which tells me to exit/re-enter the system for the changes to take effect. :cry:
By the way: it seems like the color parameters of the planetlist.plist can't be altered by script. At least I got no error messages when I did my experiments BUT I didn't get different colors for stars and/or nebulae either...
It would probably help if you dropped the attitude, and read the replies to your queries.

Re: Questions on nebula and star textures

Posted: Sat Nov 14, 2015 9:06 am
by another_commander
I don't think there is an attitude here, maybe just a slight misunderstanding.

@mh82: If you try to apply system changes on the systemWillPopulate handler, it is already too late: The system data has been generated before the populator kicks in. What you probably want to do is check which system the player is jumping to, then act on that; you need a suitable event handler though. Something that fires before any target system information has been created. Such a handler is shipWillEnterWitchspace, which fires just before actually executing the hyperspace jump.

The (very simple) example script below will set the number of stars to 500 if the player jumps to Diso and to 200000 if the player jumps to Leesti (note: it assumes the player to be at the starting galaxy). Hope it helps.

Code: Select all

this.shipWillEnterWitchspace = function()
{
	var targetSysID = player.ship.targetSystem;
	var targetSysInfo = System.infoForSystem(0, targetSysID);
	
	if (targetSysID == 147) // Diso
	{
		targetSysInfo.sky_n_stars = 500;
	}
	else if (targetSysID == 55) // Leesti
	{
		targetSysInfo.sky_n_stars = 200000;
	}
}

Re: Questions on nebula and star textures

Posted: Sat Nov 14, 2015 11:28 am
by mh82
Hello Wildeblood, hello another_commander,

it was probably a bit of both. I was very excited about the new approach to the problem but got the mechanisms of system generation and population wrong.
In other words: I tried to enter the room before opening the door... BAD IDEA!

@another_commander: again thanks for the pointer and especially for the example. I'll give this a shot and see what I end up with.

@Wildeblood: You are right about that attitude thing... I'll have to take a closer look on how things work internally in Oolite.

And at this point I have to state out that this is one of the most responsive and friendliest boards I've come across so far. Everyone here does a great job in helping other people with their ideas. All thumbs up!

Cheers!

Re: Questions on nebula and star textures

Posted: Sat Nov 14, 2015 11:41 am
by Cody
mh82 wrote:
And at this point I have to state out that this is one of the most responsive and friendliest boards I've come across so far.
<grins> You should see us on a good day!