Problems with asteroids

For test results, bug reports, announcements of new builds etc.

Moderators: winston, another_commander, Getafix

Post Reply
User avatar
Eric Walch
Slightly Grand Rear Admiral
Slightly Grand Rear Admiral
Posts: 5536
Joined: Sat Jun 16, 2007 3:48 pm
Location: Netherlands

Problems with asteroids

Post by Eric Walch »

This is not a bug report but adding ships by script with addShips works completely different as adding by the system populator as most people will know.

One of the things is the adding of asteroids. When you add them by script they are always empty. So the rocks around pirate cove will never fall into boulders because they are script generated.

The reason for this is that the number of boulders that are generated is defined by the key "likely_cargo" in shipdata. This key has a default value of zero. When the system populator adds them, they get a random content, but when added by script it stays 0.

I propose to set the default value on 2 or 3 boulders. This way also scripted rocks will generate some boulders. You still need a mining laser to always get boulders. These boulders are system generated and will have a random content of splinters.
User avatar
JensAyton
Grand Admiral Emeritus
Grand Admiral Emeritus
Posts: 6657
Joined: Sat Apr 02, 2005 2:43 pm
Location: Sweden
Contact:

Post by JensAyton »

Fixed. Instead of deciding the boulder count at system setup time, as 2 + random(0..4), it is now decided when the asteroid explodes, as 2 + random(0..likely_cargo). Any third-party asteroids not based on like_ship = "asteroid" will thus always have two boulders. The built-in asteroids now have a likely_cargo of 4. Since the decision is made when exploding, it should be the same for seeded and script-generated asteroids.

A new fuzzy boolean key, no_boulders, has been added to create asteroids with no boulders.

(The chance of boulders being generated at all remains 20%, unless mining lasers are involved.)
User avatar
Eric Walch
Slightly Grand Rear Admiral
Slightly Grand Rear Admiral
Posts: 5536
Joined: Sat Jun 16, 2007 3:48 pm
Location: Netherlands

Post by Eric Walch »

Ahruman wrote:
Fixed. Instead of deciding the boulder count at system setup time, as 2 + random(0..4), it is now decided when the asteroid explodes, as 2 + random(0..likely_cargo)......
That's great, even better than I asked for. Now system and script generated asteroids are the same.

I already invented two ways to bypass this bug so I can use filled asteroids in my mission in the current oolite version. For the mission it is essential to have asteroids with role "asteroid" otherwise the whole scanning of miners will find nothing.

Adding a custom asteroid and than start with a "setPrimaryRole: asteroid" will work in version 1.70 (and with a not official function it was working in the current version)

I now do it on a very complicated way: I created an custom asteroid with role: "asteroid(10)", so my asteroid is very likely selected. But I added a condition key for the asteroid in the shipdata. This condition is always false, so it is never selected by the system or an other OXP. Just before adding I set the conditions to true, add asteroids and set the conditions to false again. And see, I have my filled custom asteroids with the right role so miners find them. (only two out twelve is now empty)
Post Reply