Custom encounters are a more advanced form of EZ script. If you are just starting out, look at the overview of EZ script and write a few stories to get a feel for how it works before you dive into custom encounters.
Making Custom Encounters into Standard Encounters
EZ script encounters are actually made up of smaller pieces called actions. If you consider the Fight encounter, there are two actions involved: the villains are fighting the heroes and the allies are fighting the villains. You can duplicate this using the custom encounter type, and specifying the actions involved.
Encounter: Same as Fight
Type: Custom
Actions: villains fight heroes, allies fight villains
This encounter is exactly the same as the Fight encounter in normal EZ script.
Why is that important? With the custom encounter type, you can access those actions directly (and there are a lot of them). Why do that? Suppose you want a fight scene where thugs and cops are involved in a shootout. That sounds like a Fight encounter. But, suppose you wanted the encounter to start right away, and force the heroes to race to the scene of the fight to save the cops before they are all ko’d? The standard encounters won’t let you do that, but a custom encounter will.
Encounter: Cops and Robbers
Type: Custom
Actions: villains fight heroes, allies fight villains, villains start immediately, allies start immediately
Suddenly you have a customized fight encounter.
Suppose you want that fight encounter to occur while a fire rages around them. Just add the ‘fire’ action to the encounter.
Encounter: Cops and Robbers with Fire
Type: Custom
Actions: villains fight heroes, allies fight villains, villains start immediately, allies start immediately, fire
Suppose you want the villains to surrender if half of them are defeated? Add another action.
Encounter: Cops and Robbers with Fire
Type: Custom
Actions: villains fight heroes, allies fight villains, villains start immediately, allies start immediately, fire, villains stop when half are defeated
To create a custom encounter, use the type Custom and add actions appropriate to the encounter you want to play.
Encounter: Name
Type: Custom
Actions: (list the actions here, each separated by a comma)
You can specify villains, minions, allies, and objects like any other encounter.
Villains: nuclear_winter
Minions: ice_trooper
Allies: cop
Objects: cub_market_crate2
You can also specify rivals and cohorts. Rivals are like villains, except that they will compete with the villains. That is, they will attack both heroes and villains. Cohorts are the minions of Rivals.
Rivals: pin_stripe
Cohorts: thug_with_bat, thug_with_gun
Rivals won’t fight villains just by being listed, however. You need to specify the appropriate actions, such as rivals fight villains.
Each action you choose may also add additional parameters, such as Item: or Time: See the individual descriptions for more information.
Every custom encounter will also use the Alert, Start and End cut scenes.
Alert Cutscene:
Red arrow on Villain
Start Cutscene:
Villain says, “So, we meet again.”
End Cutscene:
Hero says, “That’s all folks.”
Each action will likely have cut scenes associated with it. For example, the ‘Heroes sabotage Objects’ action uses the Sabotage Cutscene: cutscene.
Endings are words or phrases that tell you how the encounter played out. A custom encounter will always have an ending called ‘end’, but it will also have endings associated with the actions you choose.
At the end of the encounter, any allies still present will be added to the player’s team.
Cut Scenes:
Allies Join Heroes: played when the allies become part of the team
Endings:
Allies Join Team: if at least one ally joined the team
Allies Defeated: if all allies are ko’d
Allies will fight any villains, minions, rivals or cohorts present.
Cut Scenes:
Allies Lost: plays if all allies are ko’d
Allies Saved: plays if all villains and minions are defeated
Endings:
Allies Lost: if all allies are ko’d
Allies Saved: if at least one ally remains
All of the remaining allies will stick around after the encounter is over, rather than automatically being removed by EZ script. If you want them to follow the heroes, you’ll need to add the Allies Follow Heroes Action.
Add this action if the allies should not fight anyone. You may need to do this if, for example, you are using cops or other hero types as allies.
Allies will attempt to gather at a spot away from the encounter area. The marker is called congregate for those wishing to add a specific location for the allies to gather.
Cut Scenes:
Ally Congregates: an ally makes it to the gather spot (the safe spot)
Endings:
All congregated: all allies made it to the safe spot
None congregated: no allies made it to the safe spot
Some congregated: some allies made it to the safe spot
Any allies will attempt to flee to a marker called end, and will disappear once they reach that marker.
Cut Scenes:
None Escaped: no allies escaped
Some Escaped: some allies escaped
All Escaped: all allies escaped (none were ko’d)
Endings:
None Escaped: no allies escaped
Some Escaped: some allies escaped
All Escaped: all allies escaped
Allies will attempt to follow the heroes around.
If you want your allies to start frozen, in stasis, cowering or in cages, then set this action to allow the heroes to free them.
Cut Scenes:
Ally Freed: plays each time the hero frees an ally
Ally Allies Freed: plays once all allies have been rescued
Endings:
No allies freed
Some allies freed
All allies freed
Allies will start the encounter frozen. If you have FFX set up so that being frozen causes damage, they will start taking damage as soon as the encounter starts.
Allies will start the encounter with the stasis effect.
Allies will start the encounter with the ‘interrogate me’ effect, although they cannot be interrogated.
Allies will start the encounter inside of individual cages. This may not work if the ally is very large, but it does work for standard sized characters. Destroying the cage will free the ally.
Allies in the encounter will follow the hero and the hero will have to lead the allies to a safe spot (the end marker) some distance away. The hero can give simple commands to the allies (Stay Here, and Follow Me).
Cut Scenes:
Escort Won: allies successfully fled the map
Escort Lost: allies did not make it to the safe spot
Endings:
Escort Won: allies successfully fled the map
Escort Lost: allies did not make it to the safe spot
Allies have their AI turned off and will not move or act.
When the hero rescues an ally, that ally will then have its AI enabled and will act normally.
A custom action will be added to each ally, allowing a hero to ‘rescue’ them. Use this action in conjunction with allies do not move and allies move when freed.
Cut Scenes:
Ally Rescued: the hero has rescued a single ally
An ally will want to talk to the heroes once all villains and minions have been defeated. They will run towards the heroes and display an attention symbol.
Cut Scenes:
Ally wants to thank heroes: all minions and villains are defeated and the ally wants to talk
Ally thanks hero: the ally has reached the hero and thanks them
Endings:
Ally thanked hero
Ally survives
Ally did not thank hero
Ally lost
An ally starts the encounter wanting to talk to the heroes.
Cut Scenes:
Chat: plays when the hero selects ‘talk_to’ on the ally.
Chat Won: the talk went well
Chat Lost: the hero didn’t get a chance to talk to the ally (they were ko’d)
Endings:
Chat complete
Chat lost: the ally was ko’d
The allies start the encounter a short distance away from the action.
The allies are actually double-agents and will attack the heroes. Use this for a nasty surprise when the heroes are rescuing supposedly innocent allies.
Endings:
Allies defeated
Any allies will have their AI’s activated as soon as the encounter loads. Use it to start a fight before the hero can get there.
A bomb is set to explode, and must be disarmed before it does so. A timer action is required to actually set off the bomb (countdown works best).
Parameters:
Bomb: the template of the bomb object
Cut Scenes:
Bomb Disarmed: a hero has disarmed the bomb
Bomb Exploding: the bomb is about to explode
Endings:
Bomb Disarmed
Bomb Exploded
A building which should already exist on the map, will slowly crumble.
Parameters:
Buildings: the names of the buildings (already on the map) that are collapsing
Cut Scenes:
Building Collapsed
Special note: for most of the ‘disaster’ encounters, you can use a parameter called Storm Intensity. Give it a numeric value that represents how strong the storm should be (5 is the default value).
The map shakes and buildings around the map will be damaged. Characters on the map may also fall over.
Note: you can use ‘immediate earthquake’ to start the earthquake right away.
A small number of fires flare up around the encounter marker, some of which will burn nearby characters (damage only occurs once the encounter has started). The flames die off when the encounter is over. They cannot be targeted or put out.
Winds whip through the map and throw objects around (but not characters). You can use ‘immediate hurricane’ to have it start immediately.
Patches of ice will appear near characters, which may cause them to slip, and characters may be caught in icy explosions.
Fiery objects will fall from the sky and explode on impact with the ground, with buildings, or even with characters.
Meant for desert maps, but can be used anywhere. Sandstorms whip up loose particles of sand and other debris which may harm characters or cause them to fall over.
Lightning strikes random objects from the sky, causing mayhem and possibly catching characters in small electrical explosions.
A powerful torrent of wind slowly makes its way from the ‘tornado’ marker to the ‘end’ marker. It causes significant damage to anything in its path, leveling buildings and tossing objects and characters about.
Any villains in the encounter cannot be harmed.
Parameters
villain invulnerability effect: an effect from the resources tab of ffedit that shows the villain to be invulnerable
The item in the encounter cannot be damaged. This is useful if you don’t want the object being stolen by the villains to be destroyed by a random area attack.
Parameters:
item invulnerability effect: an effect from the resources tab of ffedit that shows the item to be invulnerable
The invulnerability effect on items or villains (or other things) can be disabled by the heroes if they perform a certain task as shown below.
As it says, the heroes can destroy all objects associated with the encounter to stop the invulnerability effect.
When all minions are ko’d or otherwise removed, the invulnerability effect can end.
Using the ‘switches exist’ action, the switches in the encounter have to be switched in order to end the invulnerability effect.
This is the base action for other actions involving items. An item exists in the encounter and the heroes and villains can interact with it.
Parameters:
Item: the template of the item, found in the templates tab of ffedit
Cut Scenes:
Item Lost: the item has been removed from the game, usually by a villain fleeing the map
Hero gets item: a hero has picked up the item
Item Dropped: a hero or villain has dropped the item (by being ko’d)
Endings:
Hero has it: the encounter ended with the hero carrying the item
Item Lost: the item has been carried away by a villain or rival
Item switched off: the item has been turned off (using switches)
The encounter will monitor whether or not the item has been destroyed.
Cut Scenes:
Item destroyed: the item has suffered too much damage and has been destroyed
Endings:
Item destroyed: the item was destroyed
Heroes can pick up the item if it is on the ground.
The item starts the encounter on the ground (rather than in the hands of a villain for example).
Once all villains and minions are defeated, the allies are going to want the item back. The hero can click on an ally to return the item to them.
Cut Scenes:
Hero gets item: the hero has picked up the item
Item returned: the hero has returned the item to an ally
Item recovered: the encounter is ending and the item has been returned
Item not returned: the encounter is ending and the item has not been returned.
Endings:
Item returned: the item has been returned to the ally
Item recovered: same as item returned
Item not returned: the heroes couldn’t give the item to the allies (it was destroyed, the allies were ko’d, or the item was lost)
The villains in the encounter want the item and will attack the heroes to get to it.
Cut Scenes:
Villains get item: the villain has picked up the item
Villains drop item: the villain has dropped the item
Endings:
Villains have item: the villains end the encounter holding on to the item
Villains do not have item: the villains weren’t able to get the item
Not only do the villains want the item, but they also start with it in their possession.
The item has a power associated with it and can use that power. Whom it uses the power on is specified in other actions.
Parameters:
Trap Power: a power from the powers tab of ffedit. It is best to use area or ranged powers.
The item uses the power on heroes that get too close.
The item uses its power on villains.
The item doesn’t distinguish friend from foe and uses its power any anyone that gets too close.
The item will only use its power once (good for exploding objects) and then shut down.
Endings:
Item used power: the item has used its power once an then stopped
Requires a ‘switches exist’ action. Once all switches have been switched, the item will stop using its power.
The heroes can interact with one of the objects.
Parameters:
Examine Command: the command that is displayed on the object when the player clicks on it.
Cut Scenes:
Examine: the hero is examining the object
Endings:
Examine complete: the hero has examined the object
The heroes can destroy the objects in the encounter.
Cut Scenes:
Objects Destroyed: plays when the last object has been destroyed
Endings:
Objects Destroyed
The allies will help the heroes destroy the objects in the encounter.
One object is chosen from the list (usually the first one given) and a Sabotage command is place on it. A hero can then select the command, and the object will explode in 10 seconds.
Cut Scenes:
Sabotage: a hero has selected the sabotage command on the object
Endings:
Sabotage Complete: the object has been sabotaged (it has exploded)
Any rivals in the encounter will fight not only the heroes, but the villains as well.
Endings:
Rivals Gone: all rivals and cohorts have been defeated.
The AI for the rivals will be activated right away, before the heroes arrive.
The AI for the cohorts will be activated right away, before the heroes arrive.
The rivals will start a short distance away from the encounter marker.
The cohorts will start a short distance away from the encounter marker.
There’s always some nefarious device that can be switched on or off to foil a villain’s plans. The Switches exist action spawns a group of switches that the player can switch on or off. By default, they spawn away from the encounter marker, but you can place
‘switch’ (such as encounter1_switch1) markers to control where they show up.
Parameters:
Switches: the templates to use for the switch devices (defaults to ‘switch’)
Cut Scenes:
Switch Turned Off: a single switch has been activated
All Switches Turned Off: all switches in the encounter have been activated
Endings:
All switches off: all switches in the encounter have been activated
The heroes must accomplish something in a certain amount of time. The timer starts as soon as the heroes arrive at the encounter area, and a clock is displayed on the screen to show the player how much time is left. If the timer expires, the encounter ends immediately, regardless of the other actions in the encounter.
Parameters:
Time: how long before the countdown expires, given in seconds
Timer message: the message to display on screen
Cut Scenes:
Timer Expired: the timer has hit zero
Endings:
Timer expired: time has run out
Timer still going: the heroes have accomplished their task before the timer hit zero
This is the same as the countdown action, except that the timer starts immediately and the heroes will have to race to the encounter area before it expires.
The encounter will last for a certain amount of time before it ends. The encounter will NOT end until the timer has expired. The countdown is not displayed for the player.
Parameters:
Time: how long the encounter lasts, given in seconds
Cut Scenes:
Timer Expired: the timer has hit zero
Endings:
Timer expired: time has run out
As the timed encounter, except that the time starts immediately even before the heroes reach the encounter area.
If you have allies in your encounter that are not attacking the villains, the villains will typically ignore them. To get the villains to attack the allies anyway, use this action.
Villains will attempt to destroy any objects in the encounter.
Cut Scenes:
Objects lost: all objects destroyed by the villains
Objects Saved: at least one object has survived the encounter
Endings:
Objects lost: all objects destroyed by the villains
Objects Saved: at least one object has survived the encounter
Villains and minions will attack the heroes.
Endings:
Villains gone: all villains and minions defeated
Villains and minions will hunt down enemy characters (heroes, allies or even rivals) even if they are outside of their visual area.
Villains will hunt down heroes from anywhere on the map.
Villains will attempt to flee to the ‘end’ marker associated with the encounter. They will leave their minions to fight off the heroes.
Cut Scenes and Endings:
None Escaped: no villains escaped
Some Escaped: some villains escaped
All Escaped: all villains escaped (none were ko’d)
Minions will attempt to flee to the ‘end’ marker.
Cut Scenes and Endings:
None Escaped: no minions escaped
Some Escaped: some minions escaped
All Escaped: all minions escaped (none were ko’d)
Both villains and minions will attempt to flee.
Cut Scenes and Endings:
None Escaped: no villains or minions escaped
Some Escaped: some villains or minions escaped
All Escaped: all villains and minions escaped (none were ko’d)
Villains and/or minions will flee, but only if they are in possession of an item.
The villains start the encounter a short distance away from the action.
The minions start the encounter a short distance away from the action.
One of the villains will not be ko’d immediately, but instead will wait for the heroes to interrogate him or her.
Cut Scenes:
Interrogation: the heroes are interrogating the villain
Villains will attack any objects in the encounter, or any objects already on the map.
Minions will attack any objects in the encounter, or any objects already on the map.
Villains and minions will attack any objects in the encounter, or any objects already on the map.
Villains will attack nearby buildings.
Minions will attack nearby buildings.
Villains and minions will attack nearby buildings.
The AI for the villains will be activated right away, even before the heroes arrive.
As with villains, the minions will start acting as soon as the encounter has been set up.
Sometimes the villains don’t want to fight to the bitter end. You can have them stop at a certain health level.
Each of the health level actions have the following cut scene and ending:
Cut Scene:
Villains stop: the villains have reached the specified health level and are giving up
Ending:
Villains hurt: the villains have been hurt and are giving up
When all villains are at half health or lower, they give up.
Villains will end the encounter when all are at one quarter health or lower.
When all villains are at three quarters health or lower, they give up.
When all villains are at one-third health or lower, they give up.
When all villains are at two-thirds health or lower, they give up.
You can also have the villains give up when a certain number of them are defeated
Cut Scene: Villains Half Defeated
Ending: Villains Defeated
The encounter ends as soon as a single villain has been defeated.
Cut Scene: Villain Down
Ending: Villains Defeated
If the heroes defeat all of the minions, the villains will stop fighting.
Cut Scene: Minions Defeated
Ending: Villains Defeated
If all of the villains are defeated, the minions will give up immediately.
Cut Scene: Villains Defeated
Ending: Villains Defeated
If you have a good custom encounter, you may want to use it over and over again. To do so, you need to open up m25enccustom.py in your mod/missions directory.
You’ll see something like:
ENC_CUSTOM_TYPES = {
'examine': 'villains fight heroes, allies fight villains, object can be examined',
'fight': 'villains fight heroes, allies fight villains',
'flee the scene': 'villains fight heroes, allies fight villains, villains and minions flee',
'guard object': 'villains fight heroes, allies fight villains, villains attack object, villains start at distance, minions start at distance',
'rival factions': 'villains fight heroes, allies fight villains, rivals fight villains',
'rescue frozen': 'allies frozen, villains fight heroes, allies can be freed',
}
ENC_CUSTOM_TYPES contains the names of the encounters and the actions they use. EZ script creates a custom encounter on the fly using those actions and then runs it. For example, the entry for the fight encounter looks like this:
'fight': 'villains fight heroes, allies fight villains',
When you use the encounter in EZ script, you’d write
Encounter: My Encounter
Type: Fight
Internally, EZ script converts that too
Encounter: My Encounter
Type: Custom
Actions: villains fight heroes, allies fight villains
If you have a custom encounter that uses the actions ‘earthquake, villains fight heroes’ and you want to call it ‘shaking all over’, you’d add an entry to ENC_CUSTOM_TYPES
‘shaking all over’: ‘earthquake, villains fight heroes’,
Then you can use it just like the fight encounter.
Encounter: My Encounter
Type: Shaking All Over
Note: this is a python dictionary, so you must get the quotes, colons and commas in the right places.