Dual purpose example!


1: Get a random number from a pool, but not the same number you just got! (Sort of) (Requires String Tokenizer)


Since my last example of this feature, I trimmed it down to be a little simpler. It doesn't necessarily guarantee that you won't get exactly the same number you just got if you have more than one of that number in the pool. What it does do is ensure that you get a different entry from the pool each time, similar to a method using the List object posted on the forums. The upside of this method is that it can be used with any type of string you want, including alterable strings (which are much quicker to read from than the List object!).

Note: the top string in this frame ("source example") isn't required if you don't want it. It's only there for show. You can also ditch the Counter and instead use something else, like an Active object.


2: Extension-less substring replace!


This function is great for dialogue engines and contained in a single active object. It is also used in the first frame example (non-repeating random number).

It has 3 parameters for you to set: Source String, Cut Out, Replace With.

You can choose to only cut something from a string without also replacing it with something; simply leave the "Replace With" empty. You can also call the loop however many times you want if you only want a specific number of replaces.

To use:

- set the source string
- set what you want to cut out of it
- set what you want to replace what you just cut with, if anything
- open the substring group and call the loop
- set the string you wanted to modify to the "return" of the substring object



no repeat and substring replace_1.mfa