Scarlet Vixen Posted March 11, 2023 Share Posted March 11, 2023 (edited) Sorry to everyone that my first post is a question like this, but I've been trying to track down any help I could on how to do scripted battles using FEBuilder and I just can't find anything! I swear! Everything I've found looks like its for Event Assembler or something, but I'm such a novice that I couldn't even figure these guides out... Like this one! It looks useful but I have no idea how to use it, can't make sense of it... Everything I've found is similar to that, and I think, pre-FEbuilder. I've tried to include two images in the spoiler tab. It should be data for two iconic battles from FE7. I'm afraid to mess with these things honestly. They look as dangerous to mess with as the dang Cloak data! I have at least confirmed for myself that the address stays the same even if I change the damage to something, and I can use the same address in another fight and then the same damage happens. What I was trying to do was get a scripted battle between the Fire Dragon and another unit. No idea how to get that working. I think I'll cut the idea and just play a sound effect. But I have no idea if toggling the addresses up and down and changing values on that is even *safe*, let alone logical. I have no idea how these battle event addresses work or what they're storing, or how to safely make my own. I'm sure this thing is old hat to proper ROMhackers, but since I'm just playing with someone else's software... well I've been at this *one* thing for I think twelve hours and I am just dying to ask for the experience of prior users... Spoiler UPDATES: Hopefully this information will be of help to someone else. Perhaps I've even answered my own question. I will share what I've learned since posting and hopefully not only will the answers be useful but so will the process by which I got them! First of all, I'm working with Fire Emblem 7, not FE8, and FE8 is the community standard. So there's my first problem, if scripted battles are different in FE8, then FEBuilder probably shows them different in FE8, but, I'll have to pass on that since it is irrelevant and the reader likely knows more than I do! Perhaps FEBuilder handles them better for FE8. But as for FE7, I've come to learn that the pointer I was getting confused over is indeed *very* specific to the fight, and FEBuilder doesn't seem to offer a way to make your own or even make sense of them. Without a doubt, Event Assembler seems to be the way to go. So if someone without experience wants a quick way to use FEBuilder, get scripted battles working, and learn on the fly, here's what I did: I learn best by studying real working examples, so I needed to see what an entire event looks like to a proper ROMhacker. It wouldn't matter learning Event Assembler if I couldn't Disassemble first, and I found the guide that teaches that! Here it is! This taught me how to use Disassembler and grab the Event in question, including the fight between Athos and Nergal--exactly what I need to study. I can do this with JaffarvsLeila too. In this spoiler I'll explain more, but at this stage more advanced hackers know what's coming. Spoiler Specifically here in the guide is my "ah ha!" moment. I thought I needed a specific Text file. You don't, you create any txt file you want and just pop it in there--because the *intent* is for that txt file to *turn into* the thing the disassembler is making for you. In this picture, that proloque.txt is currently blank, and will soon be filled and replaced with the contents of offset CA0720, and hey I know what that is! That's the address/pointer thingy for Events! When I was only using FEBuilder, I thought offset shouldn't be touched or messed with, but it is critical. The offset needs to be the address I wanna grab, I was just thrown off because I did not know what an offset was (I probably still don't?) In this case all Event addresses will be offsets I guess, but they're not synonyms. FE Events are all offset by 4 bytes (I hope that's right), and thus all Event addresses are offset by 4? And I think the word offset is more important to hackers who are comfortable using HxD and understand Hex more than I do, the word offset must be more useful and descriptive than using words like Pointer or Address, because the offset tells you precisely where in the vast binary code of the ROM something is. And here is my attempt! It worked! In my case I named the txt file the same thing as the event I was disassembling, just so I remember what event I'm studying. I have the offset in there, set it to end code so I only study this event (I think...), and disassemble gave me what I needed! Thank you ReadMe2.txt, for linking to the page that explains disassembler... I missed it the first time I went through these. Once I had disassembler figured out I was able to produce this: Ahhh, here we go! So *this* is what proper ROMhacker's are looking at, and reading and writing in, when doing this! I feel embarrassed but I can finally start opening up my options. So anyone wanting to do what I'm doing in FE7, all you have to do is use Event Assembler to disassemble the nearly completed Event you are working on, with the only thing missing being your dramatic scripted battle. Disassemble that event, then you'll have your code, you go to where the fight will go, and using Arch's guide here (and I'll spoiler an image of the pertinent section), you can code your scripted battle, save, and then you *should* be able to assemble it safely into the ROM! The I posted earlier from Pikmin1211 is for FE8, so it does not work for FE7!! Spoiler This was selected from this post in Arch's masterpost. I apologize if the code is outdated. Thank you reader for your patience!! Edited March 14, 2023 by Scarlet Vixen new information Quote Link to comment Share on other sites More sharing options...
Scarlet Vixen Posted March 14, 2023 Author Share Posted March 14, 2023 Alright, so I THINK it's okay to double-post if it's for a good and clearly helpful reason. I'm going to try and answer my own question starting from the top! Okay so say you're like me and don't know what you're doing, but, you have FEBuilder, which comes with Event Assembler, but you haven't used that yet. You've noticed that in FEBuilder custom battles seem kind of arcane. I'm using FE7, you're probably using FE8 which will look different but our guides cover both so we're good. It's just important to know the systems are different. First, we need pointers for the scripting for our fight! In FEBuilder we can find and kidnap code for fights but FEBuilder won't tell us much. It tells us a pointer and not much else. To make a fight, I need my own pointer. This Disassembly Guide helped me figure out how to use Event Assembler, and now we can disassemble the event we want to put our custom battle into. Once we have our disassembled code, we can just make a space where we want our fight to be and put the code line, FIGH Attacker Defender FightData as per Arch's guide on scripting battles for FE7. If you're in FE8, you'll find your syntax there too, and this and my first post has images of those posts for quick reference. You'll notice that if you disassemble an event and look at the FIGH codes, they are indeed structured like this, but they'll have crazy pointers like 0xCB29A0 (right...?) or just 8CB29A0, and Disassembler did not tell me where those pointers go or how to get to them. But we don't need to we just follow Arch's guide. Although I have no idea what (lastAttack) means. I don't know what CAN go there or what SHOULD go there. Avril here didn't know either, but this post can help us now that we have disassembler and can now learn on the fly. CT075 recommends putting "True" there, and that worked for me. It DID NOT let me get a scripted battle with the Fire Dragon working, that broke, but I was able to get a battle working between two units and put it into the game... barring some weird, weird jank. My battles have serious graphical glitches on startup, they kind of make the map freak out while the fight is starting, the opposing unit died and gave their death quote unwantedly, so I'm not sure how to perfectly recreate a scene like, Jaffar and Leila. It is at least more than what I had before and we can improve from there, I'm probably just missing something obvious I'll figure out later. Quote //////////////////////////////////////////////////// // // // Disassembled with Nintenlord's Event Assembler // // Version: 11.1.0.0 // // Game: FE7 // // File: Fire Emblem_rekka_no_ken.gba // // Offset: 111C594 // // // //////////////////////////////////////////////////// #include EAstdlib.event ORG $111C594 ASMC 0x79B5D MUSC 0x38 STAL 64 FADI 4 HIDEMAP ASMC 0x7A8B9 LOU1 0xCD81E4 ENUN CAM2 [24,0] FADU 4 SHOWMAP STAL 64 TEX1 0xD44 MUEN 4 FADI 4 HIDEMAP ASMC 0x7A8B9 LOMA 0x24 [0,0] LOU1 0xD72F8 0xD73FC STAL 32 FADU 4 SHOWMAP MUSC 0x3A6 CAM2 [24,25] CURF 0x72 TEX1 0xD45 REMA CAM1 0x59 CURF 0x59 STAL 92 MOVE 0x59 [21,7] 4 STAL 92 MOVE 0x59 [21,8] 4 STAL 92 TEX1 0xD46 MOVE 0x5 [22,7] 24 STAL 120 FADI 8 HIDEMAP FADI 16 HIDEMAP BACG 0x2A FADU 16 SHOWMAP TEX1 0xD47 FADU 4 MUSC 0x52 MORETEXT 0x13C6 _ASM0x3F 0x7C2C1 SOUN 0x2EE STAL 32 _0xE1 _0xE0 0xFFFFFFFF 0x20 0x100 0x1004 _0xE0 0xFFFFFFFF 0x20 0x1A0 0x802 _0xE0 0xFFFFFFFF 0x20 0x100 0x1004 _0xE0 0xFFFFFFFF 0x20 0x1A0 0x802 _0xE2 _ASM0x3F 0x7C2ED STAL 16 ASMC 0x7C305 MORETEXT 0x13C5 SOUN 0x2D9 REMA DISA 0x59 SHOWMAP STAL 90 MUSI CAM1 0x72 CURF 0x72 TEX1 0x13C4 REMA STAL 15 WARP [23,20] 0x1 REPOS 0x5 [23,20] CAM1 0x5 CURF 0x5 STAL 92 FADI 16 FADI 16 HIDEMAP BACG 0x37 FADU 16 SHOWMAP TEX1 0x13C3 FADU 4 STAL 8 FIGH 0x05 0x72 FirstEwan $00000000 FADI 16 MUEN 16 STAL 240 SOUN 0xDF STAL 240 HIDEMAP BACG 0x5B CALL 0xCC0C14 _0x9A MNCH 0x25 STAL 1 _0x1 ENDA FirstEwan: AttackerHit(7,True) DefenderCritical(68,True) EndOfBattle BLDT //The next line is to ensure that new events do not overwrite other data. //Do not delete unless you are SURE you know what you are doing! //ASSERT $111C594 Here's the code I was using that "worked." Newbies like me, please note the "#include EAstdlib.event" at the start, we want that. Event Assembler wants that so it knows that AttackerHit and such are defined, and without it Event Assembler should treat AttackerHit and such as hot garbage nonsense noise. So instead of a pointer like 0xCB29A0 for Jaffar vs Leila, I'm able to define my own pointer and name it whatever. Then at the end past ENDA we define the battle contents that our pointer FirstEwan contains. Again I don't know what goes in lastAttack during "AttackHit(7,attackLast)", but the suggestion to just write "True" seems to compile fine?? And I think we definitely need the BLDT but I don't know what that does, I think it just signals the event assembler to stop adding definitions to FirstEwan. Cool so we have a scripted fight for a pointer, we know where to point our pointer, we can name the pointer whatever we want and put our custom name into the main code, and it shows up in FEBuilder and... *kiiinda* works, barring graphics issues. The last thing I wanted to document for everyone else, and especially because a little bit of help at this juncture would be nice~, but, ASSERT... I couldn't get that thing to work at all. So I made it, Quote //ASSERT $111C594 so that it won't run, because event assembler was refusing to, uh, assert it, I guess. But we want that!! Well I guess I have to do it the hard way, and if you're in my situation too, here's what I did. I went into FEBuilder, went just, anywhere, and told it to allocate new space for an event. Then the offset for the new event? I just grabbed that. FEBuilder offsets our changes to events for us I'm guessing, so then I just use Event Assembler to assemble the event with our fight and its instructions, and we assemble it to the offset of our new fresh event. Essentially offsetted myself! Now the old event is redundant code so I'm guessing I can just... delete it? Or I could leave it there. I haven't used the REBUILD ROM buttom in the advanced menu yet so I don't know how safe that thing is, but I imagine if it works as intended that function will appreciate it if I delete unused events to make room and keep the ROM trim. So those are all the guides I was able to find that were relevant, and I've now documented how I figured them out and most importantly, what order those guides could help me in, starting with disassembler. Once we can disassembler we can learn anything. But I'm also not sure I can learn much more on my own without help. Spoiler Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.