CEG-Format

Source: https://spring.clan-sy.com/svn/spring/trunk/rts/Sim/Projectiles

Contents

Overall Format

A CEG file contains one or more CEGs. Each CEG follows this format:

[ceg_name] {
  useDefaultExplosions = 0;
  [spawner_name_0] {
     class=CClassName;
     [properties] {
       property0 = value0;
       property1 = value1;
       //and so on...
     }
     condition0 = 1;
     condition1 = 0;
     count = 1;
  }

  [spawner_name_1] {
     //each spawner follows that format
  }

  [groundflash] {
     //groundflash is a special name; it always generates a groundflash
     flashsize=16;
     flashalpha=1;
     circlegrowth=1;
     circlealpha=0;
     ttl=8;
     color=1,1,1;
  }
}

useDefaultExplosions

If this is set, the CEG will use the default explosion (based on damage and area of effect) in addition to any spawners you define.

Spawners

A CEG can contain any number of spawners. The name of the spawners don't really matter, as long as it's not "groundflash", which has a special meaning. You can think of each spawner as being one component of the overall explosion.

Class

Each spawner has a class that determines what kind of graphical effect it creates. Spring has a number of standard classes that you can choose from. See CEG-Classes for details.

Properties

Depending on what class a spawner is, it will have a set of properties that allow you to fine-tune what the spawner displays. Again, see CEG-Classes for details.

Conditions

These determine under what conditions the spawner will run. The available conditions are "air" (at least 20 elmos above ground/sea level), "water", "ground", "unit" (hits a unit), and "nounit" (doesn't hit a unit). There is an "underwater" condition, but it doesn't actually work at time of writing. If you set the condition to true (e.g., "water = 1;"), the spawner will run if the explosion takes place under that condition. If you set more than one condition, the spawner will run if any of them are true. If you want a spawner to run only if two or more conditions are all true, you have to do a little trick with the CExpGenSpawner class.

Count

The count determines the number of times the spawner will run.

groundflash

If you name a spawner "groundflash," it will always generate a groundflash. A groundflash has the following properties:

  • flashsize (float): The radius of the groundflash.
  • flashalpha (float in [0, 1]): How transparent the groundflash is. Generally, the higher, the brighter.
  • circlegrowth (float): A groundflash can have an additional circle that expands outwards. This controls how fast the circle grows.
  • circlealpha (float in [0, 1]): How transparent the circle is.
  • ttl (int): How long the groundflash lasts.
  • color (float3): The color of the groundflash.

Suggested Use: A short groundflash (~8 frames) is good for any explosion that gives off light. You can also use a longer groundflash to suggest the ground is glowing from heat.

Data Types

CEGs use the following data types:

  • float: Most properties are floats.
  • int: Used for counts and ttls.
  • bool: Use for conditions, and some properties.
  • float3: Used for vectors and colors. The components are floats, separated by commas. You can also use the keyword dir, which represents the direction fed to the CEG.
  • string: Used for colormaps and texture names. In .lua you delimit a string by quotes; in .tdf you do not. Color maps consist of 2 or more groups of 4 numbers, each group representing a RGBA color. Textures are the names you define in gamedata/resources.tdf or gamedata/resources.lua.

You can use CEG-Operators to define floats that are not fixed.

Units

All distances are in elmos; all time is in frames.

Retrieved from "http://springrts.com/wiki/CEG-Format"

This page has been accessed 402 times. This page was last modified 17:40, 13 March 2010.


 
 

Page editing toolbox

Browse
Main Page
Community portal
Current events
Recent changes
Random page
Help
Donations
Edit
View source
Editing help
This page
Discuss this page
Post a comment
Printable version
Context
Page history
What links here
Related changes
My pages
Log in
Special pages
New pages
File list
Statistics
Bug reports
More...

Site layout created by Roflcopter.