Jump to content

Event Assembler Questions Thread


CT075
 Share

Recommended Posts

Instead of cherry picking which scenes are repointed and which stay at the original offset, it might be easier to just move the whole set of events to the same spot.

That way you can avoid potential issues that might pop up, like overwriting existing data elsewhere.

Link to comment
Share on other sites

  • Replies 3.3k
  • Created
  • Last Reply

Top Posters In This Topic

How would you create a Yes/No text choice, as in IFYN events, that would be native to the game? I had initially thought that the IFYN code spawned in the text and choice, but I was wrong when I tried my events out. Thanks in advance!

Link to comment
Share on other sites

There's two parts to creating a yes/no decision: The text, and the events.

For the text, it should contain a [Yes] or [No] tag.

Go on a side quest?
[Yes][X]

Then, in the events, you'll need a IFYN condition block.

// The first two lines create a tutorial-style box which displays the yes/no text
TEX6 0x5 [0,0] 0xYOUR_TEXT_ID_HERE
_ASM0x42 0x83181
// Now for the condition block
IFYN 0x01
    // If yes was chosen, do this
ELSE 0x02
ENIF 0x01
    // Otherwise, do this
ENIF 0x02
Link to comment
Share on other sites

  • 2 weeks later...
  • 3 weeks later...

I have an escape chapter in which every unit has to escape otherwise it will be lost for the rest of the game. Everythin worked fine until I noticed that every unit that had escaped can still be attacked by enemys und then appears at the escape point, but I can't controll it. I tried do REPOS the unit after it's escape so it can't be attacked, but then the camera moves to the REPOS Point and back and I wasn't able lock the cam for the REPOS.

Hope some can look at the code and see if I got something wrong.

Location_events:
DOOR 0x0 [5,14] 0x10
DOOR 0x5 [5,9] 0x10
DOOR 0x0 [20,9] 0x10
DOOR 0x0 [20,14] 0x10
CHES 0x0 0xB1 [02,13] 0x12
CHES 0x0 0x67 [03,13] 0x12
CHES 0x0 0x58 [02,15] 0x12
CHES 0x0 0x1A [03,15] 0x12
ChestMoney(5000,03,15)
ChestMoney(10000,03,03)
LOCA 0x0 Flucht [09,23] 0xF
LOCA 0x0 Flucht [10,23] 0xF
LOCA 0x0 Flucht [11,23] 0xF
LOCA 0x0 Flucht [12,23] 0xF
LOCA 0x0 Flucht [13,23] 0xF
LOCA 0x0 Flucht [14,23] 0xF
LOCA 0x0 Flucht [15,23] 0xF
LOCA 0x0 Flucht [16,23] 0xF
END_MAIN


Flucht:
IFCA 0x00 0x1C Sue
TEX1 0x9FC
UNCM Sue 0x08
ENUT 0x1D
ENIF 0x1C

IFCA 0x00 0x32 Basan
TEX1 0x9C8
UNCM Basan 0x08
ENUT 0x27
ENIF 0x32

IFCA 0x00 0x17 Tony_N
TEX1 0x9D9
UNCM Tony_N 0x08
ENUT 0x21
ENIF 0x17

IFCA 0x00 0x01 Yutis
TEX1 0x9C6
UNCM Yutis 0x08
ENUT 0x22
ENIF 0x01

IFCA 0x00 0x29 Anem
TEX1 0x9C7
UNCM Anem 0x08
ENUT 0x23
ENIF 0x29

IFCA 0x00 0x0A Kratos
TEX1 0x9C9
UNCM Kratos 0x08
ENUT 0x25
ENIF 0x0A

IFCA 0x00 0x0B Sephie
TEX1 0x9CA
UNCM Sephie 0x08
ENIF 0x0B

IFCA 0x00 0x0C Aurora
TEX1 0x9CB
UNCM Aurora 0x08
ENIF 0x0C

IFCA 0x00 0x0D Gwyn
TEX1 0x9CC
UNCM Gwyn 0x08
ENIF 0x0D

IFCA 0x00 0x0E Gunivere
TEX1 0x9CD
UNCM Gunivere 0x08
ENIF 0x0E

IFCA 0x00 0x0F Sai
TEX1 0x9CE
UNCM Sai 0x08
ENIF 0x0F

IFCA 0x00 0x30 Wolt
TEX1 0x9CF
UNCM Wolt 0x08
ENUT 0x2B
ENIF 0x30

IFCA 0x00 0x31 Miredy
TEX1 0x9D0
UNCM Miredy 0x08
ENUT 0x11
ENIF 0x31

IFCA 0x00 0x13 0x12
TEX1 0x9DA
UNCM 0x12 0x08
ENUT 0x2E
ENIF 0x13

IFCA 0x00 0x12 Oliver
TEX1 0x9D1
UNCM Oliver 0x08
ENUT 0x2D
ENIF 0x12


IFCA 0x00 0x14 Nina
TEX1 0x9DA
UNCM Nina 0x08
ENUT 0x2F
ENIF 0x14

IFCA 0x00 0x15 Leon
TEX1 0x9DB
UNCM Leon 0x08
ENUT 0x19
ENIF 0x15

IFCA 0x00 0x1A Kama
TEX1 0x9DC
UNCM Kama 0x08
ENUT 0x1B
ENIF 0x1A

IFCA 0x00 0x20 Yor
TEX6 0x05 [0,0] 0x8C0
_ASM0x42 0x83181
IFYN 0x21
TEX1 0x9DD
JUMP Checker
ELSE 0x22
ENIF 0x21
TEX1 0x8C1
ENIF 0x20
STAL 5
ENDA

Bonus:
FADI 16
HIDEMAP
MUS1 0x0039
BACG 0x16
FADU 16
TEX1 0x8B9
MUEN 5
STAL 5
ENUT 0x2C
JUMP Ending_event
ENDA

Checker:
MUS2 0x0038
FADI 10
BACG 0x22
FADU 10
TEX1 0x9DE


IFET 0x0F 0x2B
MORETEXT 0x9EA
ELSE 0x10
ENIF 0x0F
MORETEXT 0x9F3
CUSI Wolt 0x47
ENUN
ENIF 0x10

IFET 0x03 0x23
MORETEXT 0x9E0
ELSE 0x04
ENIF 0x03
MORETEXT 0x9EF
CUSI Anem 0x47
ENUN
ENIF 0x04

IFET 0x05 0x21
MORETEXT 0x9E1
ELSE 0x06
ENIF 0x05
MORETEXT 0x9F0
CUSI Tony_N 0x47
ENUN
ENIF 0x06

IFET 0x07 0x2F
MORETEXT 0x9E2
ELSE 0x08
ENIF 0x07
MORETEXT 0x9F1
CUSI Nina 0x47
ENUN
ENIF 0x08

IFET 0x17 0x2D
MORETEXT 0x9F8
ELSE 0x18
ENIF 0x17
MORETEXT 0x9F4
CUSI Oliver 0x47
ENUN
ENIF 0x18

IFET 0x13 0x2E
MORETEXT 0x9EC
ELSE 0x14
ENIF 0x13
CUSI 0x12 0x47
MORETEXT 0x9F6
ENUN
ENIF 0x14


IFET 0x0B 0x27
MORETEXT 0x9E9
ELSE 0x0C
ENIF 0x0B
MORETEXT 0x9F2
CUSI Basan 0x47
ENUN
ENIF 0x0C

IFET 0x01 0x19
MORETEXT 0x9DF
ELSE 0x02
ENIF 0x01
MORETEXT 0x9EE
CUSI Leon 0x47
DISA Leon
ENUN
ENIF 0x02

IFET 0x11 0x11
MORETEXT 0x9EB
ELSE 0x12
ENIF 0x11
CUSI Miredy 0x47
MORETEXT 0x9F5
ENUN
ENIF 0x12

IFET 0x15 0x1B
MORETEXT 0x9ED
ELSE 0x16
ENIF 0x15
MORETEXT 0x9F7
CUSI Kama 0x47
ENUN
ENIF 0x16

IFET 0x1E 0x1D
MORETEXT 0x9FA
ELSE 0x1F
ENIF 0x1E
MORETEXT 0x9F9
CUSI Sue 0x47
ENUN
ENIF 0x1F

JUMP Ending_event
ENDA

Link to comment
Share on other sites

traditional escape chapters actually require some extra magic to fix exactly the issue you describe. i did manage to fix that, but as I wasn't the only person to work on that particular project (there was a team of us working on it for elibean nights) i'm hesitant to release it

Link to comment
Share on other sites

This is for FE7 i want the chars that convo, fight, and if char 23 survives char 39 is recruited

CHAR 0x8 label38 [0x23,0x39] 0x0

label38:
MUS2 0x43
TEX1 0x136D
REMA
MURE 0x6
CUSI 0x39 0x0
ENDA

But if i use the FIGH 0x23 0x39 0x0 [0x0,0x0,0x0,0x1]

When they are going to talk game just stops, waht do i need to do? I tried to adapt the Karla vs Bartre, but nothing works so far...they have lots and lots of conditionals...So anyone can help me with this?

Link to comment
Share on other sites

In the Karla/Bartre case, there's an ASMC in between the REMA and the FIGH lines. Have you tried using that?

As for deciphering the Karla/Bartre event in detail:

If you look at the text IDs that are in the events, you can kind of piece together what the conditionals are checking.

If I remember right, Bartre needs to be promoted and at least level 5 for Karla to even show up in the chapter, so I suspect that's what one of the first conditionals checks.

Then, he needs to have a weapon, so there's a check for that, based on the dialogue.

If those conditions are met, they fight. After the fight, there's a IFCA that checks if Bartre is still alive.

I suspect another of the IFATs checks if Karla is still alive, since enemies/NPCs don't really have an easy way to check if they're still breathing. I would try assigning the the NPC's death quote an ID and checking for that so you can avoid having to write a routine yourself.

Link to comment
Share on other sites

I tried this

label38:
MUS2 0x43
TEX1 0x136D
IFAF 0x5 0x7DA15
REMA
ASMC 0x1CD51
FIGH 0x23 0x39 0x0 [0x0,0x0,0x0,0x1]
MURE 0x6
CUSI 0x39 0x0
ENDA

Just stops the game when Mathew enters in Range... I would be happy if just after the fight, no matter the results char 0x39 is recruited...

But i dont know why it does not even let them fight

Edit: Just fixed it by simply giving them a fight convo and giving the talk the condition of the fight convo, so if Matthew survives can talk to her, if he does not...well he cannot talk no her, and viceversa LOL, so that ends the big trouble.

Edited by marlon0024
Link to comment
Share on other sites

  • 2 weeks later...

Hey guys, I need some help understanding how the reinforcements are loaded in FE8 Chapter 1 after disassembling it in the EA (V9.11).

The trigger condition for the reinforcements is that Erika crosses from the right side of the map to the left.

These should be the relevant disassembled EA code:

MiscBasedEvents:

AFEV 0x7 label23 0x2
AREA 0xA label24 [0,0] [7,9]
AFEV 0x0 label25 0x65
END_MAIN
...
label24:
SETVAL 0x2 0x1
CALL label36
ENUF 0xB
EVBIT_T 0x7
ENDA
...
label36:
CHECK_ACTIVE
IFNOTEQUAL 0x0 0xC 0x2
CALL label26
ENIF 0x0
ENDA
label26:
CHECK_EVENTID
SLOTS_ADD 0xC2
ENUF_SLOT2
EVBIT_T 0x7
ENDB

Once the AREA event triggers, it (should) check to see if the trigger character is Erika and then load reinforcements if yes.

But there are some puzzling things here, the Event's ID should be 0xA (AREA 0xA label24 [0,0] [7,9]), but it's corresponding ENUF uses 0xB under label24.

Similarly, the code

IFNOTEQUAL 0x0 0xC 0x2

CALL label26
ENIF 0x0

should check if the person who triggered the event is Erika (Char ID. 0x1). However why is IFNOTEQUAL checking against the value 0x2/Seth (IFNOTEQUAL 0x0 0xC 0x2)?

Also, how are the reinforcements actually loaded? The only LOAD1s (not included here) I see in the disassembled code were loading Erika/Seth, initial enemies and Franz/Gilliam.

PS. The UNIT data for the 3 enemy reinforcements never appeared in the disassembled file, I suppose it is because they were never referenced anywhere in the disassembled code.

Link to comment
Share on other sites

There's a few things going on here that may confuse you:

First, when it checks the character:

IFNOTEQUAL 0x0 0xC 0x2
CALL label26
ENIF 0x0

this does NOT mean it is checking for character NUMBER 0x2 - it means it is checking the character number stored in SLOT 0x2. And what value is that? Well:

SETVAL 0x2 0x1
CALL label36

SETVAL 0x2 0x1 puts the character number 0x1 into SLOT 0x2. So it's checking if character 0x1 (Eirika) stored in slot 0x2 is the same as the character stored in slot 0xC (which is whoever stepped on the area).

Second, when that character is Eirika, and the reinforcements should trigger, you should notice that they don't appear immediately. Instead, they appear on the next turn. So how is this done?

ENUF 0xB

This does NOT trigger a reinforcement event, but instead it UNTRIGGERS a turn event. This turn event doesn't happen normally because it is tied to event ID 0xB, which gets set in the opening event. In other words, it checks every turn to see if it should trigger, but the only turn it will trigger is the one after Eirika stands on the area and unsets the event ID. This turn event is the one that summons the reinforcements, probably through the use of SETVAL and CALL to use a reinforcement loading event (the same one that the ReinforcementEvent() macro uses).

Link to comment
Share on other sites

Ah, if I understand correctly, what you're saying is that stepping on the AREA event simply checks if the person is Erika and if not ENUF/disable another event 0xB and 0xB is the one that actually loads the reinforcements?

Anyways I checked in TurnBasedEvents for event ID 0xB:

ORG $9E868C

TurnBasedEvents:
TURN 0x0 label15 [1,1] 0x0
TURN 0x0 label16 [1,1] 0x8
TURN 0x0 label17 [2,2] 0x0
TURN 0xB label18 [1,255] 0x0
...
label18:
MUNO
SVAL 0x2 0x88B41B8
CALL label37
CUMO 0x83
STAL 60
CURE
TEXTSTART
TEXTSHOW 0x934
TEXTEND
REMA
MUSI
EVBIT_T 0x7
ENDA
...
label37:
EVBIT_MODIFY 0x4
CALL label27
EVBIT_T 0x9
LOAD_SLOT1 0x1
ENUN
EVBIT_F 0x9
EVBIT_MODIFY 0x0
ENDA
...
label27:
EVBIT_MODIFY 0x1
EVBIT_F 0x2
CHECK_EVBIT 0x8
BEQ 0x0 0xC 0x0
FADU 16
LABEL 0x0
EVBIT_MODIFY 0x0
ENDA

Ok so I see that "SVAL 0x2 0x88B41B8" is setting the offset to the reinforcement in slot2, which is eventually loaded by LOAD_SLOT1 after some EVBIT_MODIFYs in label27.
The event (0xB) itself tries to run every turn (from turn 1 to 255?) but it gets disabled by the AREA event unless Erika is the one that triggers it.
I've got a question here: doesn't AREA events trigger whenever someone moves into it? So if I have Seth move in first (or any other enemy for that matter), then he would untrigger 0xB, and if Erika then moves in after in the same turn, how does the event 0xB gets enabled again for the current turn?
Link to comment
Share on other sites

0xB is first triggered in the Opening Event. This means the turn event 0xB does nothing, because it thinks it already happened. After that, whenever anybody steps on the area, it checks if they're Eirika. If they're not Eirika, nothing happens. If it is Eirika, she untriggers 0xB and the turn event happens the next turn.

Link to comment
Share on other sites

0xB is first triggered in the Opening Event. This means the turn event 0xB does nothing, because it thinks it already happened. After that, whenever anybody steps on the area, it checks if they're Eirika. If they're not Eirika, nothing happens. If it is Eirika, she untriggers 0xB and the turn event happens the next turn.

I see, it appears I misunderstood what "untriggering an event" meant. I thought it disables the event, but it actually makes it so you can run the event again.

Thanks dude!

Also, a general question for anyone doing ASM hacking: what kind of tools (disassembler/assembler) do you use?

Link to comment
Share on other sites

just google devkit pro

honestly any kind of ARM assembler would work, although you would want some kind of object copy utility to extract the raw binary from the metadata

Link to comment
Share on other sites

  • 3 weeks later...

so it's been a long time since i've done something like this and i've got this really annoying glitch which shouldn't be happening because i followed Arch's video tutorials to the letter which is during the opening event, I've loaded my ally group but the screen is black and I don't understand why this is happening.
My code in case someone can look it over and tell me what's wrong, because as i said, I haven't done this in a long time.

//Made by markyjoe1990 of Youtube
//Modified by Nintenlord
//Modified by Crazycolorz5 and Arch
#define DISABLE_TUTORIALS
#include EAstdlib.event
EventPointerTable(0x06,Pointers)
ORG 0xD80000
Pointers:
POIN Turn_events
POIN Character_events
POIN Location_events
POIN Misc_events
POIN TrapData TrapData
POIN EliwoodNM EliwoodHM HectorNM HectorHM
POIN Good Good Good Good
POIN Opening_event Ending_event
EliwoodNM:
EliwoodHM:
HectorNM:
HectorHM:
UNIT
Good:
UNIT Lyn_t LynLord 0x00 Level(1,Ally,False) [0,0] [0,0] [Fire,Vulnerary] [0x00,0x00,0x00,0x00]
UNIT
Turn_events:
TURN 0x00 Opening_event [01,00] 0x0 0x00
END_MAIN
Character_events:
END_MAIN
Location_events:
END_MAIN
Misc_events:
CauseGameOverIfLordDies
END_MAIN
Opening_event:
LOU1 Good
CURF [0,0]
TEX1 0x0813
REMA
MOVE Lyn_t [8,6] 0x1
ENUN
ENDA
Ending_event:
ENDA
TrapData:
ENDTRAP
MESSAGE Events end at offset CURRENTOFFSET
//The map for this chapter is at offset: 00DA0000

Edit: I did a cursory look and I saw someone with the same problem but i'm not too sure and I'm using version 10.0 of the event assembler
Edited by Blitzzurger96
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...