Random choices:

Perhaps you want to give the player an option to choose something and then have random results come from it? While there may not be many practical uses for a function like this in a game like FF, it is fairly easy to do and can pull off quite a few tricks if used to a higher potential than I’m showing here.

Mission_CustomAction(Action Name, Object/Character Filter, Object/Target Filter, Function Name, Radius, Oneshot)

This function will set up the command for whatever you want to pull off. Let’s say I want to give the player a random chance of actually changing his health, killing himself, or setting off an explosion to damage the things around him? Well…it’s easy!

Mission_CustomAction('random selection', 'hero_1', 'hero_1', 'random', 5, 1)
def random(hero, target):
    print 'random selection is active'
    activeselection= randint(1,3)
    if activeselection == 1:
        print 'heal'
        Object_SetAttr('hero_1', 'health', 100)
    if activeselection == 2:
        print 'kill'
        kill('hero_1')
    if activeselection == 3:
        print 'boom'
        explode('hero_1', 'generic fire explosion large', intensity = 3)
    else:
        print activeselection

And it’s as simple as that. To expand on the code, randint(#,#) picks a number randomly and saves it to the game’s memory as “activeselection”. Once a number is chosen, it goes through a bunch of “if” statements. If the number turns out to be 1, the character in the first slot gets his hp changed to 100. If the number equals 2, the hero is instantly killed. If the number ends up being 3, an explosion is triggered at the hero’s location that damages anything around him. This can get way more advanced than this by adding different commands to the code such as healing the character’s current health or almost anything else you might think of…with a little to a lot of work.

And there we go. That’s the tip for today. If you find any of this useful or use it as a base for something you’re workign on, please let me know!