Register Calendar Latest Topics
 
 
 


Reply
  Author   Comment  
Richard

Registered:
Posts: 104
Reply with quote  #1 
Hi,

I love to add planets to my scripts, but due to a game limitation they appear from nothing when a player ship gets closer to 7km.

Well, I've made a little script to deal with that:
When Artemis reaches 7000m the planet grows from artscale 0.01 to 3.

I realized that generic meshes can't have their artscale changed after they were created (and I suppose the same applies to the other properties),so what I did was destroy and recreate the same planet every time it grows. It flicks... But I can live with that.

I believe more experienced "artemiscripters" can write a more elegant solution that all of us can benefit from.


 
Attached Files
zip PLANET GROW TEST.zip (1.52 MB, 2 views)

Arrew

Avatar / Picture

Registered:
Posts: 2,721
Reply with quote  #2 
That is a REALLY clever idea!
Richard

Registered:
Posts: 104
Reply with quote  #3 
Thanks Arrew!

Would you mind make some tests yourself to find out if the flickering can be eliminated?
ryleyra

Registered:
Posts: 2,482
Reply with quote  #4 
I like that idea. Try creating the new mesh first, overlapping the old, then delete the old mesh. Then either rename the new mesh or just use the sequential names. Alternately, you can just leave the old object and create an "unnamed" mesh over it by naming it with spaces.

A solution to this problem that has been used in the past is to divide your planet into eight wedges. Then place each "wedge" in a circle around the planet's center. You will have to create a mesh that represents the wedge, but you can center it so that the planet surface is at the origin point, instead of the center of the complete sphere.

As an example, if you have a planet that is 7k in radius, with the origin at the center of the sphere, you will only see it appear when your ship hits the planet's surface. But with the origin at the surface, you will see it at 7k away. You will also see the planet when approaching within 7k of the other side, making it look like your view distance is 14k instead of 7k.

The TSN Sandbox uses this trick, so you should be able to download that mod and use their custom mesh. You may also be able to use similar meshes, such as the one used to create shield halves, with relatively smaller planets.
ryleyra

Registered:
Posts: 2,482
Reply with quote  #5 
I'll add that I have suggested in the past giving generic meshes a property that allows their draw distance to be specified, or increased infinitely. It would be nice to be able to create a "sun" that can be seen from anywhere in the sector, for instance.

I'll also note that Black Holes appear very suddenly because of their size. They actually appear at 7300, instead of 7500. I suspect this is a bug, as Thom may have been trying to increase the range to 7700, but fudged it the wrong way. He may have already fixed it, I noticed this back in 2014 and haven't tested it again.

I also note that I previously stated (here) that Nebula appear at 5000 units, but I suspect I was talking about 5000 units from the EDGE of the Nebula. So it makes sense that the range would be less than to the center of the Nebula. I would make a rough estimate that a Nebula is 3000 units in diameter or 1500 in radius, so the visual range to the center would be 6500. Still less than 7500, but the Nebula "fades in" instead of appearing suddenly, so that may account for it.
Previous Topic | Next Topic
Print
Reply

Quick Navigation:

Easily create a Forum Website with Website Toolbox.