Contents
Back
Forward

Introduction to CSPL


Civilization Scenario Programming Library

One of the things I always envied about the "Civilization: Call to Power" game is the great SLIC language. Using a C-like syntax SLIC is able to change nearly all the parameters of CTP and, no doubt, it is one of the stronger points of CTP. Test of Time doesn't have SLIC, but rather inherits from Civ2 a macro-language which is not very powerful (you have few commands and they must be used in a "rigid" way) and a lot of scenario designer have fought for years with this inexpressive macro language, trying to overcome its constraints. CSPL is an attempt to build a "SLIC Language Clone" for Test of Time. It accesses Test of Time memory and continuously 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 an easy and structured way the ToT internal data structures (units, cities, etc). This means two things:

  1. The CSPL user is not restricted to a custom language (but instead uses a real programming language to code game events)
  2. CSPL programming requires a bit of C knowledge (which means it's not as easy to use as macro-language)
This is the first version of CSPL and so it has never been tested on a real scenario. I expect a lot of bugs to arise from this version, so if you find something which appears to be a CSPL bug (a function which returns a wrong value or something similar), please email 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 they, it is because I stand in their trenches.
(And, if you've noticed it, I would also like to thank Graham Nelson...)
Thanks also go to William Keenan and Harlan Thompson for the support they gave in testing the first "CSPL program" I created (it was intended as a DOS stand-alone program called WorldLink and now you can find it's CSPL version as an example in this manual).
Appreciation is extended to everyone who helped by testing my work, particularly Shadowstrike, St.Leo and DarthVeda. And finally thanks go to Paul Cullivan (Kull) for proofreading and editing this document.



Future expansion

I plan to enhance CSPL functionality in several areas:
  • 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 within the CSPL program. In this way a lot of events which now are impossible to realize will become easy to implement.
  • Simplify many of the currently implemented functions.
  • Create several tools such as CSPLCompanion to help designers build a scenario with CSPL.
  • Code several procedures 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, but 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