Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Generate local IDs from map.json files #2047

Open
wants to merge 7 commits into
base: porymap-6
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
3 changes: 2 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -281,7 +281,8 @@ generated: $(AUTO_GEN_TARGETS)
%.rl: % ; $(GFX) $< $@

clean-generated:
-rm -f $(AUTO_GEN_TARGETS)
@rm -f $(AUTO_GEN_TARGETS)
@echo "rm -f <AUTO_GEN_TARGETS>"

ifeq ($(MODERN),0)
$(C_BUILDDIR)/libc.o: CC1 := $(TOOLS_DIR)/agbcc/bin/old_agbcc$(EXE)
Expand Down
6 changes: 3 additions & 3 deletions asm/macros/event.inc
Original file line number Diff line number Diff line change
Expand Up @@ -604,10 +604,10 @@
.endm

@ Blocks script execution until the movements being applied to the specified (localId) object finish.
@ If localId is 0, then the id of the last-moved object will be used instead. If the specified object
@ is not currently being manipulated with applymovement, then this command does nothing.
@ If localId is LOCALID_NONE (0), then the id of the last-moved object will be used instead.
@ If the specified object is not currently being manipulated with applymovement, then this command does nothing.
@ If no map is specified, then the current map is used.
.macro waitmovement localId:req, map
.macro waitmovement localId=LOCALID_NONE, map
.ifb \map
.byte 0x51
.2byte \localId
Expand Down
12 changes: 6 additions & 6 deletions data/event_scripts.s
Original file line number Diff line number Diff line change
Expand Up @@ -774,8 +774,8 @@ EventScript_HideMrBriney::
return

RusturfTunnel_EventScript_SetRusturfTunnelOpen::
removeobject LOCALID_WANDAS_BF
removeobject LOCALID_WANDA
removeobject LOCALID_RUSTURF_TUNNEL_WANDAS_BF
removeobject LOCALID_RUSTURF_TUNNEL_WANDA
clearflag FLAG_HIDE_VERDANTURF_TOWN_WANDAS_HOUSE_WANDAS_BOYFRIEND
clearflag FLAG_HIDE_VERDANTURF_TOWN_WANDAS_HOUSE_WANDA
setvar VAR_RUSTURF_TUNNEL_STATE, 6
Expand All @@ -784,11 +784,11 @@ RusturfTunnel_EventScript_SetRusturfTunnelOpen::

EventScript_UnusedBoardFerry::
delay 30
applymovement OBJ_EVENT_ID_PLAYER, Common_Movement_WalkInPlaceFasterUp
applymovement LOCALID_PLAYER, Common_Movement_WalkInPlaceFasterUp
waitmovement 0
showobjectat OBJ_EVENT_ID_PLAYER, 0
showobjectat LOCALID_PLAYER, 0
delay 30
applymovement OBJ_EVENT_ID_PLAYER, Movement_UnusedBoardFerry
applymovement LOCALID_PLAYER, Movement_UnusedBoardFerry
waitmovement 0
delay 30
return
Expand All @@ -801,7 +801,7 @@ Common_EventScript_FerryDepartIsland::
call_if_eq VAR_FACING, DIR_SOUTH, Ferry_EventScript_DepartIslandSouth
call_if_eq VAR_FACING, DIR_WEST, Ferry_EventScript_DepartIslandWest
delay 30
hideobjectat OBJ_EVENT_ID_PLAYER, 0
hideobjectat LOCALID_PLAYER, 0
call Common_EventScript_FerryDepart
return

Expand Down
2 changes: 2 additions & 0 deletions data/maps/AquaHideout_B2F/map.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
"connections": null,
"object_events": [
{
"local_id": "LOCALID_AQUA_HIDEOUT_MATT",
"graphics_id": "OBJ_EVENT_GFX_AQUA_MEMBER_M",
"x": 23,
"y": 19,
Expand Down Expand Up @@ -54,6 +55,7 @@
"flag": "FLAG_ITEM_AQUA_HIDEOUT_B2F_NEST_BALL"
},
{
"local_id": "LOCALID_AQUA_HIDEOUT_SUBMARINE",
"graphics_id": "OBJ_EVENT_GFX_SUBMARINE_SHADOW",
"x": 19,
"y": 20,
Expand Down
9 changes: 3 additions & 6 deletions data/maps/AquaHideout_B2F/scripts.inc
Original file line number Diff line number Diff line change
@@ -1,6 +1,3 @@
.set LOCALID_MATT, 1
.set LOCALID_SUBMARINE, 4

AquaHideout_B2F_MapScripts::
map_script MAP_SCRIPT_ON_TRANSITION, AquaHideout_B2F_OnTransition
.byte 0
Expand All @@ -15,7 +12,7 @@ AquaHideout_B2F_EventScript_PreventMattNoticing::

AquaHideout_B2F_EventScript_MattNoticePlayer::
lockall
setvar VAR_0x8008, LOCALID_MATT
setvar VAR_0x8008, LOCALID_AQUA_HIDEOUT_MATT
playse SE_PIN
applymovement VAR_0x8008, Common_Movement_ExclamationMark
waitmovement 0
Expand All @@ -32,8 +29,8 @@ AquaHideout_B2F_EventScript_Matt::
end

AquaHideout_B2F_EventScript_SubmarineEscape::
setvar VAR_0x8008, LOCALID_MATT
setvar VAR_0x8009, LOCALID_SUBMARINE
setvar VAR_0x8008, LOCALID_AQUA_HIDEOUT_MATT
setvar VAR_0x8009, LOCALID_AQUA_HIDEOUT_SUBMARINE
applymovement VAR_0x8008, Common_Movement_WalkInPlaceFasterLeft
waitmovement 0
delay 20
Expand Down
8 changes: 8 additions & 0 deletions data/maps/BattleFrontier_BattleArenaBattleRoom/map.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
"connections": null,
"object_events": [
{
"local_id": "LOCALID_ARENA_BATTLE_BLACK_BELT_1",
"graphics_id": "OBJ_EVENT_GFX_BLACK_BELT",
"x": 5,
"y": 3,
Expand All @@ -28,6 +29,7 @@
"flag": "0"
},
{
"local_id": "LOCALID_ARENA_BATTLE_BLACK_BELT_2",
"graphics_id": "OBJ_EVENT_GFX_BLACK_BELT",
"x": 10,
"y": 3,
Expand All @@ -41,6 +43,7 @@
"flag": "0"
},
{
"local_id": "LOCALID_ARENA_BATTLE_BLACK_BELT_3",
"graphics_id": "OBJ_EVENT_GFX_BLACK_BELT",
"x": 5,
"y": 9,
Expand All @@ -54,6 +57,7 @@
"flag": "0"
},
{
"local_id": "LOCALID_ARENA_BATTLE_BLACK_BELT_4",
"graphics_id": "OBJ_EVENT_GFX_BLACK_BELT",
"x": 10,
"y": 9,
Expand All @@ -67,6 +71,7 @@
"flag": "0"
},
{
"local_id": "LOCALID_ARENA_BATTLE_ATTENDANT",
"graphics_id": "OBJ_EVENT_GFX_BLACK_BELT",
"x": 4,
"y": 5,
Expand All @@ -93,6 +98,7 @@
"flag": "0"
},
{
"local_id": "LOCALID_ARENA_BATTLE_OPPONENT",
"graphics_id": "OBJ_EVENT_GFX_VAR_0",
"x": 15,
"y": 6,
Expand All @@ -106,6 +112,7 @@
"flag": "0"
},
{
"local_id": "LOCALID_ARENA_BATTLE_PLAYER",
"graphics_id": "OBJ_EVENT_GFX_VAR_1",
"x": 0,
"y": 6,
Expand All @@ -119,6 +126,7 @@
"flag": "0"
},
{
"local_id": "LOCALID_ARENA_BATTLE_ANNOUNCER",
"graphics_id": "OBJ_EVENT_GFX_BLACK_BELT",
"x": 7,
"y": 4,
Expand Down
Loading