Snake's Pit of ASM (and Other Stuff)

I like how I’m just now seeing this awesome post.

But hey this whole fun idea of actually using the stairs and anima having triangle advantage just goes to show that the GBA has some really fun advantages of just making it even better than before.

I be all for it to see it being ported to FE7, wouldn’t matter how long it takes. If its possible than woohoo!

2 Likes

Please please please please please?

I made something similar to this by using events years ago in Eliwood’s Tale, but having the real deal would be amazing.

5 Likes

Adds to list of ASM things to do.
It shouldn’t be too difficult to pull off. I can have the FE7 version done fairly soon.

1 Like

So, considering that StairASM is not FE7, does that mean none of the others are FE7 either?

Well this is a coincidence, because I come bearing FE7 stairs.

Assume everything is for FE8 (though if you need something for FE7, I’d probably be happy to adapt it. :slightly_smiling_face:)

Anyway, FE7 stairs work very similarly to FE8 stairs...

I suppose I can safely assume we won’t need to worry about interference with any skill system.
Firstly, this assumes that you have the following defined.

## StairNameText
Stairs[X]
## StairDescText
Take the stairs[NL]
to the other side.[X]
## StairsBlockedText
The stairs are blocked[NL]
from the other side.[X]

Next, the action menu. Assuming you haven’t already screwed with it, this is handled with “FE7 Unit Menu.csv”. If PFinder doesn’t work (which it never does for me), here’s where you need to repoint.

//Repoint Unit Menu
PUSH
ORG $B95Ab4
POIN UnitMenuTable
POP

Then, just #include “Stairs.event”.

Using the stairs is exactly the same in FE8.

#define Stairs(StairID,X1,Y1,X2,Y2) "LOCA StairID [X1,Y1] 0x22 ; LOCA StairID [X2,Y2] 0x22"

Don’t reuse StairIDs. X1 and Y1 are the coordinates of one end of the stairs. X2 and Y2 are, big surprise, the coordinates of the stairs on the other end. This macro command goes under location events.

Let me know if you encounter any problems, something needs clarification, or if I forgot something.

1 Like

Portrait Selection

Remember when I had this in the OP?

Conditionally Loading Portraits

As in, load this portrait if event ID X is triggered. Load this one if not.

Okay. I can’t provide a download for this one. I wrote this for Legends of Avenir (shameless self-promotion lol), but the ASM would be so dependent on your needs (event IDs to check, number of event IDs to check, text control code, etc. ) that any source I post would be useless except as documentation. If you’re interested, find me on Discord and I’ll help you out.


:disappointed: That’s pretty dumb, so I made a version that is not hardcoded and is hopefully easy to use.

How to: Teach your characters to consider event IDs before showing their ugly faces.

Simply include “PortraitSelectionASM.event” found in the Dropbox folder.
If you’re using the Skill System, uncomment then installer in _MasterHackInstaller.event.
You’ll see the following when you enter the installer file in the container ASM folder:

PortraitSelectionTable:
SHORT 0x0 0x0 0x0 0x0 0x0 0x0

Now you need to fill out the Portrait Selection Table. All this does is it relates a control code, mugs to potentially show, and a list of event IDs to check. Use the macro, PortraitSelectionEntry, to fill this out. For example…

PortraitSelectionTable:
PortraitSelectionEntry(GoodFaceID,BadFaceID,Face1List,0xE0E0)
SHORT 0x0 0x0 0x0 0x0 0x0 0x0
Face1List:
BYTE 0x6E True  0x11 True  0x00 0x00

How will this be interpreted by my function? Any time that 0xE0E0 as the control code is detected, it will load GoodFaceID if both event IDs 0x6E and 0x11 return true. Otherwise, BadFaceID will be loaded.
Each unique event ID list that you make can be as long as you like. Each one to check should have the event ID followed by whether you want it to be true or false. This list must also terminate with 0x00 0x00.

PortraitSelectionTable:
PortraitSelectionEntry(GoodFaceID,0x00,Face1List,0xE0E0)
PortraitSelectionEntry(NeutralFaceID,BadFaceID,Face2List,0xE0E0)
PortraitSelectionEntry(SomeOtherPortrait,SomeOtherOtherPortrait,Face3List,0xF0F0)
... // Other control codes and stuff idk
SHORT 0x0 0x0 0x0 0x0 0x0 0x0
Face1List:
BYTE 0x6E True  0x11 True  0x00 0x00
Face2List:
BYTE 0x6E False 0x11 True  0x00 0x00
Face3List:
BYTE 0x72 True  0x21 True  0x14 False 0x00 0x00

You can have as many entries and different control codes in the Portrait Selection Table as you like, and control codes CAN repeat. If you put 0x00 in the FalsePortraitID slot, then upon returning false, my function will continue checking the list for valid portraits to load instead of trying to load a false one.
This previous example will check Face1List upon hitting 0xE0E0. If Both 0x6E and 0x11 are true, then it will load GoodFaceID. Otherwise, it will proceed down the list because the false (or else, if you prefer) entry was 0x00. It tries the next entry, and if it finds 0x6E to be false and 0x11 to be true, then it loads NeutralFaceID. Otherwise, it loads BadFaceID.

It may be more intuitive to think of this as…

PortraitSelectionEntry(IfTruePortrait,ElsePortrait...)

In case you’re wondering about the control codes themselves, they’re arbitrary shorts. You don’t need to do anything extra to use them except use them in the Portrait Selection Table. To my knowledge, you should not use 0xFFFF (since that’s for loading the current character’s), and you should not use 0x01XX or 0x02XX (since that’s used to normally loading portraits). Just go ahead and [LoadFace][0xE0][0xE0] (in my case, at least) away.

As always, I’d be happy to clarify something, and let me know if you encounter any issues!

4 Likes

Okay then. Would you be able to convert the Anima Magic Triangle to FE7? I want to use it in a mod I’m doing.

This has some pretty great stuff.

I ought to learn how to ASM as well one of these days

1 Like

Sure. I’m not sure when I may get around to it, but I’ll definitely add it to my to-do list.

1 Like

Modular EXP
This replaces what was Double EXP, which was extremely limited.

What does this do for you? You can define a multiplier or a divisor for EXP based on many conditions, including character, class, enemy’s class, weapon wielded, chapter, and event ID.

How to: Make EXP bend to your will

Firstly, include “ModularEXP.event.”
If you’re using the Skill System, instead uncomment the installer in _MasterHackInstaller.event.

ALIGN 4
#define ModularEXPEntry(Character,Chapter,EventID,Multiplier,Divisor) "BYTE Character Chapter EventID Multiplier Divisor 0x00 0x00 0x00"
ModularEXPChapterTable:
ModularEXPEntry(0,0,0,0,0)

Within that file, you’ll see something that looks like this.

This table is how you will control EXP by chapter, character, and event ID. For each entry of this table, go ahead and fill those out like so, and specify how much you would like to mulyiply and divide by.
For example…

ModularEXPChapterTable:
ModularEXPEntry(Franz,Chapter2,0x00,2,1)
ModularEXPEntry(Ephraim,Chapter8,0x00,1,2)
ModularEXPEntry(Colm,Chapter4,0x12,3,1)
ModularEXPEntry(Seth,0xFF,0x00,2,3)
ModularEXPEntry(0xFF,Chapter5,2,1)
ModularEXPEntry(0,0,0,0,0)

Here we have an example usage.
The first entry will give Franz doubled EXP in chapter 2.
The second will give Ephraim halved EXP in chapter 8
The third will give Colm tripled EXP in chapter 4 only when event ID 0x12 is set,
The fourth will give seth two-thirds EXP in all chapters.
The fifth will give all units doubled EXP in chapter 5.
The last entry is simply a terminator.

Note that you CAN use fractions by multiplying and dividing together, and also remember that multiplying or dividing by 1 will have no effect.

That was part 1, the second part is a csv that’s indexed by class ID. Go ahead and incorporate Modular EXP Class Table.csv and it’s .nmm.

The first and second columns are the class multipliers and divisors these will always apply. Have a class that’s gaining too much EXP? Add a correctional multiplier and/or divisor.

The next 2 columns are the granting multipliers and divisors. These are the same thing as before except they apply when they grant EXP. If you want enemy soldiers to grant more EXP from combat, for example, add a multiplier here.

The rest of the columns are for weapon types. These will apply when this class is using this weapon type, and they do stack with all other multipliers and divisors. Want great knights to have 4/5 EXP when using axes for some reason? Just apply those to this part.

That’s it. Let me know of course if you find any bugs or problems of if you have any suggestions.

Some other notes

EXP per combat cannot exceed 100 EXP because of level up shenanigans. This routine will cap all EXP gains to 100.

Do not divide by 0. This should go without saying, but I accidentally did it during testing. Bad things happen. :stuck_out_tongue_closed_eyes:

9 Likes

Poison Rework
Tired of how inconsequential poison is? This should allow you to both define it how you wish and make it more meaningful.

This ASM does three things.

  1. Poison applied is additive. This means that any poison applied stacks with any poison that the unit previously had. For example, if a unit has 2 poison and is hit with a weapon that applies 4, the unit will then have 6 poison.
  2. The damage that poison deals each turn equals how much poison the unit has before ticking down. If a unit has 7 poison, it will take 7 damage, then the next turn it will take 6, and so on.
  3. You can define how much poison each weapon should apply including how much poison gas traps apply in each chapter)
How to: Make poison actually do something. I know. Crazy, right?

Again, no installer is necessary. Just download the folder in the Dropbox and use:

ALIGN 4
#inctext lyn "PoisonRework/PoisonRework.elf" "PoisonRework/Hooks.elf"

Secondly, you’ll also need to incorporate both the Poison Rework Gas Trap Table and the Set Poison Item Table with your csvs. The former is indexed by chapter. It just tells the routine how much poison to apply from gas traps in each chapter. The latter table is indexed by item and tells the routine how much poison to apply per item. You still must use the poison weapon effect in the item table normally for an item to apply poison.

That’s it. The only other thing is that poison will max out at 15 due to RAM space restrictions.

Now go and spread your lethal poison to all corners of Magvel! (or whatever)

7 Likes

Make poison great again.

5 Likes

I feel like Poison should increment after DoT ticks instead of decrement. Or there should be at least a separate Poison that does do that if you feel like there’s a poison that is naturally able to be recovered from without an antidote.

Otherwise, I would think you’d get sicker and weaker if it’s left alone to ravage your body. Plus it makes it waaaay more dangerous. (Bonus points if you can make it so Poisoned units cannot have their HP healed.)

Outside of that, this is super neat.

2 Likes

2 updates:

Fixed a bug in Poison Rework where it would sometimes apply 0 poison and forever deal 0 damage each turn.

I’ve also almost completely overhauled Level Up ASM (no empy level ups) because that shit was BAD. I’ve fixed a bunch of minute bugs in it and heavily optimized it. It still conflicts with the skill system, but I’m planning on fixing that in all of my projects at the same time soon.

Also I haven’t forgotten about this. I’ve just been super busy lately. Are you still wanting this, @chronoquairium ?

2 Likes

Yeah, I’m still hoping for that.

FE7 Anima Triangle
FE7%20Anima
Let’s pretend Fimbulvetr is a wind spell.

Same installation as before. Just use the files in “FE7AnimaTriangle” instead.

#inctext lyn "FE7AnimaTriangle/AnimaTriangle.elf" "FE7AnimaTriangle/Definitions.elf"
FireList:
BYTE (List of fire tomes terminated with 0x00)
ThunderList:
BYTE (List of thunder tomes terminated with 0x00)
WindList:
BYTE (List of wind tomes terminated with 0x00)
4 Likes

Curious question but could this be done across the board for all tomes to have its own internal triangle on top of standard?

triangleseverywhere

4 Likes

Is the Anima Triangle ASM supposed to clash with the Skill System Patch?

I patched both of them into a clean FE8 rom, but then when I tried to test the new rom, VBA got softlocked because the initial Seth vs. Valter cutscene wouldn’t start (and even if I removed it, trying to start any combat would just softlock the game) and no$gba just crashed.

I tried to patch them both in different orders, but it doesn’t change anything.

Both patches seem to work properly on their own, but combining them seems to just fuck up the rom, which I’m not sure is supposed to happen, since FEBuilder doesn’t list them as conflicting patches and because I’ve seen hacks with both Skill System and Anima Triangle in place.

1 Like

I believe- actually I know that Anima Triangle conflicts with the somewhat recent skill addition, Tri-Adept. You should be able to get around this by not installing that skill. This is another conflict that I need to handle.

Could you elaborate on this?