Vesly's ASM

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.)

Eg.

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

IFS8icW6Po

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

It is compatible with skill sys.

Enjoy!

Edit:
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.

6 Likes

AutoLvlUnit

G8s4OCF3zV

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.

7 Likes

Item Special Effect

P8jOZEitbs

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.

ALG0LX4kR2

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

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.

8 Likes

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

Soon…

AoE

ezgif.com-gif-maker (10)

10 Likes

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

5 Likes

Area of Effect (AoE)

67B7WWvLuI

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.

Usability:

Unit
Class
Level
Item
Flag
Skill

Options:

HpCost
Heal
FriendlyFire
FixedDamage
MagBased (for StrMag users)
HitRes
DepleteItem
UsableOnlyIfStationary
PowerLowerBound
PowerUpperBound
MinRange
MaxRange
RangeMask
Animation_ID

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).

ALIGN 4
RangeTemplateTable_SmallX:
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.

Enjoy.

18 Likes

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.

11 Likes

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.)

3 Likes

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).

image

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!

11 Likes

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.

4 Likes

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 | OpenGameArt.org
More Pixelated Attack/Hit Animations | OpenGameArt.org
Credits: Viktor Hahn

ezgif.com-gif-maker (12)

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

JTHwPQL9km

3wx5TyKilY

VbzI5QSc31

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.

ezgif.com-gif-maker (13)

17 Likes

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.

qOv2L1w0kr

3 Likes

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

Thanks. Fixed this & added restrictions by character, class, and hp %. Eg. you must be 66% hp or lower to use the item.

can you put a readme on how to use the asm, that’d be really helpful

What are you having trouble with?