@ollie-tabooga, on 29 June 2011 - 05:50 AM, said in Random Probability Drive - possible?:
I am pretty confused about ncb's and set/test expressions.
The most basic thing you need to know is that test expressions are for finding things out, and set expressions are for doing things.
A test expression, for example, is what decides whether a mission will be available, or a ship be offered for sale. For example, if a mission's test expression is b1 & !b2, it will be offered only if bit 1 is set and bit 2 is clear. This is how you make a storyline progress without a mission being offered either too early or more than once. (Notice that the elements of a test expression are related: the ampersand means that the elements on both sides have to be set, whereas the 'or' sign, |, would return true if either item were true. And of course the exclamation mark negates what comes after it.) If you aren't already familiar with boolean (true/false) logic, you might want to read up on it a bit.
When the mission completes, it executes a much simpler set expression. The elements of a set expression aren't related; it's just a list of things to be done. The hypothetical mission from above would, on completion, set b2, meaning that it won't be offered again. (There's also a separate set expression that executes if the mission fails. Here, you could write !b1 !b2 !b3, causing the player to be kicked back to the beginning of the story if he/she fails the mission.)
The next mission in the sequence would have the test expression b2 & !b3, and the set expression b3, and so on, so that the story would progress one mission at a time.
Of course, there are things other than bits that you can set or test, and places other than missions that you can put expressions. You can, for example, use a test expression to determine whether a ship should be offered for sale, and run a set expression when the player buys it; krugeruwsp also mentioned crรถn resources, which can be set to launch automatically without player intervention.
This is all simpler to do than it is to explain, I'm afraid.