Map changes not inserting correctly [Solved]

So I was watching this nice video that details how to do map changes and I also used this code as basis, but for some reason when I attempt to insert this into my hack I get the message:

Finished.
1 errors encountered:
File map changes ch2.txt, Line 10, Column 2: Didn’t reach end, currently at IntegerLiteral(0x01)

No data written to output.

For reference I have the following as my map event code:

#define DISABLE_TUTORIALS
#include EAstdlib.event

EventPointerTable(0x0F,Pointers)

ORG 0xD80400

Pointers:
POIN Turn_events
POIN Character_events
POIN Location_events
POIN Misc_events
POIN TrapData TrapData
POIN Bad Bad Bad Bad
POIN Good Good Good Good
POIN Opening_event Ending_event

Good:
UNIT 0x01 0x01 0x01 Level(1, Ally, 0) [4,16] [4,16] [0x01] NoAI
UNIT 0x2F 0x2B 0x01 Level(1, Ally, 0) [3,16] [3,16] [0x1F] NoAI
UNIT 0x30 0x29 0x01 Level(1, Ally, 0) [4,15] [4,15] [0x14] NoAI
UNIT 0x04 0x0A 0x01 Level(3, NPC, 0) [9,15] [9,15] [0x01, 0x6B] NoAI
UNIT 0x0E 0x19 0x01 Level(1, NPC, 0) [9,16] [9,16] [0x2C, 0x6B] NoAI
UNIT 0x11 0x1D 0x01 Level(3, NPC, 0) [10,16] [10,16] [0x4A, 0x6B] NoAI
UNIT

Bad:
UNIT 0x8D 0x0A 0x8D Level(6, Enemy, 1) [8,2] [8,2] [0x01, 0x99] Guard
UNIT 0x3E 0x38 0x8D Level(3, Enemy, 1) [2,9] [2,9] [0x81] AttackInRange
UNIT 0x3E 0x38 0x8D Level(3, Enemy, 1) [3,10] [3,10] [0x81] AttackInRange
UNIT 0x3E 0x15 0x8D Level(3, Enemy, 1) [4,3] [4,3] [0x01, 0x99] Guard
UNIT 0x3E 0x12 0x8D Level(3, Enemy, 1) [12,11] [12,11] [0x82] AttackInRange
UNIT 0x3E 0x12 0x8D Level(3, Enemy, 1) [13,13] [13,13] [0x82] AttackInRange
UNIT 0x3E 0x39 0x8D Level(3, Enemy, 1) [10,5] [10,5] [0x82] AttackInRange
UNIT 0x3E 0x39 0x8D Level(3, Enemy, 1) [8,7] [8,7] [0x82] AttackInRange
UNIT 0x3E 0x0A 0x8D Level(3, Enemy, 1) [11,8] [11,8] [0x80] AttackInRange
UNIT 0x3E 0x0A 0x8D Level(3, Enemy, 1) [9,8] [9,8] [0x80] AttackInRange
UNIT 0x3E 0x18 0x8D Level(3, Enemy, 1) [8,3] [8,3] [0x83] AttackInRange
UNIT 0x3E 0x39 0x8D Level(3, Enemy, 1) [14,5] [14,5] [0x82] AttackInRange
UNIT 0x3E 0x18 0x8D Level(3, Enemy, 1) [12,1] [12,1] [0x83] PursueWithoutHeed
UNIT 0x3E 0x38 0x8D Level(3, Enemy, 1) [15,9] [15,9] [0x81] PursueWithoutHeed
UNIT 0x3E 0x39 0x8D Level(3, Enemy, 1) [16,10] [16,10] [0x82] PursueWithoutHeed
UNIT

Turn_events:
TurnEventPlayer(0x0,Opening_event,1)
End_MAIN

Character_events:
CharacterEvent(0x0,albertjoin,0x01,0x04)
End_MAIN

Location_events:
Seize(0x0,Ending_event,8,1)
Village(0x0,village_c2,10,12)
End_MAIN

Misc_events:
CauseGameOverIfLordDies
End_MAIN

TrapData:
End_MAIN

Opening_event:
LOU1 Good
ENUN
LOU1 Bad
ENUN
OOBB
ENDA

Ending_event:
MoveToChapter(0x03)
ENDA

// Events
albertjoin:
TurnAlly(0x04)
TurnAlly(0x0E)
TurnAlly(0x11)
ENDA

village_c2:
ITGV 0x5F
MAC1 0x00 0x0
ENDA

// Manual Movement

// Scripted Fights

// Units

// Shop Data

MESSAGE Events end at offset currentOffset

and the following as my map change code:

#define TileMap(changeID,Xcoordinate,Ycoordinate,L1,L2,offset) “CODE changeID Xcoordinate Ycoordinate L1; L2 0x00 0x00 0x00; POIN TilePointer”

org 0xC9C9CC+(4*0x37)

POIN TileChanges

org 0xDB0000

TileChanges:
TileMap(0x00,0x0A,0x0C,0x01,0x01,village_c2)
CODE $FF
CODE $00
CODE $00

village_c2:
CODE 0x80 0x00

When I use the CODE… code, it never seems to work for me. I use BYTE instead, and it seems to work. I am not sure if that does anything, but I find that using BYTE instead of CODE works better. Try replace the CODE in the tilechange(the village_c2 in this case, “CODE 0x80 0x00” to “BYTE 0x80 0x00”) with BYTE. I also use WORD 0xFF(I thought there was a macro or something to end tilechanges, but I could be wrong) instead of CODE. Might just be me, but that is what I would try.

CODE is an old… code
unless you’re using an older version of EA, use BYTE, WORD, and SHORT(in this case, BYTE iirc)

yeah, so I tried to use BYTE in place of CODE in the map change event, and it STILL throws the error message.

here’s the updated code for that:

#define TileMap(changeID,Xcoordinate,Ycoordinate,L1,L2,offset) "BYTE

changeID Xcoordinate Ycoordinate L1; L2 0x00 0x00 0x00; POIN TilePointer"

org 0xC9C9CC+(4*0x37)

POIN TileChanges

org 0xDB0000

TileChanges:
TileMap(0x00,0x0A,0x0C,0x01,0x01,village_c2)
BYTE $FF
BYTE $00
BYTE $00

village_c2:
BYTE 0x80 0x00

You’re using an out of date template. The newer versions of EA (v9.10 and v9.11) have macros for this stuff in the EA Standard Library. Try something along these lines:

// Ch4x Tile Changes
#include EAstdlib.event
EventPointerTable(0x75,TileChanges) // Overwrites Ch. 20 Pointer

POIN TileChanges

ORG 0x00D0C190

TileChanges:
TileMap(0x01, 02, 01, 1, 1, Gate)
TileMap(0x02, 10, 05, 1, 1, Gate)
TileMap(0x03, 15, 04, 1, 1, Gate)
TileMap(0x04, 22, 09, 1, 1, Gate)
TileMap(0x05, 08, 12, 1, 1, Gate)
TileMap(0x06, 18, 13, 1, 1, Gate)
TileMap(0x07, 25, 14, 1, 1, Gate)
TileMap(0x08, 13, 09, 1, 1, Gate)
TileMapEnd

Gate:
SHORT 0x0080 0x0000 // BYTE 0x80 0x00 0x00 0x00 is equivalent

You can use BYTE, SHORT, or WORD, but keep in mind that if you use SHORT or WORD, you have to write the hex in Little Endian.

2 Likes

Oof, that worked big time. Thanks a lot!