Contents
Back
Forward

Introduction to CSPL


Civilization Scenario Programming Library

One of the things i always envyed to "Civilization: Call to Power" game is the great SLIC language, using a C-like syntax SLIC is able to change nearly all parameters of CTP and, no doubt, it is the stronger point of CTP.
Test of Time doesn't have SLIC, it inherits from Civ2 a macro-language which is not very powerful (you have few commands, and you must use them in a "rigid" way) and a lot of scenario designer have "fighted" for years with this inexpressive macro language trying to get over its constraints.
CSPL is an attempt to build a "SLIC Language clone" for Test of Time, it access Test of Time memory and continuosly reads and writes data following a pre-defined program written by the CSPL user.
CSPL is not a new language, it is simply a C library, which contains functions to access in a easy and structured way to Tot internal data structures (units, cities, etc); this means two things:

  1. That CSPL user is not restricted to a custom language (but instead he uses a real programming language just to code game events)
  2. That CSPL programming requires a bit of C knowledge (and this means it is not so easy to use as macro-language)
This is the first version of CSPL, so it has never been tested on a real scenario, i expect a lot of bugs to came out from this version so, if you find something which resembles a CSPL bug (a function which returns a wrong value or something similar), please mail me here

WARNING: Before releasing any program developed using CSPL please read Chapter 13



Credits

Here i would like to thank Allard Höfelt, Jorrit Vermeiren, Carl Fritz and Andrew Livings, without whose "excavations" CSPL could not have been written. If I have hacked deeper than them, it is because I stand in their trenches.
(And, if you've noticed it, i would like to thank also Graham Nelson...)
Thanks goes to William Keenan and Harlan Thompson for support they gave me testing the first "CSPL program" i've made (it was intended as a DOS stand-alone program called WorldLink and now you can find its CSPL version as example in this manual).
And obviously thanks to everyone who helped me testing my work, particulary Shadowstrike, St.Leo and DarthVeda.



Future extension

I plan to enhance CSPL functionality in several points:
  • Make CSPL programs able to access Macro-Language flags, in that way a CSPL program could be "merged" with a proper ToT events.txt file.
  • Find a way to "freeze" Tot from a CSPL program, in this way a lot of events which now are impossible to realize will become easy to implement.
  • Simplify a lot of currently implemented functions.
  • Create several tools as CSPLCompanion to help designer in designing a scenario with CSPL.
  • Code several procedure to remove logic concepts (See appendix A) from CSPL programming.
  • And obviously, try to make it more stable...
I don't know when i'll find time to write another version of CSPL so i can't say if these thing will be implemented in the next month or in the next year, anyway don't expect to see a new version soon...



Contents / Introduction
Chapter I / Chapter II / Chapter III / Chapter IV / Chapter V / Chapter VI / Chapter VII
Chapter VIII / Chapter IX / Chapter X / Chapter XI / Chapter XII / Chapter XIII
Appendix A / Appendix B