Jump to content

Give modders open access to the asteroid spawning system


Recommended Posts

I'd like to be able to use the asteroid spawning system in KSP to spawn things other than asteroids

For example, I managed to spawn a Borg Cube in place of an asteroid that has fully controllable engines and can be steered ... This provides an avenue for modders to spawn models they have made of space stations, space ships or whatever they want to model directly into the game

The system is in place already, just a few tweaks and it would be a game changer ....

E0v8V67.png

Link to comment
Share on other sites

You should already be able to do this within the code, there is no need for the asteroid system to be modified.

Unless you want asteroid orbits? In that case hook into the asteroid spawning event in GameEvents (it's been awhile since I've seen it...) and change the asteroid vessel to something else. Or delete the asteroid and hijack its orbital parameters when you spawn something new in.

Edited by regex
Link to comment
Share on other sites

41 minutes ago, regex said:

You should already be able to do this within the code, there is no need for the asteroid system to be modified.

Unless you want asteroid orbits? In that case hook into the asteroid spawning event in GameEvents (it's been awhile since I've seen it...) and change the asteroid vessel to something else. Or delete the asteroid and hijack its orbital parameters when you spawn something new in.

Yes, totally works but you can only have 1 potatoroid part and the spawning system is random as well as set up to spawn 3 or more asteroids at a time

Suppose that one model isn't enough ... say someone wanted to put a few different models up in place of the asteroids

Link to comment
Share on other sites

Just now, DoctorDavinci said:

Yes, totally works but you can only have 1 potatoroid part and the spawning system is random as well as set up to spawn 3 or more asteroids at a time

Suppose that one model isn't enough ... say someone wanted to put a few different models up in place of the asteroids

Then spawn multiple vessels with multiple parts, not sure what the problem is here. You can simply adjust orbits as needed. Is the problem that you can't spawn a craft where you want it? Don't mods like BDA already allow you to spawn craft from thin air?

Link to comment
Share on other sites

it's not for spaning crafts per se .... more for being able to have an asteroid or small moon with caverns and tunnels through it ... even full blown space stations with hangar bays and all

I replaced the potatoroid model with the borg cube and had all the functionality that was there when launching it from the vab and cheating it to orbit

Imagine putting a large animated model of babylon 5 equipped with hanger bays and other goodies to be spawned in orbit so as to make exploring asteroids more interesting

Edited by DoctorDavinci
Link to comment
Share on other sites

13 minutes ago, DoctorDavinci said:

it's not for spaning crafts per se .... more for being able to have an asteroid or small moon with caverns and tunnels through it ... even full blown space stations with hangar bays and all

I replaced the potatoroid model with the borg cube and had all the functionality that was there when launching it from the vab and cheating it to orbit

Imagine putting a large animated model of babylon 5 equipped with hanger bays and other goodies to be spawned in orbit so as to make exploring asteroids more interesting

You should be able to do that already, what I was saying. Just replace the asteroid vessel with your own vessel, right? it can have as many or as few parts as you want, although you might need to write some part modules to make it all animated and things. You can hook into the event to see when an asteroid spawns and go from there. Other mods already know how to spawn craft, that's basically what you're going to be doing only doing it when the asteroid spawn event fires.

E: If you want to do it AT WILL then hook into the asteroid spawn event and then manually spawn an asteroid. All the other steps are the same. You can even hijack the orbit and then delete the asteroid after spawning, then spawn your own craft, bypassing the asteroid tracking mechanic.

E2: Everything you need is already exposed in the game code.

Edited by regex
Link to comment
Share on other sites

  • 2 weeks later...
This thread is quite old. Please consider starting a new thread rather than reviving this one.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...