Vesly's ASM

This ASM changed my life and saved my marriage. Thanks again, Vesly!

1 Like

Are you sure it didn’t change your marriage and save your life? :flushed:

Let me check.

.

.

.

Yes. Wait, no. Now I’m not.

1 Like

GetTargetCoords simply returns the coords of the unit you’re targetting / acting upon. GetTargetUnitID acts similarly.

I am talking to Seth, who is deployment ID 1. This gives you their coords/unit ID.

image

mGBA_CNLYPiYpWC

It is a pretty simple hack. Might be useful for if you have multiple enemies with the same unit ID.

2 Likes

faster poison

vanilla speed (124 frames)
mGBA_Sse4PxOv5l

speed i put (45 frames)
mGBA_xYOzdUkCw2

ORG $9A50AE // from this proc 9A508C 
BYTE 30 // default 50 Frames to wait during poison anim before hp drains 
ORG $9A50BE 
BYTE 15 // default 30 frames before hp bar disappears 
ORG $9A50CE 
BYTE 5 // default 44 frames to wait before going to the next unit 
9 Likes

Icon Display

Based on a list that checks for unit ID, class ID, flag ID, and chapter ID, this flashes an 8x8 icon on matching unit(s).

Using No$gba you can see which tile is which.
image

(This is 0x76.)

You can edit the system icon sheet as desired, although it is a bit crowded already.

You could have multiple unit IDs you must defend, or show the leader of the green NPCs with a special icon, or alert the player to demibosses, etc.

mGBA_e2l7VNm3Yv

Enjoy.

18 Likes

It’s that some kind of system icon patch update? How can I get access to that ?

You can wait and see if 7743 adds it as an febuilder patch, or use Insert EA to install it yourself.

If enough people ask for it to be a patch, then 7743 often adds it.

1 Like

Movement Calc Loop

Dig Effect

After attacking, you’ll appear next to the enemy.

Knockback

When attacking, you’ll knock the enemy backwards.

mGBA_wVGovuVYCp

These effects are tied to weapons. I think they look best with uncounterable/dazzle weapons.

Edit: added 3 more, as suggested by Devvy/Contro/Epicer

Pull Back

mGBA_Q7C6WGTwI2

Pivot

mGBA_dLBpDB1Thr

Hit and Run

mGBA_ycQ7L6JWRI

16 Likes

This is super cool - do skills that move enemies still work on units w/ boss AI / never move?

1 Like

That’s an easy change. Added a few lines to make knockback / pullback not do anything to units with ai4 that includes 0x20.

If any enemy has ai4 of 0x20 and has a weapon that moves after attacking (eg. hit and run), it will still move. Don’t give it the movement weapons to stationary bosses if you don’t want this behaviour lol :sweat_smile:

2 Likes

Cool stuff - thanks!

Generate Map

Given .tmx files for each map piece you want to place randomly onto the map, this places them randomly when the map is loaded.

It has a border of grass around each thing it places to avoid blocking units.

For example, @RandomWizard made this cliff (and all the rest):
image

Which gets placed on this map at random when starting the chapter:

mGBA_r9NQnyu2bQ

This is done entirely in game. Each time you restart or resume a chapter, it is remade. You could save the map via EMS if you didn’t want this, or maybe I’ll seed the randomly generated map in the future to make suspend+resume not create a new one, lol.
generate map

I don’t really expect anyone to use this and it was just for fun, but I thought someone might get a kick out of it in any case, so here it is! :slight_smile:

Also credits to N426, Zoramine, and Venno for the updated village tileset I used here.

16 Likes

Hey. I wanted to ask if you could make it so that the special effect can also be used on the world map and preparations screen. Currently, you can’t, because the Use menu is greyed out.

Not possible, as the event proc is blocked by stuff like the preparations screen. Sorry. You cannot run events during prep, as these events will be paused until the prep screen is done.

If events weren’t blocked during prep, then the rest of your start event would immediately occur and turn 1 of player phase would start.

Allegiance Palette

When X flag is on in chapter ID Y, sprites for Z allegiance will use the given palette.

By default, I’ve set it up so that flag ID 0x25 turns players into the enemy palette and flag 0x26 turns enemies into the player palette. Setting the flag will not automatically refresh the palette. While it is updated frequently, you can immediately call ASMC 0x8026629 to update palettes anytime.

mGBA_1O4SQts8aQ

You could also use this to have units use a darker palette for a nighttime map, for example.

image
I’m no artist, so you’ll have to figure out your own custom palettes, lol.

Enjoy!

16 Likes

Generate Mines

Whenever you select somewhere to walk to, mines will spawn at random on traversable tiles. They are deleted after you move somewhere such that it will almost never hit enemies.

They spawn at a rate of X% of tiles in the map. I put it to only 2% here, for which this hack was made: Feature (Not a Bug)
It is pretty annoying at 2%, so I don’t recommend much higher.

FEBuilderGBA_c8XFS1AWlK

This is more of an unquality of life feature, and probably won’t be enjoyed, lol.

Nonetheless, enjoy!

4 Likes

GroupAI v2

PhantomSentine’s GroupAI made it so if you attack or are attacked by a unit that is part of a group (using AI4 for groups), it would aggro all of them.

However, this doesn’t stop you from abusing the AI. You could still lure or split up enemies and nothing would aggro until you or the opponent attacked.

Therefore, I’ve hooked AiSetDecision just after FillAiDangerMap is done and coordinates are decided on to see if the Ai will walk somewhere dangerous, and if so, aggro the group. This makes group AI a bit more aggressive and seemingly more coordinated. Previously, one unit from the group would usually charge ahead “Leeroy Jenkins” style while the rest of the party would follow next turn.

You may also want to consider your ai3 settings and whether they have a penalty to avoid dangerous tiles, unlike one of the defaults below:

Zoning ai is also worth a mention here.

Additionally I fixed a small bug in GroupAI: error handling for lack of unit added (it had a very miniscule chance of game crashes etc.)

6 Likes

Is this game crashing bug present in vanilla or GroupAI 1?

The bug was in group ai. Vanilla does not have group ai: it has leader ai, which only stops units from attacking unless a unit is in range of the commander. Group ai leaves the leader ai untouched.

1 Like