This is not really a "wish list", in the classic sense. I have tried to carefully define the logic used, so that we have a practical system that meets modders' needs.
Before I begin, I will be the first to say that I do not know Spring's sourcecode backwards and forwards at this time. I am still reading over sections, and as I am at work at the moment, I will not be able to provide any definative quotes from the source in this initial article. However, I will be citing the source as I gain more knowledge.
Section One: What is the goal?
In a word: "flexibility". The entire system can be summarized in one sentence:
"Weapons are nothing but particle systems with additional gameplay effects."
The system I have laid out, below, lays out a variable system that is very flexible- i.e., it has as few interlocking conditions as possible. Fewer interlocking (or mutually-exclusive) conditions means that modders can develop things with relative ease. It also means that coders can keep more things seperated, and call them through includes, which should help make the coding of this area of Spring more straightforward.
Section Two: Non-Units, Scripted Events, Particle Systems
Sub-Sections:
1. Non-Units
1a. A quick example.
1b. Definitions (incomplete, but that's why this a public document)
2. Events
2a. Definitions (variable states, booleans, logical operators, etc.)
2b. Examples of scripted events
1. What are Non-Units?
Non-Units are any game objects that are not maps and are not units. These are interactive objects that are called by game code to do a wide variety of things, from explosion special effects called by an Event to weapons that may have associated special effects, sounds, and other properties. Maps and Units may interact with Non-Units by calling them through Event Scripting, which may be hardcoded parameters within Spring or "soft coded" scripted parameters that become parts of the Unit/Map mix.
If this sounds vague, it is because this is a very general system, which is broken into sub-parts for speed and efficiency, but kept very abstract in order to be flexible and easily modified by coders working on the Spring project. Instead of tying large numbers of things together in one piece of code to get a particular desired goal met, the design here calls for modular pieces that can be altered without having to re-write the whole, and allowing for new things to be added without disrupting the whole.
1a. A Quick Example.
Here is a very simple Non-Unit. This is a weapon that fires from the named PieceNum in the COB script during a FIRE event. It fires a Model, which may have Events tied to *it*. The beauty of the system I'm laying out here (and I admit heavily drawing on my Freelancer experience for this) is that it is referring to other Non-Units to create an entire event (so far as players are concerned, at any rate), instead of being its own special class. Therefore the number of hard-coded things is kept as small as possible- we simply add on more Non-Units with different parameters to create a whole. We can have layers and layers of inter-connected things this way, allowing us to re-use scripts, combine them into new, interesting groups without having to create new ones, etc.
Code: Select all
[MediumCannon]
{
IsWeapon=1;
MyGravity=0;
Velocity=500;
Acceleration=0;
MaxRange=1000;
AreaEffect=16;
Type=SimpleModel;
Model=MediumCannonShell.s3o;
ShadowMe=1;
PlaySound(create)=MedCannon.wav;
PlaySound(death)=MedCannonExplosion.wav;
CallNonUnit(create)=Particle.MediumCannonSmokePuff;
CallNonUnit(create)=Particle.MediumCannonFlare;
CallNonUnit(death)=Particle.MediumCannonExplosion;
CallNonUnit(death)=Particle.MediumCannonExplosionSpawnParticle;
AffectsStat.MaxDamage
{
default=-1000;
SpireRook=-300;
}
}