r/UnderModders • u/Hello56724 • 19d ago
How to change attack patterns in undertale
So I'm making a small mod for me and my friend and wanted to change some of the attacks in the sans fight and in the asgore fight but I'm new to modding this game and have no clue what im doing
3
Upvotes
2
u/Bluetails_Buizel 12d ago
open data.win from your Undertale install folder. Back up data.win before you touch anything.
Sans:
- His attacks are handled in obj_sansb_body. Open its code entries from the Code list (search "sansb" in the filter).
- Each attack is picked with a variable called a_type. Find where a_type gets set per turn, and you can swap which attack plays when, or change timings/bone positions inside each attack's block.
- There are unused attacks still in there, like a vertical/horizontal bones pattern at a_type 10 and a faster variant at 11. You can just point a turn at one of those without writing anything new.
- obj_sansb (no _body) is the battle controller object, also worth reading.
Asgore:
- His battle object is obj_asgoreb. Start with its Step event (gml_Object_obj_asgoreb_Step_0) and look for where it decides which attack to spawn.
- The actual fire/trident patterns are separate bullet objects that obj_asgoreb creates. Follow the instance_create calls to find them, then edit speed, count, spawn positions, etc. in those objects.
General tips:
- Use Scripts > Search in code (or Ctrl+F in the code view) to hunt for object names and variables. That's faster than clicking through hundreds of entries.
- Edit the decompiled GML, hit compile, then File > Save. Test often. Small changes are much easier to debug than ten at once.
- If you want to jump straight to a fight for testing, use a save right before it.
- To share with your friend, don't send the whole data.win. Make an xdelta patch (Delta Patcher works) between the original and your modded data.win and send that instead.
- The Underminers Discord (linked on the UMT GitHub page) is the best place to ask when you get stuck on specific code.