SpawnCustomAsteroidField

From Interstellar Rift Wiki
Jump to: navigation, search

Example Usage

SpawnCustomAsteroidField "[system ID/name]" "[ship ID/name]" [duration in ticks (20 ticks per second)] "[JSON describing what should be in the field]"

Where duration is how long the field will stay active. (with a negative value resulting in an infinite lifetime)

The JSON is a comma separated list of possible asteroids that can be spawned where an asteroid entry is as follows:

{
  "chance":[relative chance to spawn asteroid]
  "minMaxResources": {
    [resource ID]: {
      "minAmount": [minimum amount of resource in asteroid]
      "maxAmount": [maximum amount of resource in asteroid]
    },
    [repeat above as wanted]
  },
  "minMaxRareResources": {
    [rare resource ID]: {
      "minAmount": [minimum amount of rare resource in asteroid]
      "maxAmount": [maximum amount of rare resource in asteroid]
    },
    [repeat above as wanted]
  }
}

This JSON is formatted for better readability, but when entering it in a command there cannot be any newlines / enters / returns in the JSON.

The asteroid spawn chance is relative, so if there are two asteroid entries both with a chance of 100, the chance of either asteroid to spawn is 50%.

The resource IDs that can be used are as follows: RT_IronOre, RT_CopperOre, RT_Water, RT_SiliconOre, RT_ZincOre, RT_Nitrogen, and RT_Carbon.

And the rare resource IDs that can be used are as follows: RT_TungstenOre, RT_Gold, RT_Osmium, RT_Iridium, RT_Silver, RT_Mercury, RT_Platinum, RT_Fluorite, RT_Beryllium, RT_LeadOre, RT_UraniumOre, RT_AluminiumOre, RT_Quartz, RT_LithiumOre, RT_Manganese, and RT_Titanium.

Below is an example JSON for an asteroid field with an asteroid with between 100 and 900 iron ore and between 100 and 200 gold that has a 25% chance of spawning and another asteroid with between 100 and 900 iron ore, between 100 and 200 copper ore and between 100 and 200 gold that has a 75% chance of spawning

{  
  "chance":25.0,
  "minMaxResources":{  
    "RT_IronOre":{  
      "minAmount":100,
      "maxAmount":900
    }
  },
  "minMaxRareResources":
  {  
    "RT_Gold":{  
      "minAmount":100,
      "maxAmount":200
    }
  }
},
{  
  "chance":75.0,
  "minMaxResources":{  
    "RT_IronOre":{  
      "minAmount":100,
      "maxAmount":900
    },
    "RT_CopperOre":{  
      "minAmount":100,
      "maxAmount":200
    }
  },
  "minMaxRareResources":
  {  
    "RT_Gold":{  
      "minAmount":100,
      "maxAmount":200
    }
  }
}