[Release] Asteroid Respawn 1.0 (for 1.79 only)

Discussion and information relevant to creating special missions, new ships, skins etc.

Moderators: winston, another_commander

Post Reply
User avatar
spara
---- E L I T E ----
---- E L I T E ----
Posts: 2691
Joined: Wed Aug 15, 2012 4:19 am
Location: Finland

[Release] Asteroid Respawn 1.0 (for 1.79 only)

Post by spara »

A system can be emptied of asteroids because they are spawned only on load game and witchspace exit. If you're playing as a miner, then you might want that behaviour to be different. This oxz implements asteroid respawning into the game. It calculates the number of missing asteroids when you dock, finds an asteroid that is over 500 kms away from you and adds an asteroid field around that asteroid. The size of the new asteroid field is the number of asteroids destroyed before docking. In case no suitable asteroid is found, the missing asteroids will be spawned scattered around the player.

In short, for every asteroid destroyed a new asteroid is spawned on docking, keeping the number of asteroids in system constant. 500 km limit is quite a random one, I tried to choose a distance so far that you won't notice the new asteroid fields popping into existence. You'll rather have to find them.

Download from the expansion pack manager.
Last edited by spara on Thu Jun 19, 2014 6:24 pm, edited 3 times in total.
User avatar
CaptSolo
---- E L I T E ----
---- E L I T E ----
Posts: 909
Joined: Wed Feb 23, 2011 10:08 pm
Location: Preying Manta
Contact:

Re: [Wip] Asteroid Respawn 0.1

Post by CaptSolo »

Superb idea, Spara. Should make for some very happy miners.
User avatar
spara
---- E L I T E ----
---- E L I T E ----
Posts: 2691
Joined: Wed Aug 15, 2012 4:19 am
Location: Finland

Re: [Wip] Asteroid Respawn 0.2

Post by spara »

Thanks Solo :D .

Tweaked the script a bit and put out a new version (0.2). Now, in the unlikely case where every suitable asteroid to be used as a spawn position is destroyed before the player docks, the respawned asteroids are scattered around the player (500-750 km away) instead of adding them as a field.
User avatar
spara
---- E L I T E ----
---- E L I T E ----
Posts: 2691
Joined: Wed Aug 15, 2012 4:19 am
Location: Finland

Re: [Wip] Asteroid Respawn 0.3 (for 1.79 only)

Post by spara »

Such a small oxp and I just have to keep tweaking it. The first implementation was a bit of an overkill, using shipSpawned, but then again, it was just concept proofing. Version 0.3 has a much more sane method of simply calculating the number of asteroids in startUpComplete & shipExitedWitchspace and then after docking comparing the number of asteroids in system to that original number. If asteroids are lost, then they are compensated by spawning more asteroids.

The use of startUpComplete makes this a 1.79 only and as such I have packaged it as an oxz.
Post Reply