Klok's Tutorials

The FEXP engine and associated packages are found here, as well as related tutorials and discussion.

Klok's Tutorials

Advanced Member
Advanced Member
Joined: Apr 16 2009, 05:56 PM

Jul 29 2011, 04:41 AM #1

After the first incident I had requested he retain the tutorials he had written for when the engine was released, and now the engine is released so he sent me these :R

So, here. These are all stuff he put together while working with the hacked engine :I

System Config:
[+] spoiler
Let's start with the first script that's easily editable: System Config.

Here are all of the editable options (aside from really advanced stuff)

Teams = 4. This really doesn't need to be modified unless you have something planned that needs more than four teams, which is... approximately nothing. :\
Player Team = 1. Leave this be.

Enemy Team = 2. Same.

TEAM_GROUPS = [[1,3],[2],[4]] ... This could be modified and maybe provide for multiplayer options.

MAIN_CHARACTER = [1] This is a neat addition. Want more than one character to be able to seize? Like James and Jessica in the Phoenix Saga, this can be edited easily to allow for multiple lord seizing configurations. I have other uses planned for this too :D If you want to add more characters, change it like this: [1, 2, 34] where the number = actor ID.

LOSS_ON_DEATH = [1, 26, 41] # The player loses if these actors die as allies

HP_COUNTER_VALUES = 2 # Number places to show for HP in battle

MAX_HP_ROWS = 2 # Rows of HP ticks in combat

HP_TABS_PER_ROW = 50 # HP ticks per row in the combat HP gauge

MAX_STAT = 30 # The highest number any non-HP stat should reach. Incidentally, even if you set this number to more than 30, you still have to adjust individual class stat maxes.

LCK_CAP = 30 # The default Luck cap. Still needs to be modified for individual classes, I think.

LVL_CAP = 20 # Max level

TIER0_LVL_CAP = 10 # Max level for tier 0s, if they exist. To set a class to tier zero, go to the class section of the database and edit their tier number to 0. Simple.

PROMOTION_LVL = 10 # Minimum level to promote

LEVEL_UP_PROMOTION = [0] # Tiers that can promote through leveling. If you want to make it FE9/10ish, set this to [0, 1] which allows for auto level promoting.

DBL_ATK_SPD = 4 # Attack speed over the opponent needed to double attack.

NUM_ITEMS = 5 # Number of items each unit can hold. You just got excited didn't you? Now we can have FE5 style 7 items per unit features!! (Though that would still need to have the additional item room scripted in.)

SUPPLY_STORAGE = 150 # The amount of items that can be kept in supply. Wait, didn't Merlinus have a limit of 100?

WEAPON_TYPES = 10 # The number of weapon types

PHYSICAL_TYPES = 4 # The number of physical weapon types

MAGICAL_TYPES = 6 # The number of magical weapon types

ANIMA_TYPES = [5, 6, 7] # Weapon types that are kinds of Anima

DARK_TYPE = 9 # The element type for dark magic

STAFF_TYPE = 10 # The element type for staves

WPNLVL_THRESHOLDS = [0,1,31,71,121,181,251] # The min to move up in wpn lvl. This is another exciting editable feature :D

WPNLVL_LETTERS = ['-','E','D','C','B','A','S'] # The weapon level letters. Add an "SS" if you want FE10 styled wtf-omg levels.

ONE_S_RANK = true # Determines if only one weapon type can reach max. Unfortunately, this affects ALL classes, not just one, though Bwd will likely include a way for one or more specific classes to have multiple S rank weapons while the othe classes only have one.

SUPPORT_TOTAL = 5 # Total number of supports one unit can have. This opens up possibilities!

SUPPORT_LETTERS = ['-','C','B','A'] # The support level letters

ALLOW_UNEQUIP = false # Determines if the player can unequip units' weapons. Now you have FE9/10 style unequips.

FIRST_CLASS_TYPE_ID = 29 # Element ID of the first class type

CLASS_TYPES = 9 # Number of class types (should all follow the first one)

CRIT_MULT = 3 # Multiplier to damage on a critical hit

EFFECT_MULT = 3 # Multiplier to weapon mgt when effective against target

ALTERNATE_EFFECT = {49 => 2} # Element IDs for alternate effective multipliers

CANNOT_SELL_TAG = 50 # Element ID for items that can't be sold

CURSE_RATE = 1 # Chance for cursed weapon to backfire with full luck. Currently it equals 1%. You can modify this.

LOW_HEALTH_RATE = 0.25 # Threshold for low health for AI planning. This is a 25% threshold.

NAME_DELIMITER = '_' # The character used to separate names from versions

MESSAGE_LINES = 3 # The number of lines text boxes have

EMOTION_COUNT = 3 # Default number of emotions for face sprite sheets

BATTLE_EMOTE_COUNT = 4 # Number of emotions for battle faces

FACE_COUNT = 6 # The number of faces that can be onscreen during a dialogue.

FACE_TONE = true # Controls whether screen tones affect face sprites

UNIT_TONE_PERCENT = 50 # Controls the degree to which tone affects units

GENERIC_FACES = true # Determines if generic units have face sprites. This is for the images that you'd normally see for generic enemies in the GBA games.

STATUS_FACE_SIZE = [80, 72] # The size in pixels of faces on the status screen

MINI_FACE_SIZE = [32, 32] # The size in pixels of faces on unit info

BATTLE_FACE_SIZE = [106, 28] # The size in pixels of faces in battle

EYES_FACE_SIZE = [32, 16] # The size in pixels of the eyes block

MOUTH_FACE_SIZE = [32, 16] # The size in pixels of the mouth block

SCREEN_WIDTH = 320 # The width of the screen
SCREEN_HEIGHT = 192 # The height of the screen
###SCREEN_WIDTH = 40*16 # The width of the screen
###SCREEN_HEIGHT = 25*16 # The height of the screen
MAX_SCROLL_SPEED = 64 # the most the screen can scroll in pixels per frame

^Set the default size of the game window, then use the zoom feature to modify the zoom further! :o

WEAPON_TYPE_NAMES = ['', 'Sword', 'Lance', 'Axe', 'Bow',
'Fire', 'Thund', 'Wind', 'Light', 'Dark', 'Staff']
Guns instead of Bows, anyone?

'zoom' => 3,
'frame rate' => 60,
'xp input' => 1,

See that zoom option on line 78? That does NOT affect playtesting, only the actual game file when zipped.

Go to line 136.

# Sets up game zoom
$zoom = (($DEBUG and !$BTEST) ? 2 : settings['zoom'])

Edit that number (I set mine to two, obviously) to something between 1 and 3, preferably. Any bigger and you'd better have a movie theater for a PC screen! (Not to mention not-yet-fixed transitions.

(Take note that the aforementioned tut was not fixed up for the latest FEXP release. Some information might be misplaced or erroneous.)
I really need to fix spoiler tags

Advanced Member
Advanced Member
Joined: Apr 16 2009, 05:56 PM

Jul 29 2011, 04:41 AM #2

How to recolor units!
[+] spoiler
So you want to recolor your units like I have done with Jessica right?

(Note that it is a WIP)

Go to "Recolor List EX" in the scripts section. There, you can easily recolor units. But how is this done?

Open up a new paint image. Go to the edit colors option, and there you will be able to select any hue of colors that you wish. Let's say I choose the color green, like for Jessica's pants.

See the Red Green and Blue box in the second image? Those are the values you need for whatever color you select. Let's look into that Recolor List EX script now.

Code: Select all

    'Bern' => {
        :main1 => [56, 16, 128], # Main color
        :main2 => [80, 32, 160],
        :main3 => [112, 48, 184],
        :main4 => [160, 72, 248],
        :main5 => [208, 144, 224],
        :main6 => [232, 216, 248],
        :scnd1 => [112, 80, 32], # Secondary
        :scnd2 => [200, 152, 32],
        :scnd3 => [248, 216, 56],
        :scnd4 => [248, 240, 136],
        :tert1 => [80, 88, 96], # Tertiary
        :tert2 => [136, 144, 144],
        :tert3 => [192, 200, 200],
        :hair1 => [176, 96, 16], # Hair
        :hair2 => [232, 160, 48],
        :hair3 => [248, 192, 112],
        :flap1 => [184, 144, 32], # General flap/Paladin shield
        :drag1 => [104, 64, 40], # Dragon
        :drag2 => [184, 112, 48],
        :drag3 => [224, 168, 80],
        :drag4 => [232, 208, 152],
        :trim1 => [144, 80, 16], # Trim for Sorc/Wizard/etc
        :trim2 => [240, 160, 48],
        :trim3 => [248, 240, 48],
[+] spoiler
This is what you'll need to edit. All those random numbers are RGB. (Red Green Blue) in that order. Note that what I'm referring to now is the country colors. Whenever you fight a unit that has Bern in the name, their units will all be colored this color by default.

Cool huh?

What about individual characters? Let's use Pent as an example.

Code: Select all

    when '40_0' # Male Mage
      case name
      when 'Pent'
        case color
        when 0; return [80, 48, 120] # Cloak
        when 1; return [136, 88, 192]
        when 2; return [208, 176, 240]
        when 3; return [112, 112, 176] # Shirt
        when 4; return [168, 184, 224]
        when 5; return [200, 224, 232]
        when 6; return [144, 152, 168] # Pants
        when 7; return [224, 224, 232]
        when 8; return [104, 104, 200] # Hair
        when 9; return [160, 192, 248]
        when 'Jessica'
        case color
        when 0; return [0, 0, 98] # Cloak
        when 1; return [0, 0, 119]
        when 2; return [0, 0, 204]
        when 3; return [255, 255, 0] # Shirt
        when 4; return [200, 200, 0]
        when 5; return [111, 224, 12]
        when 6; return [77, 224, 24] # Pants
        when 7; return [20, 231, 47]
        when 8; return [0, 0, 160] # Hair
        when 9; return [0, 0, 125]
[+] spoiler

You can compare Pent to Jessica like so. Pent has a grayish pallette, Jessica's is (currently) Green and Blue. (I will be removing the green because... it looks like crap... >.>)

All you have to do to edit a unit's pallette is follow the easy outlines above and read Bwd's instructions carefully, and modify as desired! Simple!

^This tut has an older picture of Jessica's pallette. I already fixed it up a long time ago.

Advanced Member
Advanced Member
Joined: Apr 16 2009, 05:56 PM

Jul 29 2011, 04:43 AM #3

Visiting Houses! (Recruitment, items, and gold!)
[+] spoiler
All right, I've mentioned this a couple times before, but now it's time to get to the nitty gritty of visiting houses and getting rewards. This is, for the most part, simple. Let's start with a simple diagram to understand where everything is placed.

Here we have the village in TR2 that gives you a Killer Axe.

In the Yellow Circle, you can see the word VISIT. ALWAYS NAME YOUR VILLAGE AND HOUSE EVENTS VISIT. Period. In capital letters.

In the red circle there are 3 pages. The first page is before the village is opened. However, Houses and Villages are different, because Houses only need one page, due them being re-visitable. Red Villages however give you an item then close off. For Villages, page one handles whatever bonuses you get, page two handles the closed village, and page three handles the destroyed village. Always make sure that in the light blue circle below the three graphics represent the proper tiles for Open, Closed, and Destroyed villages.

The Dark Blue Circle is where any events in said village occur. This is the meat of the tutorial, so let's focus on it. In the above picture, you get a killer axe. In this picture...

You get gold. And in this picture...

You get a character. (Roeis)

Let's look at how these are set up.
0, 66, 20|Value OR IF GOLD - 8000|Value OR IF CHARACTER - 18, 12, 14|Value
-1, -2, 3, 3|Area - I DO NOT KNOW WHAT THIS IS FOR
[+] spoiler
|Type determines whether you're handling Weapons/Items, Gold, or a character. 1 = Weapons and Items 2 = Gold and 3 = Character.
Value has three different meanings.

For determining whether an item or a weapon, set the first number to 0 for weapons, and 1 for items.
The next number tells you what item/weapon it is. In this case 66 = Weapon ID for Killer Axe. You can find this inside the Item/Weapon Database
The last number (I think) means number of uses it will have. In this case you get a Killer Axe with 20 uses.

For Determining Gold, this is simple. 2|Type and use ####|Value and you're good to go!

Characters are really easy.

Code: Select all

18, 12, 14|Value
[+] spoiler
3|Type is simple.
18 = Character ID. 12 and 14 are map coordinates. 12 = Horizontal plane and 14 = Vertical plane.

Next comes |Area. I have no idea what this means. If you find out, let me know.
And then text and everything else gets set up here.

And text and such goes here! I hope that helped :D

^This tutorial is probably one of the oldest. I updated it once or twice but the part about how many pages a village has is way off.
This is somewhat antiquated, when you visit an event self switch C is turned on, so you can create a new page with self switch C as a trigger for custom visit events (the events in the Test Map use this to run external conversations, but you could also use it to give different conversations based on who visits, or bring in reinforcements, or other things)

Advanced Member
Advanced Member
Joined: Apr 16 2009, 05:56 PM

Jul 29 2011, 04:45 AM #4

How To Place Units on the Map (4 known techniques)
[+] spoiler
The first thing you need to know is that there are 3 (more?) different event names for a unit. Those are UNIT, ITEM, and BOSS. Setting the name as UNIT is a requirement. This makes it a unit on the field. ITEM is used if you want the last item in their inventory to be droppable. BOSS is for setting a boss. If you have a chapter where the goal is to defeat a boss but you have TWO bosses, you will have to defeat both of them and the goal becomes "Defeat Bosses."

Anyway, this is the first setup you must learn.
<img src='http://i297.photobucket.com/albums/mm21 ... hklok/Fire Emblem - Phoenix Down/ActorSetup.png' border='0' alt='user posted image'>

Code: Select all

1&#124;Actor ID
0&#124;AI Priority
0&#124;AI Mission
[+] spoiler
See the "character" part? That's essential. There are four setups, each is very specific in how they must be set up, or the unit will not load. Period. It won't even be on the map. They are:


But let's keep it simple. Let's start with "character"

Actor ID = Look in the database for the actor's number.

Team = 1 is ally, 2 is enemy, 3 is NPC, and etc.

AI Priority = This allows you to choose what enemy units start first. The higher a number, the higher their priority. If you want a unit to always attack first on every turn, give it something like 999 (A boss for example) and every other unit on the field 998 or less. I recommend that if you ever have Dark Magic users with Eclipse to give them the highest number aside from the boss, because this is actually smart AI. Just trust me on that.

AI Mission = This is pointless for ally units, but useful for enemy characters. Just set their AI according to this list:

Code: Select all

0 = Stand Still &#40;Does not attack. Ever&#41;
1 = Attack in range &#40;Will charge forward and attack if you go within their range&#41;
2 = Seek out and attack &#40;any&#41;
3 = Seek out and attack &#40;weakest&#41;
4 = Pillage &#40;Destroy villages. Crashes current editor version. Wait for next release before using this&#41;
5 = Steal &#40;Enemy thieves and rogues only, obviously&#41;
6 = Go to square &#40;throne capture&#41; This is useful for if Bwd allows enemies to capture thrones.
7 = Staff user &#40;Bwd is revising this. It will include every stave capability in the game, including rescue, warp, etc.&#41;
8 = Seek out unit to talk &#40;Useful for cutscenes, but likely not used in this version.&#41;
9 = Avoid &#40;Want that little thief to rob you and then run? Use this.&#41;
10 = Do Nothing &#40;There has to be a difference between this one and #0, but I'm not sure what... yet.&#41;
11 = Defend square &#40;Not sure.&#41;
12 = Ballista &#40;This is not used yet. Wait for next release&#41;
500 = Do not move. Attack only units within range. &#40;Useful for knights guarding a tile, or a long range magic user you don't want to move. Or a boss &#58;P&#41;
[+] spoiler
Now, if you were making a unit using the "character" type setup, you might need to alter a weapon level or add a weapon to their inventory, and you don't want to fuck around with the scripts. Here's how to do that.
<img src='http://i297.photobucket.com/albums/mm21 ... hklok/Fire Emblem - Phoenix Down/ActorSetupExtra.png' border='0' alt='user posted image'>

Use the "setup_from_character" comment instead. It adds on the ability to modify weapons and weapon levels in addition to setting an actor on the field. This would be most useful (IMO) if you had a recruitable unit that had different items in it's inventory based on conditions and such. I am not positive, but there may be another setup that allows you to edit stats too. Anyway:

Code: Select all

101&#124;Actor ID
0&#124;AI Priority
0&#124;AI Mission
1, 1, 3&#124;Item 2
0, 0, 0&#124;Item 3
0, 0, 0&#124;Item 4
0, 0, 0&#124;Item 5
0, 200, 0, 0, 0, 0, 0, 0, 0, 0&#124;Weapon Levels
[+] spoiler
Now, you might notice it starts from item TWO, not item ONE. If you set an item for item one, it overwrites whatever is there by default. It's perfectly fine if you want to do that sort of thing though. If your character has four weapons by default and you just want to add one or something like that and overwrite nothing at all, just remove whatever item slots are not needed as in the above example.

Weapon levels go like this:
Swords, Axes, Lances, Bows, Fire, Thunder, Wind, Light, and Dark.
And the thresholds for the next rank are...

Next we have setup_from_comment
<img src='http://i297.photobucket.com/albums/mm21 ... hklok/Fire Emblem - Phoenix Down/SetupfromComment.png' border='0' alt='user posted image'>

Code: Select all

39&#124;Class ID
23&#124;HP Max
0&#124;AI Priority
3&#124;AI Mission
0, 132, 30&#124;Item 1
0, 0, 0&#124;Item 2
0, 0, 0&#124;Item 3
0, 0, 0&#124;Item 4
0, 0, 0&#124;Item 5
0, 0, 0, 0, 0, 0, 0, 31, 0, 0&#124;Weapon Levels
[+] spoiler
I'll skip the setup_from_comment part. That's been explained already.
Class ID can be found in the database under the Class tab. Keep in mind that a vast majority have no animations or even map sprites. Use only those you see on Yeti maps.
Gender is simple. 0 = Male, 1 = Female, 2 = Tranny. (:P Just kidding dum dum)
Level is purely for cosmetic effect. Default cap is 20, so don't set it above 20, not that it matters as it won't breach 20.
Exp is always 0 for enemies and NPC's. This might need to be changed for a player unit... but I don't see why, unless you're testing growth rates.
Team has been explained earlier. 1 = Ally, 2 = Enemy, 3 = NPC, and so on. (Bwd actually has 4 teams but the fourth is basically an enemy team anyway.)
Stats are all self explanatory. If you can't figure those out then don't play FE.
Everything else has been outlined, but a brief mention on items.

Code: Select all

0, 132, 30&#124;Item 1
0, 0, 0&#124;Item 2
0, 0, 0&#124;Item 3
0, 0, 0&#124;Item 4
0, 0, 0&#124;Item 5
[+] spoiler
The first number determines whether it's an item or a weapon. 0 = Weapon, 1 = Item. Simple.
The next number is the Weapon/Item ID number. Find it in the database.
The third number is number of uses. I recommend NOT going over the max, though it's doesn't matter, except for cosmetic effect. How many uses a weapon/item has is found in the database.

Lastly is the "setup_generic" unit.
<img src='http://i297.photobucket.com/albums/mm21 ... hklok/Fire Emblem - Phoenix Down/SetupGeneric.png' border='0' alt='user posted image'>

This one is one of my favorites. I love Bwd for implementing this. It is essentially the same as the setup_from_comment unit, except that when you are going to type in stats, you just use the "prepromote level" line and type in any number from 1-9999!

Setup_from_comment is still my number one favorite though for balancing maps :P

This one should be pretty up to date. I don't think I elaborated on Build Types enough, but if requested I can do so.
Mission stuff is a bit inaccurate and AI priority only controls the order in the status screen. I"ll elaborate a bit eventually

Advanced Member
Advanced Member
Joined: Apr 19 2011, 11:26 PM

Jul 29 2011, 05:41 AM #5

They are of some help. :/

At least something productive came of his keeping FEXP right?

Hopefully you didn't not want me to post in this.

Joined: Jul 20 2015, 12:49 AM

Sep 21 2015, 04:01 AM #6

Hey, I know that FEXP isn't supported anymore, and this thread is really old but...
Could someone please tell me how to get supply to work? I see the max items in supply thing and I got the sprites for transporter but I can't use supply on it...
Is there a place where I configure supply and which classes can use it? Please help :D