Scenes

From Data Realms Wiki

Revision as of 14:16, 7 July 2012 by Brendan (Talk | contribs)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

A Scene consists of one material image, and up to three background images.

The RGB colors used in the material image must match those in Materials.ini or your own custom Material definitions (a more complicated modding technique not covered here). Wherever in the material image you use a Material's color, those pixel will be made of it and have its physical properties.

The background files are specified with "AddBackgroundLayer = SceneLayer" followed by "CopyOf = ____.rte/_PresetName_". Look in Base.rte/Scenes/Backdrops.ini for those included in Cortex Command.

Contents

Scene Definition

Here is an example Scene's definition, the Tutorial Bunker, from the current Build 27:

AddScene = Scene
// Instance call that defines the next text as parts of a Scene.

	PresetName = Tutorial Bunker
	// The name used to refer to the instance later.

	Description = Start here if you are new to Commanding with your Cortex!
	// Optional flavor text appearing when site is selected in Campaign or Scenario mode.

	LocationOnPlanet = Vector
		X = -10
		Y = -75
	// Positions the "site sprite" on the Campaign/Scenario planetary map in Build 27.

	MetagamePlayable = 1
	// Specifies whether to put in the Campaign mode. 
	// Appears only in the Tutorial [1] and the Missions [0]. Defaults to true [1] if left out.

	Revealed = 0
	// Appears only in Campaign Scenes and the Tutorial, both as [0].

	OwnedByTeam = -1
	// Appears only in Campaign Scenes and the Tutorial, both as [-1].

	RoundIncome = 1000
	// Specifies gold generated from controlling site in income phase. 
	// Appears only in Campaign Scenes and the Tutorial.

	P1BuildBudget = 0
	P2BuildBudget = 0
	P3BuildBudget = 0
	P4BuildBudget = 0
	// Campaign mode. Additional gold available to players by default.

	AutoDesigned = 1
	// Specifies if any PlaceSceneObject with "PlacedByPlayer = 0" is part of automatic Campaign base-building [1] or not [0].

	TotalInvestment = 0
	// Variable tracked in Campaign mode as base investments are made; naturally starts at zero.



	Terrain = SLTerrain
	// Defines the section as parts of a Terrain-type SceneLayer. 
	// Scenes only have one of these, which includes all TerrainObjects.

		CopyOf = Tutorial.rte/Tutorial Terrain
		// Refers to a Terrain defined in another file with "PresetName = Tutorial Terrain"

		BitmapFile = ContentFile
			FilePath = Tutorial.rte/Scenes/Tutorial.bmp
		// Used to specify the .bmp (bitmap) file used as the Material map for the Terrain

		DrawTransparent = 1
		// Appears only in Campaign Scenes and Tutorial, both as [1].

		Offset = Vector
			X = 560
			Y = 0
		// Positioning offset for the BitmapFile

		WrapX = 0
		// Boolean value specifying horizontal wrapping
		WrapY = 0
		// Boolean value specifying vertical wrapping 
		// Advised not to set "WrapY = 1" as DropShips and Rockets cannot return.

		ScrollRatio = Vector
			X = 1
			Y = -1
		// Rate of scrolling horizontally and vertically. Value is almost always |1| whether positive or negative.

		ScaleFactor = Vector
			X = 1
			Y = 1
		// Appears only in Campaign Scenes and the Tutorial, both as (1,1)


		BackgroundTexture = ContentFile
		// Defines the next text as parts of a BackgroundTexture.
			FilePath = Base.rte/Scenes/Textures/DirtDark.bmp
			// Texture to be used for destroyed Terrain.


		AddTerrainFrosting = TerrainFrosting
		// Defines the next text as parts of a TerrainFrosting.

			TargetMaterial = Material
				CopyOf = Base.rte/Topsoil
			// Name of Material to have frosting applied to it. Defined in Materials.ini in Base.rte.

			FrostingMaterial = Material
				CopyOf = Base.rte/Grass
			// Name of Material to be the frosting. Needs to have a TextureFile defined in Materials.ini.

			MinThickness = 2
			MaxThickness = 4
			// Minimum and maximum thickness of the frosting.

			InAirOnly = 1
			// Place frosting only in spaces whose Material is Air [1] or entire perimeter [0].


		AddTerrainDebris = TerrainDebris
		// Defines the next text as parts of a TerrainDebris.
			CopyOf = Base.rte/Gold
			// Debris is defined elsewhere in Base.rte with "PresetName = Gold".

			DebrisFile = ContentFile
				FilePath = Base.rte/Scenes/Objects/Gold/Gold.bmp
			// Image to be used by placed debris.

			DebrisPieceCount = 26
			// Number of debris pieces to be placed in the Scene.

			DebrisMaterial = Material
				CopyOf = Base.rte/Gold
			// Material 

			TargetMaterial = Material
				CopyOf = Base.rte/Earth
			// Name of Material debris is made of. Defined in Materials.ini in Base.rte.

			OnlyOnSurface = 0
			// Forbid placing debris outside the Terrain surface [1] or allow it to be "in the dirt" [0].

			OnlyBuried = 1
			// Forbid placing deris on the Terrain surface [1] or allow it "in the air" [0].

			MinDepth = 25
			MaxDepth = 350
			// Minimum and maximum depth below the Terrain surface that debris is to be placed.

			DensityPerMeter = 0.5
			// How many pieces of debris are can be within 1 meter of another piece.


		AddTerrainObject = TerrainObject
		// Instance call that defines the next text as a TerrainObject.
			CopyOf = Base.rte/Big Fossil
			// TerrainObject is defined elsewhere in Base.rte with "PresetName = Big Fossil".

			Position = Vector
				X = 492
				Y = 528
			// Where the TerrainObject will be placed in the Scene coordinates.

	// END OF SLTerrain SECTION



	PlaceSceneObject = TerrainObject
	// Instance call used to place a SceneObject of TerrainObject type.
	// TerrainObjects appear "behind" other SceneObjects; applies to Bunker pieces.
		CopyOf = Base.rte/Tut Brain Tech
		// Is defined elsewhere in Base.rte with "PresetName = Tut Brain Tech".

		Position = Vector
			X = 648
			Y = 624
		// Where the TerrainObject will be placed in the Scene coordinates.


	PlaceSceneObject = Actor
	// Instance call used to place a SceneObject as its own type
	// Applies to all the types of Actors and Devices. 
		CopyOf = Base.rte/Brain Case
		// Defined elsewhere in Base.rte with "PresetName = Brain Case".

		Position = Vector
			X = 696.5
			Y = 636
		// Where it will be placed in the Scene coordinates.

		HFlipped = 0
		// Whether it faces right [0] or left [1]

		Team = 0
		// Which Team an Actor belongs to; not used for Devices.

	// END OF PlaceSceneObject ENTRIES
	// of which there will be many



	AddBackgroundLayer = SceneLayer
	// Defines a BackgroundLayer as a SceneLayer. 
	// There can be up to three Backgrounds, though all are optional.
		CopyOf = Base.rte/Near Layer

	// END OF Backgrounds



	AddArea = Area
	// Defines an Area. Best left to the Area Editior included in Cortex Command.
		AddBox = Box
			Corner = Vector
				X = 1330
				Y = 0
			Width = 770
			Height = 400
		Name = AIAttack

Here is a pre-B27 example:

AddScene = Scene // The instance call, defines the next text as parts of a scene
	
	InstanceName = Grasslands // The name used to refer to the instance later.
	
	LocationOnPlanet = Vector // Unused before Build 27
		X = 0
		Y = 0
	
	GlobalAcceleration = Vector //a.k.a gravity, measured in m/s^2, advised to not use X direction acceleration.
		X = 0
		Y = 19.82
	
	Terrain = SLTerrain // The instance call, defines the next text as parts of a SLTerrain
		
		InstanceName = Grasslands Terrain // The name used to refer to the instance later.
		
		BitmapFile = ContentFile
			Path = Base.rte/Scenes/Grasslands.bmp // The scene material file.
		
		WrapX = 1 // Boolean values that determines if the map wraps in the X, Y or both directions,
		WrapY = 0 // it is advised to not set Y to 1 as DropShips and Rockets cannot return.
		
		ScrollRatio = Vector // Determines the rate of scrolling.
			X = 1.0
			Y = -1.0
		
		BackgroundTexture = ContentFile
			Path = Base.rte/Scenes/Textures/DirtDark.bmp // Texture to use for destroyed earth.
		
		/////TerrainFrosting/////
		
		AddTerrainFrosting = TerrainFrosting // Frosting: "A roughened or speckled surface". simulates randomly sized grass.
			
			TargetMaterial = Material
				CopyOf = Topsoil // The material to have frosting on.
						
			FrostingMaterial = Material
				CopyOf = Grass // The material to use for frosting.
			
			MinThickness = 5 // Min length.
			
			MaxThickness = 7 // Max length.
			
			InAirOnly = 1 // If Target material has another material on top of it whether to replace it (0) or not (1).
		
		/////TerrainDebris/////
		
		AddTerrainDebris = TerrainDebris
			CopyOf = Gold
		
		AddTerrainDebris = TerrainDebris
			CopyOf = Plants
		
		AddTerrainDebris = TerrainDebris
			CopyOf = Boulders
		
		// Terrain Objects go here:
		
		PlaceTerrainObject = TerrainObject
			CopyOf = Rocket Silo
			Location = Vector
				X = 1357
				Y = 693
	
	//note all of the above, after "Terrain = SLTerrain", belong to the SLTerrain instance.
	// Movable Objects go here:
	
	PlaceSceneObject = AHuman
		CopyOf = Robot 1
		Position = Vector
			X = 1444
			Y = 870
		Team = 0
		AddInventoryDevice = HDFirearm
			CopyOf = SMG
	
	// Background layer images, goes from closest to furthest away.
	
	AddBackgroundLayer = SceneLayer
		CopyOf = Near Layer
	AddBackgroundLayer = SceneLayer
		CopyOf = Clouds Layer
	AddBackgroundLayer = SceneLayer
		CopyOf = Sky Layer

TerrainDebris

TerrainDebris is randomly chosen and placed objects in a specific material.

AddTerrainDebris = TerrainDebris // The instance call, defines the next text as parts of TerrainDebris.

	InstanceName = Boulders // The name used to refer to the instance later.

	DebrisFile = ContentFile
		Path = Base.rte/Scenes/Objects/Boulders/Boulder.bmp // Sprites of the TerrainDebris.
	// When loading, 000-001-002 etc is added automatically before .bmp 

	DebrisPieceCount = 103 // Amount of different pieces (sprites) of TerrainDebris.

	DebrisMaterial = Material
		CopyOf = Stone // The material the TerrainDebris is made of.

	TargetMaterial = Material
		CopyOf = Earth // The material to place the TerrainDebris in.

	OnlyOnSurface = 0 // Boolean value that determines if it is anywhere in the material (0) or only on the surface (1).

	MinDepth = 0 // Minimum depth that the TerrainDebris can be at.

	MaxDepth = 300 // Maximum depth that the TerrainDebris can be at.

	DensityPerMeter = 1.5 // Density per meter.

Backdrops

Backgrounds layers, while unnecessary, make scenes much more visually appealing. A scene generally has a back-most layer which doesn't move in relation to the 'camera', along with other layers that use parallax scrolling. There are three background groups; Near Layer, Middle Layer, and Far Layer. Each layer goes in it's relevant group, either Near Backdrops, Mid Backdrops or Far Backdrops.

AddBackgroundLayer = SceneLayer // The instance call, defines the next text as parts of a BackgroundLayer.

	InstanceName = Near Layer  // The name used to refer to the instance later.

	AddToGroup = Near Backdrops // See message above concerning Layer grouping.

	DrawTransparent = 1 // Boolean value for if the layer uses transparencies (1) or not(0).

	WrapX = 1 // Boolean values that determines if the backdrop wraps in the X, Y or both directions.
	WrapY = 0 

	ScrollRatio = Vector // It is good to set closer backdrops to have a higher scroll ratio than further ones.
		X = 0.25
		Y = 1200

	BitmapFile = ContentFile // Starts definition of BitmapFile
		Path = Base.rte/Scenes/Backdrops/Middle.bmp // Filepath for ContentFile of BitmapFile

Lord Tim's Scene Tutorial

Lets go through this line by line. I think that will be helpful. Code tags take up too much space, so I'll just use the list format thing.

  • AddScene = Scene

This creates a new Object of the Scene class and adds it to the list of scenes in the game.

  • InstanceName = Prom Grounds

Names the scene. In this case, the scene will show up in the list as "Prom Grounds".

  • LocationOnPlanet = Vector

This currently doesn't do anything noticable in the game, but probably eventually will correspond to the metagame map or something.

  • GlobalAcceleration = Vector

X,Y vector. Most common gravity is positive Y, which is down. But if you're doing something really weird, you could, potentially, make it go in other directions.

  • Terrain = SLTerrain

Terrain is a variable of Scene. This creates a new terrain of the SLTerrain class and assigns the Scene's terrain to it.

  • InstanceName = Prom Terrain

Names the SLTerrain object. This doesn't show up ingame, it's just for referring back to if you want to use it again.

  • BitmapFile = ContentFile
  • Path = PromGrounds.rte/Scenes/PromGrounds.bmp

Assigns the BitmapFile variable of the SLTerrain to a ContentFile. Game gets the image for the terrain and converts it from mat palette colors to ingame materials. More on creating these images later.

  • WrapX = 1

This means that if you go past the farthest right side of the scene, you'll be at the farthest left side, and vice versa. This is a boolean value.

  • WrapY = 0

Same as above, only for the top and bottom.

  • ScrollRatio = Vector

Effs stuff up if you mess with it, but if you really have to know, it changes the speed that the terrain scrolls ingame. Set the X to 2 and the ground will move twice as fast as the actors walking on it.

  • BackgroundTexture = ContentFile
  • Path = Base.rte/Scenes/Textures/DirtDark.bmp

Sets the texture of the background that shows when you dig through dirt.

  • AddTerrainFrosting = TerrainFrosting

This adds a TerrainFrosting to the scene's list of terrain frostings.

  • TargetMaterial = Material

Sets the material that you want the frosting to "frost" in/over.

  • FrostingMaterial = Material

Sets the material that you want the frosting to be made out of.

  • MinThickness = 5

Minimum length of the frosting. Straight up from target material. In pixels.

  • MaxThickness = 7

Maximum length of the frosting.

  • InAirOnly = 1

Allows you to decide whether the frosting will be allowed to be placed when there is another material in the way. Usually looks better with this on.

  • AddTerrainDebris = TerrainDebris

Adds a TerrainDebris object to the scene's list of TerrainDebris. I'll show how to create one of these later.

  • PlaceTerrainObject = TerrainObject

Adds a TerrainObject object to the scene's list of TerrainObjects. These are the "bunkers" and geology.

  • PlaceSceneObject = Any class

This allows you to place any other objects that you want in your scene. Includes AHumans, ACDropships, and the brains.

  • AddBackgroundLayer = SceneLayer

Adds a layer of background image to the scene's list of backgrounds. These will be displayed behind the BackgroundTexture, and in order from front to back in the same order that you add them. How to create these is described later.

A shortcut by DylanHutch

A quick way to make a scene (in .bmp) is copy a scene from base.rte/scenes/ and paste it somewhere.

  • Open it, and delete around half of it.
  • Now fill it in with the BG colour.(R=255, G=0, B=255)
  • Ok, now use the colour picker to copy the 'soil' material. this should be the top colour apart from 'BG'.
  • Paint a line around as thick as the vannila soil. This will be the top. (the part you stand on)
  • Now copy the Earth colour.(180, 130, 80 (RGB))
  • Paint another line, this time a little lower, ok bucket fill above the line, this will be the 'Earth' material.
  • Keep doing the last step till you get to 'Rock'

There! Done! You made a map! Now you can add detail to the map as you wish.

TerrainDebris

To finish up, here's how you create a TerrainDebris object:

AddTerrainDebris = TerrainDebris

   InstanceName = Boulders //Name
   DebrisFile = ContentFile
      // When loading, 000-001-002 etc is added automatically before .bmp
      Path = Base.rte/Scenes/Objects/Boulders/Boulder.bmp
      // You can have as many (or up to 1000) images as you want. They all have to be in the same location.
      // You manually put the 000,001, etc. on the image's filename, and here all you have to do is define one image. It will get the rest.
   DebrisPieceCount = 103 //Tell it how many images you made
   DebrisMaterial = Material //The material the debris is made out of
      CopyOf = Stone
   TargetMaterial = Material //The material the debris will be scattered in. Make another TerrainDebris object to have it in more than one material
      CopyOf = Earth
   OnlyOnSurface = 0 //Same as Frostings. 1 will make it only go on the top of the material.
   MinDepth = 0 //How far down the placement will be (assuming OnlyOnSurface is 0)
   MaxDepth = 300 //See above

   DensityPerMeter = 1.5 //How close together the debris will be randomly placed

Backgrounds

And a Background Layer:

AddBackgroundLayer = SceneLayer

   InstanceName = Near Layer
   AddToGroup = Near Backdrops // For scene editor
   DrawTransparent = 1 // Do you want it to make the magenta areas transparent?
   WrapX = 1 // You should make this the same as your scene's warpping.
   WrapY = 0 // Same here
   ScrollRatio = Vector
      X = 0.25 // Make this smaller if you want it to scroll slower. Making it the same as the width of the image or higher will cause it to not scroll at all.
      Y = 1200 // Make this the height of your image.
   BitmapFile = ContentFile // Where is the image?

      Path = Base.rte/Scenes/Backdrops/Middle.bmp


Now for the Terrain's BitmapFile. This image has to be in the CC Mat palette (unless you're doing custom materials, but that's really hard, and I explain it below, as well).

The colors in the mat palette correspond to the index in Materials.ini, so the first color in the palette is the first material in Materials.ini. When making a scene, you'll probably only need a few colors.

Personal tools