System.planets Returns Odd Stuff

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

Moderators: winston, another_commander, Getafix

Post Reply
User avatar
Cmd. Cheyd
---- E L I T E ----
---- E L I T E ----
Posts: 934
Joined: Tue Dec 16, 2008 2:52 pm
Location: Deep Horizon Industries Manufacturing & Research Site somewhere in G8...

System.planets Returns Odd Stuff

Post by Cmd. Cheyd »

Below is a function I"ve made for System Redux 2.0. I'm just wanting to divvy up the planets in the system into two arrays: Moons and Planets (san Main Planet). Looking at it, I'm not seeing anywhere that it can go wonky, but if you look at the log underneath, you can see what I'm getting in the logs when I walk through the resulting arrays later in the code...

Where are these rogue entries come from?

Code: Select all

this.buildAdditionArrays = function()
{
	// See if we can exit early.  No need to be in this if there's nothing to do.
	if(system.planets.length == 1) return;
	
	// Loop through all the planets and moons to divide them accordingly
	for(var i = 0;i < System.planets.length;i++) {
		//Presume it's a moon if it has no atmosphere
		if(!system.planets[i].hasAtmosphere) {
			// Add the body to the Moons array
			addedMoons.push(system.planets[i]);
		}
		else {
			// Main planet textures are handled by another function
			if(!system.planets[i].isMainPlanet) {
				// Add the body to the Planets array
				addedPlanets.push(system.planets[i]);
			}
		}
	}
}

// THIS SECTION IS EXERTED FROM THE PLANET TEXTURING FUNCTION
	for(var i = 0;i < addedPlanets.length;i++) {
		addedPlanets[i].setTexture ('add_planet' + planetTextures[i] + '.png');
		if(debug == true) {
			log("System Redux 2.0","Planet: " + addedPlanets[i] + "    Texture: " + planetTextures[i]);
		}
	}

Code: Select all

[System Redux 2.0]: Planet: [object Planet]    Texture: 6
[System Redux 2.0]: Planet: [object Planet]    Texture: 20
[System Redux 2.0]: Planet: [object Planet]    Texture: 12
[System Redux 2.0]: Planet: [object Planet]    Texture: 1
[System Redux 2.0]: Planet: [object Planet]    Texture: 7
[System Redux 2.0]: Planet: [object Planet]    Texture: 16
[System Redux 2.0]: Planet: [Planet ID: 0 position: (-2.82925e+006, -1.55536e+006, 1.63934e+006) type: PLANET_TYPE_GREEN radius: 150.000km]    Texture: 15
[System Redux 2.0]: Planet: [Planet ID: 0 position: (-2.82925e+006, -1.55536e+006, 1.63934e+006) type: PLANET_TYPE_GREEN radius: 150.000km]    Texture: 5
[System Redux 2.0]: Planet: [object Planet]    Texture: 11
[System Redux 2.0]: Planet: [object Planet]    Texture: 8
[System Redux 2.0]: Planet: [object Planet]    Texture: 17
[System Redux 2.0]: Planet: [Planet ID: 0 position: (-3.10526e+006, -1.10679e+006, 699721) type: PLANET_TYPE_GREEN radius: 110.000km]    Texture: 2
[System Redux 2.0]: Planet: [Planet ID: 0 position: (-2.39529e+006, 3.23227e+006, 589465) type: PLANET_TYPE_GREEN radius: 160.000km]    Texture: 9
[System Redux 2.0]: Planet: [Planet ID: 299 position: (1.00641e+006, 3.90594e+006, 834751) type: PLANET_TYPE_GREEN radius: 160.000km]    Texture: 14
User avatar
Kaks
Quite Grand Sub-Admiral
Quite Grand Sub-Admiral
Posts: 3009
Joined: Mon Jan 21, 2008 11:41 pm
Location: The Big Smoke

Post by Kaks »

Best thing to do is if you could also provide a full system dump: p for pause when in flight, then press '0'

That way we get a better chance of seeing what's going on... btw, do you have a similar log entry for the moons?
Hey, free OXPs: farsun v1.05 & tty v0.5! :0)
User avatar
Cmd. Cheyd
---- E L I T E ----
---- E L I T E ----
Posts: 934
Joined: Tue Dec 16, 2008 2:52 pm
Location: Deep Horizon Industries Manufacturing & Research Site somewhere in G8...

Post by Cmd. Cheyd »

Yes, I do get them. Do I need Debug.OXP for that Kaks?

Edit-- Nevermind. Got it...
Doesn't happen on every system, and usually not for the first system or two. But neither will it happen for sure at every system past 2... Understand?

Anyways, here's a log from the 3rd system I jumped into on my usual test run. I've left some of my own debug code in place. If you need to know any of the backend for my stuff, let me know. I can send you a copy if need be.

Code: Select all

[System Redux 2.0]: AddPlanets function requesting array.
[System Redux 2.0]: Array requested.  intSeed = 197    intLower = 1    int Upper = 11    intSize = 2.
[System Redux 2.0]: Planet added at position: 3.
[System Redux 2.0]: Planet added at position: 4.
[System Redux 2.0]: AddMoons function requesting array.
[System Redux 2.0]: Array requested.  intSeed = 41834472145125.69    intLower = 1    int Upper = 11    intSize = 1.
[System Redux 2.0]: Moon added at position: 4.
[System Redux 2.0]: Main Planet Texture: 32
[System Redux 2.0]: TexturePlanets function requesting array.
[System Redux 2.0]: Array requested.  intSeed = 333.7439010270683    intLower = 1    int Upper = 21    intSize = 6.
[System Redux 2.0]: Planet: [object Planet]    Texture: 11
[System Redux 2.0]: Planet: [object Planet]    Texture: 18
[System Redux 2.0]: Planet: [Planet ID: 0 position: (-3.30029e+006, 2.31163e+006, 1.01326e+006) type: PLANET_TYPE_GREEN radius: 160.000km]    Texture: 1
[System Redux 2.0]: Planet: [Planet ID: 0 position: (-1.64031e+006, -2.80167e+006, 1.67699e+006) type: PLANET_TYPE_GREEN radius: 150.000km]    Texture: 2
[System Redux 2.0]: Planet: [Planet ID: 484 position: (3.98357e+006, 2.11862e+006, -1.42978e+006) type: PLANET_TYPE_GREEN radius: 180.000km]    Texture: 5
[System Redux 2.0]: Planet: [Planet ID: 485 position: (-2.2551e+006, -2.32763e+006, 1.1801e+006) type: PLANET_TYPE_GREEN radius: 150.000km]    Texture: 10
[System Redux 2.0]: TextureMoons function requesting array.
[System Redux 2.0]: Array requested.  intSeed = 234602040043818.5    intLower = 1    int Upper = 11    intSize = 5.
[System Redux 2.0]: Moon: [object Planet]    Texture: 8
[System Redux 2.0]: Moon: [object Planet]    Texture: 7
[System Redux 2.0]: Moon: [object Planet]    Texture: 4
[System Redux 2.0]: Moon: [object Planet]    Texture: 5
[System Redux 2.0]: Moon: [Moon ID: 486 position: (23093.2, 61856.9, 166833) type: PLANET_TYPE_MOON radius: 8.000km]    Texture: 3
[System Redux 2.0]: ColorizeSun function requesting array.
[System Redux 2.0]: Array requested.  intSeed = 205064945.40710583    intLower = 1    int Upper = 1001    intSize = 4.
[System Redux 2.0]: Sun Color assigned as 'cyanColor'
[System Redux 2.0]: Corona size set to: 0.577.
[System Redux 2.0]: Corona variation set to: 0.591.
[System Redux 2.0]: Corona shimmer rate set to: 0.662.
[Fuel Collector]: Number of globes is 4
[universe.objectDump]: DEBUG: Entity Dump - [entities count] = 90,	n_entities = 90
  [universe.objectDump]: -> Ent:0		<PlayerEntity 0x8033990>{"Griff Cobra Mark III (Test Flight)" ID: 100 position: (-9442.04, 16458.2, 10034.8) scanClass: CLASS_PLAYER status: STATUS_IN_FLIGHT} mass 215535.19 <AI 0x7ceb0b0>{"dockingAI.plist" in state: "GLOBAL" for Cobra Mark III 100}
  [universe.objectDump]: -> Ent:1		<DustEntity 0x848b1e8>{ID: 395 position: (0, 0, 0) scanClass: CLASS_NO_DRAW status: STATUS_ACTIVE} mass 0.00 (nil)
  [universe.objectDump]: -> Ent:2		<ShipEntity 0xa50b950>{"Griff Cobra Mark III Test" ID: 408 position: (-4124.24, 15196.9, 12265.2) scanClass: CLASS_NEUTRAL status: STATUS_IN_FLIGHT} mass 215535.19 <AI 0x7cea408>{"route1traderAI.plist" in state: "HEAD_FOR_PLANET" for Griff Cobra Mark III Test 408}
  [universe.objectDump]: -> Ent:3		<ShipEntity 0xc7580a0>{"Witchpoint Beacon" ID: 473 position: (-5400, 5200, 12600) scanClass: CLASS_BUOY status: STATUS_IN_FLIGHT} mass 383595.94 <AI 0x7ce3538>{"buoyAI.plist" in state: "GLOBAL" for Witchpoint Beacon 473}
  [universe.objectDump]: -> Ent:4		<ShipEntity 0xdcaa918>{"GalCop Viper Interceptor" ID: 424 position: (-15823.3, -4770.96, 18528.5) scanClass: CLASS_POLICE status: STATUS_IN_FLIGHT} mass 43245.39 <AI 0x7ce32f8>{"escortAI.plist" in state: "FLYING_ESCORT" for GalCop Viper Interceptor 424}
  [universe.objectDump]: -> Ent:5		<ShipEntity 0xdca0700>{"GalCop Viper" ID: 426 position: (-15999.8, -4889.93, 18356.1) scanClass: CLASS_POLICE status: STATUS_IN_FLIGHT} mass 22723.75 <AI 0x7ce3b20>{"escortAI.plist" in state: "FLYING_ESCORT" for GalCop Viper 426}
  [universe.objectDump]: -> Ent:6		<ShipEntity 0xdcadf20>{"GalCop Viper" ID: 423 position: (-16196.1, -4741.87, 18594.6) scanClass: CLASS_POLICE status: STATUS_IN_FLIGHT} mass 22723.75 <AI 0x7ce31d8>{"route1patrolAI.plist" in state: "HEAD_FOR_WITCHPOINT" for GalCop Viper 423}
  [universe.objectDump]: -> Ent:7		<ShipEntity 0xdc99af0>{"GalCop Viper" ID: 428 position: (-15952.8, -4854.6, 18638) scanClass: CLASS_POLICE status: STATUS_IN_FLIGHT} mass 22723.75 <AI 0x7ce3e38>{"escortAI.plist" in state: "FLYING_ESCORT" for GalCop Viper 428}
  [universe.objectDump]: -> Ent:8		<ShipEntity 0xdc9d0f8>{"GalCop Viper" ID: 427 position: (-16637.4, -4778.93, 18298.5) scanClass: CLASS_POLICE status: STATUS_IN_FLIGHT} mass 22723.75 <AI 0x7ce3cd0>{"escortAI.plist" in state: "FLYING_ESCORT" for GalCop Viper 427}
  [universe.objectDump]: -> Ent:9		<ShipEntity 0xdc964e8>{"GalCop Viper" ID: 429 position: (-16548.7, -4722.08, 18647) scanClass: CLASS_POLICE status: STATUS_IN_FLIGHT} mass 22723.75 <AI 0x7ce4030>{"escortAI.plist" in state: "FLYING_ESCORT" for GalCop Viper 429}
  [universe.objectDump]: -> Ent:10		<ShipEntity 0xdca3d08>{"GalCop Viper" ID: 425 position: (-16672.7, -4832.88, 18448) scanClass: CLASS_POLICE status: STATUS_IN_FLIGHT} mass 22723.75 <AI 0x7ce3850>{"escortAI.plist" in state: "FLYING_ESCORT" for GalCop Viper 425}
  [universe.objectDump]: -> Ent:11		<ShipEntity 0xc7658c0>{"Fuel Station" ID: 492 position: (-18774, -13585.5, 7705.48) scanClass: CLASS_STATION status: STATUS_IN_FLIGHT} mass 143480496.00 <AI 0x7ce1d08>{"fuelStation_stationAI.plist" in state: "IDLE" for Fuel Station 492}
  [universe.objectDump]: -> Ent:12		<ShipEntity 0xe1a84d8>{"Sidewinder Scout Ship" ID: 401 position: (-15147.4, 10860.8, 66287.6) scanClass: CLASS_NEUTRAL status: STATUS_IN_FLIGHT} mass 25355.94 <AI 0x7ce97a8>{"escortAI.plist" in state: "FLYING_ESCORT" for Sidewinder Scout Ship 401}
  [universe.objectDump]: -> Ent:13		<ShipEntity 0xe190aa0>{"Sidewinder Scout Ship" ID: 402 position: (-15941.8, 10689.1, 66332.8) scanClass: CLASS_NEUTRAL status: STATUS_IN_FLIGHT} mass 25355.94 <AI 0x7ce8710>{"escortAI.plist" in state: "FLYING_ESCORT" for Sidewinder Scout Ship 402}
  [universe.objectDump]: -> Ent:14		<ShipEntity 0xa504d40>{"Mamba Escort" ID: 404 position: (-15870.1, 10799.6, 66581.3) scanClass: CLASS_NEUTRAL status: STATUS_IN_FLIGHT} mass 26781.66 <AI 0x7ce9fd0>{"escortAI.plist" in state: "FLYING_ESCORT" for Mamba Escort 404}
  [universe.objectDump]: -> Ent:15		<ShipEntity 0xa4fe130>{"Sidewinder Scout Ship" ID: 403 position: (-15154.4, 10786.5, 66695.4) scanClass: CLASS_NEUTRAL status: STATUS_IN_FLIGHT} mass 25355.94 <AI 0x7cea210>{"escortAI.plist" in state: "FLYING_ESCORT" for Sidewinder Scout Ship 403}
  [universe.objectDump]: -> Ent:16		<ShipEntity 0xe1a4ed0>{"Ionics Redback" ID: 400 position: (-15460.3, 10827.6, 66765.3) scanClass: CLASS_NEUTRAL status: STATUS_IN_FLIGHT} mass 80074.23 <AI 0x7cea060>{"route1traderAI.plist" in state: "HEAD_FOR_PLANET" for Ionics Redback 400}
  [universe.objectDump]: -> Ent:17		<ShipEntity 0xa530ba8>{"Moray Star Boat" ID: 416 position: (-4774.69, 42.7211, 84258.1) scanClass: CLASS_NEUTRAL status: STATUS_IN_FLIGHT} mass 40446.67 <AI 0x7ce2650>{"pirateAI.plist" in state: "TRAVEL_TO_LURK_AREA" for Moray Star Boat 416}
  [universe.objectDump]: -> Ent:18		<ShipEntity 0xa52d5a0>{"Ionics Whitetail" ID: 415 position: (-5649.92, 970.972, 85013) scanClass: CLASS_NEUTRAL status: STATUS_IN_FLIGHT} mass 17520.85 <AI 0x7ce2ec0>{"pirateAI.plist" in state: "TRAVEL_TO_LURK_AREA" for Ionics Whitetail 415}
  [universe.objectDump]: -> Ent:19		<ShipEntity 0xa501738>{"Python" ID: 406 position: (10372.7, 14881.8, 85768.9) scanClass: CLASS_NEUTRAL status: STATUS_IN_FLIGHT} mass 222284.38 <AI 0x7ce9d48>{"route1traderAI.plist" in state: "HEAD_FOR_PLANET" for Python 406}
  [universe.objectDump]: -> Ent:20		<ShipEntity 0xa512560>{"Cobra Mark III" ID: 407 position: (-3709.13, -10825.5, 129016) scanClass: CLASS_NEUTRAL status: STATUS_IN_FLIGHT} mass 185580.02 <AI 0x7cea378>{"route1traderAI.plist" in state: "HEAD_FOR_PLANET" for Cobra Mark III 407}
  [universe.objectDump]: -> Ent:21		<ShipEntity 0xa508348>{"Cobra Mark III" ID: 405 position: (-4024.44, 9579.61, 135863) scanClass: CLASS_NEUTRAL status: STATUS_IN_FLIGHT} mass 185580.02 <AI 0x7ce8dd0>{"route1traderAI.plist" in state: "HEAD_FOR_PLANET" for Cobra Mark III 405}
  [universe.objectDump]: -> Ent:22		<ShipEntity 0xdc92ee0>{"Asteroid" ID: 430 position: (13701.7, 4887.82, 133827) scanClass: CLASS_ROCK status: STATUS_IN_FLIGHT} mass 1319797.75 <AI 0x7ce41e0>{"dumbAI.plist" in state: "GLOBAL" for Asteroid 430}
  [universe.objectDump]: -> Ent:23		<ShipEntity 0xdc8c2d0>{"Asteroid" ID: 432 position: (-13760, -10405.9, 137993) scanClass: CLASS_ROCK status: STATUS_IN_FLIGHT} mass 1319797.75 <AI 0x7ce3e80>{"dumbAI.plist" in state: "GLOBAL" for Asteroid 432}
  [universe.objectDump]: -> Ent:24		<ShipEntity 0xa5377b8>{"Ionics Huntsman" ID: 417 position: (10956.6, -6962.12, 139595) scanClass: CLASS_NEUTRAL status: STATUS_IN_FLIGHT} mass 49541.67 <AI 0x7ce2ba8>{"pirateAI.plist" in state: "TRAVEL_TO_LURK_AREA" for Ionics Huntsman 417}
  [universe.objectDump]: -> Ent:25		<ShipEntity 0xa526990>{"Cobra Mark I" ID: 413 position: (778.932, -10196.1, 150784) scanClass: CLASS_NEUTRAL status: STATUS_IN_FLIGHT} mass 47240.14 <AI 0x7ce2da0>{"pirateAI.plist" in state: "TRAVEL_TO_LURK_AREA" for Cobra Mark I 413}
  [universe.objectDump]: -> Ent:26		<ShipEntity 0xdc8f8d8>{"Asteroid" ID: 431 position: (1748.95, 7139.77, 152918) scanClass: CLASS_ROCK status: STATUS_IN_FLIGHT} mass 1319797.75 <AI 0x7ce3fa0>{"dumbAI.plist" in state: "GLOBAL" for Asteroid 431}
  [universe.objectDump]: -> Ent:27		<ShipEntity 0xc7622b8>{"Fuel Station" ID: 491 position: (-2141.19, -22887.4, 149009) scanClass: CLASS_STATION status: STATUS_IN_FLIGHT} mass 143480496.00 <AI 0x7ce15b8>{"fuelStation_stationAI.plist" in state: "IDLE" for Fuel Station 491}
  [universe.objectDump]: -> Ent:28		<ShipEntity 0xa523388>{"Cobra Mark I" ID: 412 position: (4086.26, -11575.3, 158286) scanClass: CLASS_NEUTRAL status: STATUS_IN_FLIGHT} mass 47240.14 <AI 0x7ce2770>{"pirateAI.plist" in state: "TRAVEL_TO_LURK_AREA" for Cobra Mark I 412}
  [universe.objectDump]: -> Ent:29		<ShipEntity 0xa519170>{"Python" ID: 409 position: (5110.84, -12885.5, 158630) scanClass: CLASS_NEUTRAL status: STATUS_IN_FLIGHT} mass 222284.38 <AI 0x7ce97f0>{"pirateAI.plist" in state: "TRAVEL_TO_LURK_AREA" for Python 409}
  [universe.objectDump]: -> Ent:30		<ShipEntity 0xa51c778>{"Ionics Huntsman" ID: 410 position: (3460.01, -12575.1, 159865) scanClass: CLASS_NEUTRAL status: STATUS_IN_FLIGHT} mass 49541.67 <AI 0x7ce8830>{"pirateAI.plist" in state: "TRAVEL_TO_LURK_AREA" for Ionics Huntsman 410}
  [universe.objectDump]: -> Ent:31		<ShipEntity 0xa51fd80>{"Ionics Whitetail" ID: 411 position: (5005.8, -13313.9, 159585) scanClass: CLASS_NEUTRAL status: STATUS_IN_FLIGHT} mass 17520.85 <AI 0x7ce26e0>{"pirateAI.plist" in state: "TRAVEL_TO_LURK_AREA" for Ionics Whitetail 411}
  [universe.objectDump]: -> Ent:32		<ShipEntity 0xa529f98>{"Sidewinder Scout Ship" ID: 414 position: (-10871.7, 7594.79, 166146) scanClass: CLASS_NEUTRAL status: STATUS_IN_FLIGHT} mass 25355.94 <AI 0x7ce2890>{"pirateAI.plist" in state: "TRAVEL_TO_LURK_AREA" for Sidewinder Scout Ship 414}
  [universe.objectDump]: -> Ent:33		<ShipEntity 0xe1bff10>{"Moray Transport" ID: 488 position: (22065.9, 63383.1, 158737) scanClass: CLASS_NEUTRAL status: STATUS_IN_FLIGHT} mass 40446.67 <AI 0x7ce6c10>{"risingShuttleAI.plist" in state: "LIFT_OFF" for Moray Transport 488}
  [universe.objectDump]: -> Ent:34		<ShipEntity 0xdcb4b30>{"Ionics Whitetail" ID: 420 position: (2972.33, -10480.2, 168557) scanClass: CLASS_NEUTRAL status: STATUS_IN_FLIGHT} mass 17520.85 <AI 0x7ce90a0>{"interceptAI.plist" in state: "ATTACK_SHIP" for Ionics Whitetail 420}
  [universe.objectDump]: -> Ent:35		<ShipEntity 0xdcb8138>{"Ionics Whitetail" ID: 419 position: (3928.03, -10445, 168691) scanClass: CLASS_NEUTRAL status: STATUS_IN_FLIGHT} mass 17520.85 <AI 0x7ce2968>{"interceptAI.plist" in state: "ATTACK_SHIP" for Ionics Whitetail 419}
  [universe.objectDump]: -> Ent:36		<ShipEntity 0xdca7310>{"Mamba Escort" ID: 422 position: (3033.29, -10572.2, 168873) scanClass: CLASS_NEUTRAL status: STATUS_IN_FLIGHT} mass 26781.66 <AI 0x7ce3070>{"interceptAI.plist" in state: "ATTACK_SHIP" for Mamba Escort 422}
  [universe.objectDump]: -> Ent:37		<ShipEntity 0xdcbb740>{"Ionics Redback" ID: 418 position: (3379.78, -10485.6, 169162) scanClass: CLASS_NEUTRAL status: STATUS_IN_FLIGHT} mass 80074.23 <AI 0x7ce2f50>{"interceptAI.plist" in state: "ATTACK_SHIP" for Ionics Redback 418}
  [universe.objectDump]: -> Ent:38		<ShipEntity 0xdcb1528>{"Mamba Escort" ID: 421 position: (3719.01, -10539.1, 169156) scanClass: CLASS_NEUTRAL status: STATUS_IN_FLIGHT} mass 26781.66 <AI 0x7ce2848>{"interceptAI.plist" in state: "ATTACK_SHIP" for Mamba Escort 421}
  [universe.objectDump]: -> Ent:39		<PlanetEntity 0xd120028>{ID: 486 position: (23093.2, 61856.9, 166833) type: PLANET_TYPE_MOON radius: 8.000km} mass 39.39 (nil)
  [universe.objectDump]: -> Ent:40		<ShipEntity 0xe1a18c8>{"Ionics Huntsman" ID: 399 position: (3155.64, 8369.46, 189251) scanClass: CLASS_NEUTRAL status: STATUS_IN_FLIGHT} mass 49541.67 <AI 0x7ce8758>{"route1traderAI.plist" in state: "GO_TO_STATION" for Ionics Huntsman 399}
  [universe.objectDump]: -> Ent:41		<StationEntity 0x84a0230>{"Coriolis Station" "Coriolis Station" ID: 398 position: (31423.9, -1401.73, 213661) scanClass: CLASS_STATION status: STATUS_ACTIVE} mass 455223200.00 <AI 0x7ce9c28>{"stationAI.plist" in state: "IDLE" for Coriolis Station 398}
  [universe.objectDump]: -> Ent:42		<ShipEntity 0xc754a98>{"Navigation Buoy" ID: 472 position: (26045, -1161.79, 222088) scanClass: CLASS_BUOY status: STATUS_IN_FLIGHT} mass 383595.94 <AI 0x7ce4fa8>{"buoyAI.plist" in state: "GLOBAL" for Navigation Buoy 472}
  [universe.objectDump]: -> Ent:43		<ShipEntity 0xc75b6a8>{"Moray Transport" ID: 487 position: (27401.4, -3798.03, 252524) scanClass: CLASS_NEUTRAL status: STATUS_IN_FLIGHT} mass 40446.67 <AI 0x7ce1720>{"risingShuttleAI.plist" in state: "LIFT_OFF" for Moray Transport 487}
  [universe.objectDump]: -> Ent:44		<PlanetEntity 0x3490028>{ID: 396 position: (0, 0, 262890) type: PLANET_TYPE_GREEN radius: 29.210km} mass 39.39 (nil)
  [universe.objectDump]: -> Ent:45		<ShipEntity 0xdef8f18>{"Mamba Escort" ID: 441 position: (81660.6, -124046, 211903) scanClass: CLASS_NEUTRAL status: STATUS_IN_FLIGHT} mass 26781.66 <AI 0x7ce36a0>{"escortAI.plist" in state: "FLYING_ESCORT" for Mamba Escort 441}
  [universe.objectDump]: -> Ent:46		<ShipEntity 0xdef5910>{"Sidewinder Scout Ship" ID: 440 position: (82711.9, -124062, 211765) scanClass: CLASS_NEUTRAL status: STATUS_IN_FLIGHT} mass 25355.94 <AI 0x7ce34a8>{"escortAI.plist" in state: "FLYING_ESCORT" for Sidewinder Scout Ship 440}
  [universe.objectDump]: -> Ent:47		<ShipEntity 0xdeffb28>{"Sidewinder Scout Ship" ID: 443 position: (81920, -124049, 212175) scanClass: CLASS_NEUTRAL status: STATUS_IN_FLIGHT} mass 25355.94 <AI 0x7ce3100>{"escortAI.plist" in state: "FLYING_ESCORT" for Sidewinder Scout Ship 443}
  [universe.objectDump]: -> Ent:48		<ShipEntity 0xdef2308>{"Ionics Redback" ID: 439 position: (82189.5, -124053, 212286) scanClass: CLASS_NEUTRAL status: STATUS_IN_FLIGHT} mass 80074.23 <AI 0x7ce2f08>{"pirateAI.plist" in state: "TRAVEL_TO_LURK_AREA" for Ionics Redback 439}
  [universe.objectDump]: -> Ent:49		<ShipEntity 0xdefc520>{"Sidewinder Scout Ship" ID: 442 position: (82602.7, -124100, 212177) scanClass: CLASS_NEUTRAL status: STATUS_IN_FLIGHT} mass 25355.94 <AI 0x7ce3c40>{"escortAI.plist" in state: "FLYING_ESCORT" for Sidewinder Scout Ship 442}
  [universe.objectDump]: -> Ent:50		<ShipEntity 0xdf03130>{"Ionics Huntsman" ID: 444 position: (110540, -148147, 205670) scanClass: CLASS_NEUTRAL status: STATUS_IN_FLIGHT} mass 49541.67 <AI 0x7ce4468>{"pirateAI.plist" in state: "TRAVEL_TO_LURK_AREA" for Ionics Huntsman 444}
  [universe.objectDump]: -> Ent:51		<ShipEntity 0xdee4ae8>{"Ionics Whitetail" ID: 435 position: (85737.3, -142175, 225112) scanClass: CLASS_NEUTRAL status: STATUS_IN_FLIGHT} mass 17520.85 <AI 0x7ce3658>{"escortAI.plist" in state: "FLYING_ESCORT" for Ionics Whitetail 435}
  [universe.objectDump]: -> Ent:52		<ShipEntity 0xdee14e0>{"Sidewinder Scout Ship" ID: 434 position: (86515.6, -142188, 225053) scanClass: CLASS_NEUTRAL status: STATUS_IN_FLIGHT} mass 25355.94 <AI 0x7ce3b68>{"escortAI.plist" in state: "FLYING_ESCORT" for Sidewinder Scout Ship 434}
  [universe.objectDump]: -> Ent:53		<ShipEntity 0xdeeb6f8>{"Ionics Whitetail" ID: 437 position: (85877.3, -142255, 225363) scanClass: CLASS_NEUTRAL status: STATUS_IN_FLIGHT} mass 17520.85 <AI 0x7ce2ad0>{"escortAI.plist" in state: "FLYING_ESCORT" for Ionics Whitetail 437}
  [universe.objectDump]: -> Ent:54		<ShipEntity 0xdee80f0>{"Mamba Escort" ID: 436 position: (86319.8, -142128, 225287) scanClass: CLASS_NEUTRAL status: STATUS_IN_FLIGHT} mass 26781.66 <AI 0x7ce3460>{"escortAI.plist" in state: "FLYING_ESCORT" for Mamba Escort 436}
  [universe.objectDump]: -> Ent:55		<ShipEntity 0xdedded8>{"Ionics Redback" ID: 433 position: (86190.4, -142303, 225428) scanClass: CLASS_NEUTRAL status: STATUS_IN_FLIGHT} mass 80074.23 <AI 0x7ce3da8>{"route2sunskimAI.plist" in state: "HEAD_FOR_SUN" for Ionics Redback 433}
  [universe.objectDump]: -> Ent:56		<ShipEntity 0x787bed0>{"Asteroid" ID: 464 position: (123303, -191647, 178410) scanClass: CLASS_ROCK status: STATUS_IN_FLIGHT} mass 7744512.50 <AI 0x7ce4bb8>{"dumbAI.plist" in state: "GLOBAL" for Asteroid 464}
  [universe.objectDump]: -> Ent:57		<ShipEntity 0x786b0a8>{"Asteroid" ID: 459 position: (118641, -209583, 163928) scanClass: CLASS_ROCK status: STATUS_IN_FLIGHT} mass 7744512.50 <AI 0x7ce4660>{"dumbAI.plist" in state: "GLOBAL" for Asteroid 459}
  [universe.objectDump]: -> Ent:58		<ShipEntity 0x7882ae0>{"Asteroid" ID: 466 position: (128733, -185456, 191839) scanClass: CLASS_ROCK status: STATUS_IN_FLIGHT} mass 7744512.50 <AI 0x7ce4d68>{"dumbAI.plist" in state: "GLOBAL" for Asteroid 466}
  [universe.objectDump]: -> Ent:59		<ShipEntity 0xc751490>{"Asteroid" ID: 471 position: (128370, -194544, 182157) scanClass: CLASS_ROCK status: STATUS_IN_FLIGHT} mass 1319797.75 <AI 0x7ce4ed0>{"dumbAI.plist" in state: "GLOBAL" for Asteroid 471}
  [universe.objectDump]: -> Ent:60		<ShipEntity 0x7864498>{"Asteroid" ID: 457 position: (134527, -195735, 179292) scanClass: CLASS_ROCK status: STATUS_IN_FLIGHT} mass 1319797.75 <AI 0x7ce2a88>{"dumbAI.plist" in state: "GLOBAL" for Asteroid 457}
  [universe.objectDump]: -> Ent:61		<ShipEntity 0x7867aa0>{"Asteroid" ID: 458 position: (115937, -218656, 165738) scanClass: CLASS_ROCK status: STATUS_IN_FLIGHT} mass 1319797.75 <AI 0x7ce33d0>{"dumbAI.plist" in state: "GLOBAL" for Asteroid 458}
  [universe.objectDump]: -> Ent:62		<ShipEntity 0xc74de88>{"Asteroid" ID: 470 position: (141778, -193181, 181763) scanClass: CLASS_ROCK status: STATUS_IN_FLIGHT} mass 1319797.75 <AI 0x7ce4db0>{"dumbAI.plist" in state: "GLOBAL" for Asteroid 470}
  [universe.objectDump]: -> Ent:63		<ShipEntity 0x7860e90>{"Asteroid" ID: 456 position: (138935, -196065, 196841) scanClass: CLASS_ROCK status: STATUS_IN_FLIGHT} mass 7744512.50 <AI 0x7ce2fe0>{"dumbAI.plist" in state: "GLOBAL" for Asteroid 456}
  [universe.objectDump]: -> Ent:64		<ShipEntity 0x786e6b0>{"Asteroid" ID: 460 position: (137383, -207426, 184998) scanClass: CLASS_ROCK status: STATUS_IN_FLIGHT} mass 7744512.50 <AI 0x7ce46f0>{"dumbAI.plist" in state: "GLOBAL" for Asteroid 460}
  [universe.objectDump]: -> Ent:65		<ShipEntity 0x787f4d8>{"Asteroid" ID: 465 position: (130511, -202989, 197468) scanClass: CLASS_ROCK status: STATUS_IN_FLIGHT} mass 1319797.75 <AI 0x7ce4c90>{"dumbAI.plist" in state: "GLOBAL" for Asteroid 465}
  [universe.objectDump]: -> Ent:66		<ShipEntity 0x78860e8>{"Asteroid" ID: 467 position: (146231, -207320, 182956) scanClass: CLASS_ROCK status: STATUS_IN_FLIGHT} mass 1319797.75 <AI 0x7ce4a50>{"dumbAI.plist" in state: "GLOBAL" for Asteroid 467}
  [universe.objectDump]: -> Ent:67		<ShipEntity 0x78752c0>{"Asteroid" ID: 462 position: (146873, -197361, 195470) scanClass: CLASS_ROCK status: STATUS_IN_FLIGHT} mass 7744512.50 <AI 0x7ce4978>{"dumbAI.plist" in state: "GLOBAL" for Asteroid 462}
  [universe.objectDump]: -> Ent:68		<ShipEntity 0x785d888>{"Asteroid" ID: 455 position: (156370, -202929, 191534) scanClass: CLASS_ROCK status: STATUS_IN_FLIGHT} mass 1319797.75 <AI 0x7ce35c8>{"dumbAI.plist" in state: "GLOBAL" for Asteroid 455}
  [universe.objectDump]: -> Ent:69		<ShipEntity 0xdf17560>{"Asteroid" ID: 450 position: (142519, -223104, 179523) scanClass: CLASS_ROCK status: STATUS_IN_FLIGHT} mass 7744512.50 <AI 0x7ce32b0>{"dumbAI.plist" in state: "GLOBAL" for Asteroid 450}
  [universe.objectDump]: -> Ent:70		<ShipEntity 0x7856c78>{"Asteroid" ID: 453 position: (140331, -222940, 182903) scanClass: CLASS_ROCK status: STATUS_IN_FLIGHT} mass 1319797.75 <AI 0x7ce3bf8>{"dumbAI.plist" in state: "GLOBAL" for Asteroid 453}
  [universe.objectDump]: -> Ent:71		<ShipEntity 0x78788c8>{"Asteroid" ID: 463 position: (130905, -208168, 208727) scanClass: CLASS_ROCK status: STATUS_IN_FLIGHT} mass 1319797.75 <AI 0x7ce4ae0>{"dumbAI.plist" in state: "GLOBAL" for Asteroid 463}
  [universe.objectDump]: -> Ent:72		<ShipEntity 0x7871cb8>{"Asteroid" ID: 461 position: (150855, -215653, 186235) scanClass: CLASS_ROCK status: STATUS_IN_FLIGHT} mass 1319797.75 <AI 0x7ce47c8>{"dumbAI.plist" in state: "GLOBAL" for Asteroid 461}
  [universe.objectDump]: -> Ent:73		<ShipEntity 0x78896f0>{"Asteroid" ID: 468 position: (133734, -211371, 209501) scanClass: CLASS_ROCK status: STATUS_IN_FLIGHT} mass 1319797.75 <AI 0x7ce4738>{"dumbAI.plist" in state: "GLOBAL" for Asteroid 468}
  [universe.objectDump]: -> Ent:74		<ShipEntity 0xdf0d348>{"GalCop Viper" ID: 447 position: (157380, -220701, 179945) scanClass: CLASS_POLICE status: STATUS_IN_FLIGHT} mass 22723.75 <AI 0x7ce2c38>{"escortAI.plist" in state: "FLYING_ESCORT" for GalCop Viper 447}
  [universe.objectDump]: -> Ent:75		<ShipEntity 0xdf09d40>{"GalCop Viper" ID: 446 position: (157769, -220750, 179859) scanClass: CLASS_POLICE status: STATUS_IN_FLIGHT} mass 22723.75 <AI 0x7ce43d8>{"escortAI.plist" in state: "FLYING_ESCORT" for GalCop Viper 446}
  [universe.objectDump]: -> Ent:76		<ShipEntity 0xdf06738>{"GalCop Viper" ID: 445 position: (157554, -220904, 179902) scanClass: CLASS_POLICE status: STATUS_IN_FLIGHT} mass 22723.75 <AI 0x7ce3388>{"route2patrolAI.plist" in state: "HEAD_FOR_SUN" for GalCop Viper 445}
  [universe.objectDump]: -> Ent:77		<ShipEntity 0xc74a880>{"Asteroid" ID: 469 position: (141781, -216117, 203556) scanClass: CLASS_ROCK status: STATUS_IN_FLIGHT} mass 7744512.50 <AI 0x7ce3220>{"dumbAI.plist" in state: "GLOBAL" for Asteroid 469}
  [universe.objectDump]: -> Ent:78		<ShipEntity 0xdf13f58>{"Asteroid" ID: 449 position: (151167, -230338, 176649) scanClass: CLASS_ROCK status: STATUS_IN_FLIGHT} mass 1319797.75 <AI 0x7ce2e30>{"dumbAI.plist" in state: "GLOBAL" for Asteroid 449}
  [universe.objectDump]: -> Ent:79		<ShipEntity 0x785a280>{"Asteroid" ID: 454 position: (162740, -227959, 175700) scanClass: CLASS_ROCK status: STATUS_IN_FLIGHT} mass 7744512.50 <AI 0x7ce37c0>{"dumbAI.plist" in state: "GLOBAL" for Asteroid 454}
  [universe.objectDump]: -> Ent:80		<ShipEntity 0x7853670>{"Asteroid" ID: 452 position: (164474, -215685, 194306) scanClass: CLASS_ROCK status: STATUS_IN_FLIGHT} mass 1319797.75 <AI 0x7ce3028>{"dumbAI.plist" in state: "GLOBAL" for Asteroid 452}
  [universe.objectDump]: -> Ent:81		<ShipEntity 0xdf10950>{"Asteroid" ID: 448 position: (163329, -231292, 180815) scanClass: CLASS_ROCK status: STATUS_IN_FLIGHT} mass 1319797.75 <AI 0x7ce44f8>{"dumbAI.plist" in state: "GLOBAL" for Asteroid 448}
  [universe.objectDump]: -> Ent:82		<ShipEntity 0xdeeed00>{"Fer-de-Lance" ID: 438 position: (150867, -246641, 170848) scanClass: CLASS_NEUTRAL status: STATUS_IN_FLIGHT} mass 51050.64 <AI 0x7ce2c80>{"pirateAI.plist" in state: "TRAVEL_TO_LURK_AREA" for Fer-de-Lance 438}
  [universe.objectDump]: -> Ent:83		<ShipEntity 0x7850068>{"Asteroid" ID: 451 position: (168397, -235051, 179607) scanClass: CLASS_ROCK status: STATUS_IN_FLIGHT} mass 1319797.75 <AI 0x7ce42b8>{"dumbAI.plist" in state: "GLOBAL" for Asteroid 451}
  [universe.objectDump]: -> Ent:84		<PlanetEntity 0xadc0028>{ID: 397 position: (293420, -441052, 97385.1) type: PLANET_TYPE_SUN radius: 57.228km} mass 0.00 (nil)
  [universe.objectDump]: -> Ent:85		<PlanetEntity 0xcb50028>{ID: 485 position: (-2.2551e+006, -2.32763e+006, 1.1801e+006) type: PLANET_TYPE_GREEN radius: 150.000km} mass 39.39 (nil)
  [universe.objectDump]: -> Ent:86		<ShipEntity 0xe1bc908>{"Orbital Shuttle" ID: 489 position: (-2.25685e+006, -2.46498e+006, 1.11932e+006) scanClass: CLASS_NEUTRAL status: STATUS_IN_FLIGHT} mass 8859.77 <AI 0x7ce1b58>{"risingShuttleAI.plist" in state: "LIFT_OFF" for Orbital Shuttle 489}
  [universe.objectDump]: -> Ent:87		<ShipEntity 0xe1976b0>{"Orbital Shuttle" ID: 490 position: (3.99596e+006, 1.93918e+006, -1.44095e+006) scanClass: CLASS_NEUTRAL status: STATUS_IN_FLIGHT} mass 8859.77 <AI 0x7ce1d98>{"risingShuttleAI.plist" in state: "LIFT_OFF" for Orbital Shuttle 490}
  [universe.objectDump]: -> Ent:88		<PlanetEntity 0xb600028>{ID: 484 position: (3.98357e+006, 2.11862e+006, -1.42978e+006) type: PLANET_TYPE_GREEN radius: 180.000km} mass 39.39 (nil)
  [universe.objectDump]: -> Ent:89		<SkyEntity 0xadbce60>{ID: 394 position: (-9442.04, 16458.2, 10034.8) scanClass: CLASS_NO_DRAW status: STATUS_EFFECT} mass 0.00 (nil)
[gameController.exitApp]: .GNUstepDefaults synchronized.
User avatar
Kaks
Quite Grand Sub-Admiral
Quite Grand Sub-Admiral
Posts: 3009
Joined: Mon Jan 21, 2008 11:41 pm
Location: The Big Smoke

Post by Kaks »

Ok, I probably should have figured it out earlier, but I think I know what's happening!

I'm 99.9% sure the extra entries are stale references to planets on previous systems. In that case, all you need to do is to clear the planets & moon arrays! Probably the best place to do so is in buildAdditionalArrays. Try changing

Code: Select all

{
   // See if we can exit early.  No need to be in this if there's nothing to do.
   if(system.planets.length == 1) return;
   
   // Loop through all the planets and moons to divide them accordingly
   for(var i = 0;i < System.planets.length;i++) { 
to

Code: Select all

{
   addedMoons=[]; addedPlanets=[];
   // See if we can exit early.  No need to be in this if there's nothing to do.
   if(system.planets.length == 1) return;
   
   // Loop through all the planets and moons to divide them accordingly
   for(var i = 0;i < System.planets.length;i++) { 
That should do the trick!
Hey, free OXPs: farsun v1.05 & tty v0.5! :0)
User avatar
Cmd. Cheyd
---- E L I T E ----
---- E L I T E ----
Posts: 934
Joined: Tue Dec 16, 2008 2:52 pm
Location: Deep Horizon Industries Manufacturing & Research Site somewhere in G8...

Post by Cmd. Cheyd »

The function I call just before adding the planets/moons and then building the arrays is:

Code: Select all

this.clearArrays = function()
{
	// Clear any past entries in arrays
	addedPlanets = [];
	planetIDs = [];
	planetTextures = [];
	addedMoons = [];
	moonIDs = [];
	moonTextures = [];
	badSeeds = [0,1];
	addedPlanets.length = 0;
	planetIDs.length = 0;
	planetTextures.length = 0;
	addedMoons.length = 0;
	moonIDs.length = 0;
	moonTextures.length = 0;
}
EDIT:
Kaks - There's a complete copy of the script in your PM's.
User avatar
Cmd. Cheyd
---- E L I T E ----
---- E L I T E ----
Posts: 934
Joined: Tue Dec 16, 2008 2:52 pm
Location: Deep Horizon Industries Manufacturing & Research Site somewhere in G8...

Post by Cmd. Cheyd »

I went ahead and added the two lines to clear the arrays just before I reuse them. It works.

Now, I want to know WHY... Just before I call that function, I use another that specifically clears all the arrays so I can reuse them.

I SINCERELY APPRECIATE the solution. I just wish I understood it. :(
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 »

Next lines you can delete without problem

Code: Select all

	addedPlanets.length = 0;
	planetIDs.length = 0;
	planetTextures.length = 0;
	addedMoons.length = 0;
	moonIDs.length = 0;
	moonTextures.length = 0;
By emptying the array the length becomes zero by definition.

With the current redux version I noticed that in some systems the moon is a bit to close to the station. Result is that shuttles launching from main-station, head for the moon not the planet. Shuttles go to the closest planet and apparently the moon surface is closer than that of the main planet.

For 1.73 I changed some AI scripts to better cope with multi planet systems. e.g. shuttles launching from a non-main-planet no longer head for the system station, but for the closest station.
Same with traders. When they arrive at a planet that is not the main-planet, they won't aim for the system-station, but for the closest station.
User avatar
Cmd. Cheyd
---- E L I T E ----
---- E L I T E ----
Posts: 934
Joined: Tue Dec 16, 2008 2:52 pm
Location: Deep Horizon Industries Manufacturing & Research Site somewhere in G8...

Post by Cmd. Cheyd »

FOUND IT!!!!!!!!!!!!!!

When I was calling This.ClearArrays, I ... Well, look below:

Code: Select all

this.ClearArrays;
I forgot to include the (). So it was never calling the function. Oddly, I never got any warnings in the log either.

Anyways, it appears to be working now. Just need to add a little more debug code and I think it'll be done. Yes, the final will have debug code in it, but you will be able to switch it on/off by toggling a few booleans. Since I'm a novice scripter, I figured I'd make it so anyone who encounters a bug can toggle a pair of lines to "true" and send me their latest.log.[/code]
User avatar
Frame
---- E L I T E ----
---- E L I T E ----
Posts: 1477
Joined: Fri Mar 30, 2007 8:32 am
Location: Witchspace

Post by Frame »

Cmd. Cheyd wrote:
FOUND IT!!!!!!!!!!!!!!

When I was calling This.ClearArrays, I ... Well, look below:

Code: Select all

this.ClearArrays;
I forgot to include the (). So it was never calling the function. Oddly, I never got any warnings in the log either.

Anyways, it appears to be working now. Just need to add a little more debug code and I think it'll be done. Yes, the final will have debug code in it, but you will be able to switch it on/off by toggling a few booleans. Since I'm a novice scripter, I figured I'd make it so anyone who encounters a bug can toggle a pair of lines to "true" and send me their latest.log.[/code]
That should generate some sort of warning... if it does allready not, it really should...

Your log files should allways be completely error free..

also debug OXP and the debug console is a very good tool for debugging, on the run...
Bounty Scanner
Number 935
Post Reply