eddieb said:
Yes, I'd very much like to do prophecy/UE/Standoff style missions now. I could already do simple wc1/2 missions without the scripting language. I think you're right in that variables make it much more powerful and handy, and I'll come up with a way to add them. Now as far as build-in engine functions/actions, is this list pretty sufficient to do a Standoff style complex mission. Assuming I add in arithmetic operations and variables.
Ok. Well, my answer would be no - neither the list of the built-in engine functions/actions, nor in general the scripting system you've presented would be sufficient to do a Standoff-style misssion, even with the addition of arithmetic operations and variables.
To understand why this is, you have to firstly consider that, in terms of built-in functions/actions, WCP has over 250 to offer - and even so, we ended up adding another 20-30 functions that WCP didn't have (...and continue to add more). So in order to have all the necessary functions, you'd really have to look at the list of WCP (and our) functions, and include all of them (in fact, even then it would probably be good to add another two or three dozen functions on top
).
The second thing, as I already mentioned, is the structure. Right now, as I understand it, a mission in your system would essentially consist of a bunch of IF structures. So, it would be like a big FAQ, with a bunch of questions and an answer to each one of them. Our missions are totally different. They're... uh, I'm not actually a programmer, so I may be using the term incorrectly, but I think they're what would be classified as object-oriented code. Every ship, navpoint or other object in the mission has its own set of functions ("function" in this case meaning a set of commands grouped between a "begin" and an "end"). Most objects only have one function (the "main" function), but some have multiples (for example, a "death" function, triggered when a a ship dies). And of course you can declare functions unattached to any particular object, and then call them from within other functions. All of these functions can utilise two and a half types of variables - global variables (which are declared *outside* of the mission, and can be passed on from one mission to another), and local variables (which can be subdivided into two types - you can declare a local variable at the start, and use it for the entire mission, or you can declare a local variable inside a particular function, in which case the rest of the mission won't know about its existence), and the degree of control that this system offers is simply amazing.
The WCP system, in my opinion, is excellent. It's not quite ideal (personally, I think there should be a central main function for the whole mission, which would form the backbone, so to speak - although the current solution, where the player's main function offers pretty much the same functionality), but it's pretty close. Again, the degree of control - it's great. You can have two dozen different things going on at once, and it will all be strictly under your control. You can create a complex network of events that will trigger each other, end each other, et cetera. And, very importantly, you have great clarity - if I want a particular ship to do something, I know that I need to put the code inside its main function. Then, when I edit the mission two weeks later, it's dead-easy to find that main function, because it's named - which your IF structures are not - and because there's only one main function for that one ship - while you might have two dozen IF structures dealing with just one ship.
Don't get me wrong - the structure you've designed is excellent for simple missions (that's why I asked about the kind of missions that you'd like to create). Basically, the way I see it, the two systems have the following advantages and disadvantages.
WCP:
+ Huge flexibility - you can do the same thing in many different ways.
+ Huge power - you can do things that the game's programmers never thought of.
+ Easy to use for anyone with *any* experience in an ordinary programming language.
+ Potentially clean-structured - an incompetent programmer will still clutter up the code to make it unreadable, but anybody else will have no trouble structuring the code in such a way as to make debugging joyfully easy.
- Difficult for anyone who's never had contact with programming.
- Excessively wordy, for simple missions (...but "cut & paste" save the day
).
Your system:
+ Simple, therefore easy to learn for someone who's never programmed anything.
+ Clean, short code, cutting time for simple missions.
- Inflexible - the Q&A format you seem to be using essentially forces the player into doing everything in the form of IF structures.
- Limited - I can't imagine doing anything in this system that you didn't personally think of putting in there (but this would be solved by adding variables and arithmetics), because the system really doesn't allow it.
- Frustrating for people with programming experience - you've come up with a structure different to ordinary programming languages. I personally find this structure difficult to understand, and I suspect others would, too. After a while, you start building up a set of preconceived notions of what programs and scripts should look like... and you then get confused when you see something new (at least, I do).
- Potentially difficult to debug. If I make a complex mission in this system, it really will have multiple IF structures for many ships and navpoints... and that will be hard to debug (in WCP, we do sometimes have missions where a ship's main function includes a dozen IF structures nested within... but I try to keep this as rare as possible, precisely because it is difficult to read, and usually unnecessary in any case).
- Uses HTML-like tags. This is a personal bias... I think I'm allergic to "<word> </word>" tags, even if they really do sometimes make the code more readable
.
Now, it's time for me to get to sleep, so I'd best get to the point, which is my advice.
What is my advice? Simple - don't reinvent the wheel. Remember - Origin spent eight years making WC games. With just about every game, they returned to the question of scripting structure, and reworked it as necessary. WCP is the ultimate conclusion of this process - it is a summary of eight years' worth of experience. Everything in WCP is done for concrete reasons based on Origin's knowledge of what had worked and not worked in the methodology used in previous games. I suppose, had they made another WC game later, they probably would have improved this structure even further - but I am also certain that the changes would have been evolutionary rather than revolutionary. In short, WCP is a standard to be imitated, and hence my advice - Copy the WCP code, including the structure, syntax, and everything else. In fact, you could go a step further - get in touch with Thomas Bruckner and get the WCPPas source code from him. This source code will allow you to understand WCP code (WCPPas compiles the WCP Pascal code into true WCP code). Then you can alter Flight Commander to add support for such code - and apart from gaining a really great scripting language, you would gain the possibility of importing existing WCP/SO/UE missions.
Of course, compiling into WCP code is a time-consuming and rather optional step - just making Flight Commander read WCP Pascal code would be sufficient (and would not require you to get the WCPPas source code from Thomas); in this way, you would lose the capability to import WCP/SO missions, but you would gain the capability to update mission code on-the-fly without the need to recompile.
I realise that you might think I'm simply trying to persuade you to switch to the particular system that I'm used to. But I think the length of this post goes to show that I've given this a lot of thought
. My experience with games is not limited to modding WCP - apart from modding other games, I've also had the opportunity to work on a few commercial titles. As such, I've had the fortune (and misfortune) to experience a number of different scripting languages... and believe me, the more languages I encounter, the more respect I have for the language that Origin created for WCP. Compared to other languages, it really is nearly perfect.
(BTW, the WCP scripting system is universal, in the sense that the exact same kind of script is used outside of missions, in the series script, for the mission tree and for the clickable hotspots in the room-style interface)