Duff Ostrich Posted September 7, 2017 Share Posted September 7, 2017 (edited) There is probably a simple answer to this question, but I've looked around the forum (and have searched for certain keywords) without finding the relevant solution. I am at least somewhat familiar with all of the typical GBA hacking utilities, and the game in question is Blazing Sword. My intention is to create a defense objective that has enemies targeting a specific location, whether that be a throne or a different square. As with the main games, the objective will be failed (resulting in a gameover) should the enemy reach that spot. The first thing I don't know how to do is pick the location I want. If I set the enemy AI to "SeizeThrone" they will pick a location independent of where my throne tile is currently set and will go somewhere else that seems related to the map I am replacing, but nevertheless I have not been able to locate the relevant value in Nightmare. Additionally, I assume that I must create an event to trigger the gameover once the enemy reaches that spot. Anyone familiar with the syntax I would need to use in order to accomplish this? I appreciate any help you can offer, and I apologize if this is something commonly addressed on this board. Edited September 10, 2017 by Duff Ostrich Quote Link to comment Share on other sites More sharing options...
Primefusion Posted September 7, 2017 Share Posted September 7, 2017 Enemies going after a certain tile is AI based and not something you change in the Chapter Data Editor. To have enemies target a specific tile, check out this thread for FE7, and this thread for FE8. FE7 definitely has support for specific tiles, not sure about FE8. As for the event part of things, you'll need an AREA event that checks if the triggering unit is an enemy or not. Try disassembling desert chapters to see how it handles the hidden items (the game needs to check if the unit is an enemy on top of being lucky). It'll be something like SomeLabel: IFAT 0x01 0xWhateverRoutineTheGameCalls // If we got in here, it's the enemy phase ELSE 0x02 ENIF 0x01 // If we got in here, it's some other phase // We'll want to reset the event ID so it can be called again ENUF 0xWhateverIdIsAttachedToThisEvent // Reset the event so that it can be triggered again ENIF 0x02 ENDA Quote Link to comment Share on other sites More sharing options...
Duff Ostrich Posted September 10, 2017 Author Share Posted September 10, 2017 AI manipulation is a bit out of my depth, but the event worked like a charm and I can certainly make do from there. Thanks! Quote Link to comment Share on other sites More sharing options...
Primefusion Posted September 10, 2017 Share Posted September 10, 2017 (edited) @Duff Ostrich Setting up the AI is actually pretty straight forward. If you check out the AI thread I linked, it says that the AI moving to a certain spot is controlled by AI byte 2. It also gives several options for moving to a particular space: 0x13 = Move to \[03,13] (B98718) 0x14 = Move to \[18,13] (B98794) 0x15 = Move to \[10,24] (B98810) 0x16 = Move to \[08,02] (B9888C) 0x17 = Move to \[06,02] (X: B97579, Y: B9757B) 0x19 = Move to \[06,09] (X: B974B9, Y: B974BB) 0x1A = Move to \[06,05] (X: B974F9, Y: B974FB) 0x1D = Move to \[15,17] (B9869C) 0x1E = Move to \[05,02] (X: B97539, Y: B9753B) Basically, at the offset each option specifies are the coordinates to move to. Let's use 0x13 as our example. If we go to the offset it specifies (0xB98718), we see 0x03 0x0D, which is 3, 13 in hex. Change those values to the coordinates that you need. Now to give the enemies an AI that'll make them move to the spot. For AI byte 1, 0x00 is pretty common so we'll use that. Byte 3 is a combination of healing and targeting priority. To keep it simple, we'll use 0x00, which is very common. Same goes for byte 4. We end up with [0x00,0x13,0x00,0x00]. If we throw it into a define statement, our units can look pretty snazzy now: #define MoveToSpot [0x00,0x13,0x00,0x00] BadGuys: UNIT Bandit Brigand 0 Level(10,Enemy,True) [5,5] [6,6] [SteelAxe] MoveToSpot UNIT Bandit Archer 0 Level(10,Enemy,True) [5,4] [6,5] [IronBow] MoveToSpot UNIT Edited September 10, 2017 by Primefusion 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.