//===================================== // ORRERY for Torque 3D // Written by Jay Crossler - jay@crossler.com (WeCreateGames.com) // Available under Creative Commons BY 3.0 license - you can use and make money from this, just give me credit //----------------------------------------------------------------------------- // Torque Game Engine TorqueScript //----------------------------------------------------------------------------- //===================================== 1) Create a new mission, named Orrery //===================================== 2) Add Orrery.mis to Orrery/game/levels/ 3) Delete the other missions (simple.mis NewMission.mis) in this directory 4) In Orrery/game/scripts/client/init.cs: Within this function, change: function loadDefaultMission() { Canvas.setCursor("DefaultCursor"); createServer( "SinglePlayer", "levels/simple.mis" ); to: createServer( "SinglePlayer", "levels/Orrery.mis" ); //===================================== 5) Add PlanetsInit.cs to Orrery/game/scripts/server/ 6) Update Orrery/game/scripts/server/scriptExec.cs add to end of file: exec("./PlanetsInit.cs"); //===================================== 7) Copy planets.cs to Orrery/game/art/datablocks/ exec("./planets.cs"); 8) Update Orrery/game/art/datablocks/datablockExec.cs add to end of file: exec("./planets.cs"); 9) Add materials.cs to Orrery/game/art/materials.cs 10) Copy the planets directory to Orrery/game/art/shapes/ (so it's Orrery/games/shapes/planets) //===================================== 11) Copy the sky_night directory to Orrery/game/art/skies 12) Copy the three rocks jpgs (rocks_65.jpg, rocks_dark.jpg, rocks_meddark.jpg) to the Orrery/game/art/terrains/WarriorCamp directory NOTE: If you open the world and there are big orange patches, go into World Editor, Terrain Painter, then select the "Warning Material" and choose Edit. Navigate to the rocks_65 and rocks_dark textures) //===================================== INSTRUCTIONS: Hit the console key (~) and typing "t" as a shortcut to create three orreries. You need to (1) Create an Orrery, (2) Initialize planets in the correct location, (3) Animate them: //Orrery_Create(%orreryHandler, %name, %center, %radius, %numplanets, %spacingmode, %planetarchivefile, %timestep, %planetsizing, %show_children_of, %levels_of_children) Examples: Orrery_Create("o1"); //Use Default Settings Orrery_InitPlanets("o1"); Orrery_BeginAnimation("o1"); Orrery_Create("o2", "Mini System", "-233.581 -60.61 196.786", "5 5 5", 5, 4, "", 0.00004, 0.1, "Sol", 1); Orrery_InitPlanets("o2"); Orrery_BeginAnimation("o2"); If you are editing code, a shortcut is to type "r" in the console, which reloads the PlanetsInit.cs. This way, you don't need to quit Torque to make sure code compiles/updates correctly The Orrery/game/art/shapes/solar_system.cs has all of the planet/moon information in it - You can copy this and make your own solar system (or update to new information). - Important fields: //For a planet new ScriptObject() { planetName = "Pluto"; //Name of the planet that's shown, also used for lookups planetOrder = 9; // The order of the planet out from the star (used as an estimate, as sometimes planet orbits are elongated and some move within others) satelliteOf = "Sol"; // What does this orbit around? shapeName = "art/shapes/planets/pluto.dts"; // Which DTS file is used? Materials.cs has to describe the texture as well scale_mult = "1 1 1"; // Some planets are squished (especially gas giants, which have a smaller Z axis. Jupiter's is "1 1 .92" for example) orbit_calc_method = "major_planet"; // How should the orbits be calculated? dist_from_parent = 5900000000; // Average distance from parent. Not yet used days_sidereal_rot = 90767.11; // How many earth days in a rotation? Not yet used diameter_km = 2302; // Diameter, Not yet used obliquity = 119.61; //How much tilt? Not yet used //As of 1 Jan 2000, Julian Date = 2451545 a_semimajor_axis = 39.48168677; //6 variables are used to calculate planetary axis e_eccentricity = 0.24880766; i_inclination = 17.14175; O_ecliptic_long = 110.30347; w_perihelion = 224.06676; L_mean_longitude = 238.92881; a_per_cy = -0.00076912; //This is how much does they vary per century e_per_cy = 0.00006465; i_per_cy = 11.07; O_per_cy = -37.33; w_per_cy = -132.25; L_per_cy = 522747.90; //Moons are not yet implements - will be in release #2