Vesly's ASM

Very epic sauce as usual.

1 Like

Wait AI

(Found inside the ExpandAI folder.)

Ever wanted stationary AI to trigger range/always events?
Well, this let’s you do that.

For your convenience, it also writes the active unit’s coordinates to memory slot B and their unit ID to memory slot 2 right before running your events.

It is a very simple hack but took a little while to figure out via trial and error.
All we do is call this function as your AI1 or AI2.
AiSetDecision(int xPos, int yPos, int actionId, int targetId, int itemSlot, int xPos2, int yPos2);
And we put your xPos and yPos to your current location and set the actionId to 5.
Why 5? I don’t really know, but it makes them wait.
This hack touches nothing inline and should not conflict with anything.

Note that AI1 takes precedence over AI2, so you can easily do something like AI1 - ActInRange (0x00), AI2 - WaitAI.


If you’re using febuilder, select AdvancedMenu->Insert EA and select WaitAI.event.
Then open the .sym file and paste the given address into an AI1 or AI2 slot and hit write to rom.




Modular Summon


What it do?

  • Give summons to units/classes that meet the level req

  • then when they summon, it loads the units you specify nearby

  • includes AI so the enemy can summon, too. (ApproachEnemySummonAI and RunAwaySummonAI: note that I’ve set the approach enemy one to only summon if they can summon 50% or more of their group of summons. This way they’ll attack if they can only summon a minority of the unit group.)

  • you can also summon them in formations for coolness factor (if there’s stuff in the way then it’ll do its best to adapt)

  • fixed position mode summons to the coords you specify in the unit load, or nearby if units are in the way

  • relative position mode summons relative to where you could walk from

  • if a unit is entirely surrounded by walls and tries to summon relative to them, it will place the summoned unit at a totally random valid coord. If you want locked up enemies to summon, just use fixed coords mode tbh. Unless you really want random coords I guess (5)

  • optionally have the summons scale based on your level
  • optionally have the summons keep stats & level up between chapters (unless they die)

This is by far my most complex hack that I’ve written to date. AI scary, haha. I have tested it pretty extensively for bugs, though.



Prevent Attacking

This hooks 0x8024eac ForEachUnitInRange to prevent the player from attacking/targeting units by character id, class id, or enabled flag. Please note that this does not effect counter-attacks at all. (Give the enemy an item with the uncounterable bitflag if you want that behaviour.)


  • Prevent the player from attacking O’Neil
  • Prevent the player from attacking Paladins
  • Prevent the player from attacking while flag 0x8 is on


(I think the AI uses 0x803ac3c CouldStationaryUnitBeInRangeHeuristic, which I have not touched, so this doesn’t effect AI.)

It is compatible with skill sys.


Turns out the original version also prevents trading/rescuing/etc., so I made a 2nd version just now that instead hooks 802517c AddUnitToTargetListIfNotAllied such that it only prevents attacking.




As part of modular summon I had to figure out a way to autolevel units but be easily compatible with febuilder & str/mag split without needing you to re-install skill sys or anything like that.

So here’s AutoLvlUnit now as a standalone ASMC.

Compatible with skill sys

It can also have levels be invisible, akin to hard mode bonus levels.


Item Special Effect


Inspired by @Myi64’s request and 7743’s “Special Effect Per Unit”, this lets you attach an event to an item. Note that on certain items, the regular “use” command will still appear, so you might want to name this something different like “Special”, for example.

Important: This is not the regular “Use” command. This is an additional command being added that is also called “Use”. Below I called it “Sword” because the regular “Use” command also shows up for this item.


You’ll need to uncomment this part if you want it to take over your item menu:

My example event is just showing text, but since you’re running the event engine, I think it should be pretty convenient and flexible. Enjoy!

Note that the colour of text in the item menu is based on the real use/equip options. If you want it to not show up as greyed out, then I think it needs to also be usable or equippable.

This should not conflict with anything & is compatible with skill systems.


I think this patch has an interesting point of view, but I think it lacks functionality.

There is no function to dynamically change the menu name.
In the patch I made for the unit, there is a function to change the menu item name dynamically.
I don’t always want to use the name Use, so there should be a feature in the settings to change it for each item.

It is not good to always Wait after using an item, as it reduces convenience.
It should be selectable by the user.

It is not possible to set the conditions under which an item can be used.
For example, there may be cases where you need a condition to use the item, such as when you are low on HP, or when you have friends who are low on HP, or when there are enemies around.
Vanilla items have a variety of conditions for use.
It would be hard to cover all of these, but I think it would be better to support the most commonly used features.
This is because these are difficult to represent with flags.
It would be more convenient to add method and args arguments to the structure.

3 is difficult to implement, so I think you should solve 1-2 first.

1 Like


AoE (10)


I think maybe you can try to port the lightning that I previously released here. To make things coooooooooooler. XP


Area of Effect (AoE)


I have added support for the vanilla rocks animation, as above. But additional animations are up to the user for now. If we as a community figure out more map animations, I would like to include them in this.

There are many config options.




MagBased (for StrMag users)

Of course, you can also choose the animation, event, and/or sound to happen as part of an AoE attack. I’ve set up a few basic cases for the rocks animation, and written asm to search for where to start displaying the animation (as it does not originate from your selection).

POIN RocksEvent_MiddleVertical

You can also decide on the range mask (the area effected).

BYTE 3 3 // Size (1-indexed, so this is a 3x3y array) 
BYTE 1 1 // Center (0-indexed as coordinates, so [1,1] is the center)

BYTE 1 0 1
BYTE 0 1 0 
BYTE 1 0 1 

This is a small X, for example.

This should not conflict with anything that I’m aware of. It hooks these two addresses in order to display purple tiles instead of blue ones: $1DA98 and $1D9DC.

Febuilder users please note that you should update to the latest febuilder version before installing this for it to recognize your SkillTester. Also note that this is also compatible with vanilla, as it will simply skip the SkillTester in that case.

With thanks to: StanH, Mokha, Huichelaar, Teraspark, Pikmin1211, Sme, 7743, Snek, and anyone else who answers my questions, suggests reference files, or shares code snippets.



This is really cool ASM Vesly, well done!

1 Like

AoE rotations

Added the ability to rotate the area of effect. Also made it preview range display while hovering over a command.


Now do frontals : D

(Basically 1 range aoe with forced rotation)

Nice! This is huge!

These are cool i guess but i don’t really want to make them, sorry. I think you might be able to change it to be frontals only, but i think it’d be annoying to make it play nicely with how i’ve set it up as a config option.

On another note, I made bracketed level ups! Pending feedback from pokemblem playtesters, I might merge it with skillsys github.

Eg. Units with Str 3 levels below average will always gain that stat. And units with +5 Str above average will never gain the stat. (These numbers are configurable.)


Dmg Calc (Spreadsheet)

Given Char, Class, and Item for each side, this calculates the damage dealt.

image image image

Most importantly, you can link your tables to it so that it will automatically update whenever you open the document.

Auto updating

You may need to adjust your macro security to have it automatically update from your other spreadsheets.

You can also paste in your own definitions (I’m assuming they aren’t already CSVs lol).


Of course, it is missing stuff like Support Bonuses and Skills, but whatever lol.

I will be using this to quickly simulate battles without having to play the game! Maybe someone else will find it useful, too. Enjoy!


I calculate I can beat 500 geese in a fist fight (they have no fists) and I didn’t even need a calculator to work that out.


Draw Sprite Animation

  • Displays an animation up to 64x64 pixels & 16 colours per frame
  • Callable as an ASMC - simply give it map coordinates
  • Can occur during battles (when regular animations are turned off)
  • Also displays damage dealt during battle (with anims off)
  • Usable for my cool AoE hack!

Original art used:
Spell animation spritesheets |
More Pixelated Attack/Hit Animations |
Credits: Viktor Hahn (12)

Formatted some defaults to use, as I know most people are lazy and won’t bother making their own.




Edit: It now works properly against the edges of the map

Another edit:
Default animations are now exactly 28 frames, which is the length that vanilla pauses here. Some of the above gifs might be 30-40 frames long animations, which felt off to people.

Thanks to 7743’s efforts, this is now an febuilder patch! Enjoy. (13)


I have added the functionality for #1 now - you can set a text id per table entry, rather than calling everything “use” or “special”.

I think for #2, you should just use Teq’s UNCR patch. If you use SET_ACTIVE 0, then UNCR((-1), 0x42), then they will be able to act again. I don’t think #3 is necessary. I think that those sorts of usability routines are better left up to the user who knows asm than to give them just a couple of options like only being able to use it at low hp or with a certain wexp level. But maybe in the future it could be added, I guess.

I’ve also now hooked vanilla to prevent text from showing up as greyed out if it was on an item that you couldn’t use in the item menu. This does not conflict with skill systems, but for the two people who use the EquippableAccessories hack, it probably conflicts with that.



I have a bug to report.
If I select Use(Sword) in ItemSpecialEffect when the item’s durability is 1, the event is not executed and the item freezes.
Looking at it in the debugger, I think there is something wrong with the timing of clearing the item, as the problem occurs after exiting this routine.

1 Like