-
Notifications
You must be signed in to change notification settings - Fork 2.7k
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
Update event macro comments #1558
Conversation
… into update-macros
While we're making sweeping event macro changes, maybe it would make sense to provide combined It appears that practically** all raw
An example implementation could be:
Which is used as follows:
* |
It's the kind of thing that had we done this earlier in the project I wouldn't think twice about it, but now reformatting a major portion of the scripts makes me nervous. In any case I'd say yes to at least providing it as an option. I'm traveling today so I'm not at my computer but if it can be used for all instances of |
I think it might be possible to replace all instances, but I'd be hesitant to break compatibility with scripts people have already written for their hacks, and even more hesitant if Poryscript compiles to Regarding all uses of the existing
So, the same results as having checked for "what follows a I wouldn't be surprised if GF used a combined command when they wrote their scripts, but I can't confirm whether that's true or not. |
Alright well that does sound like it could be used to replace all direct uses of |
Oh! Sorry, I misunderstood your suggestion, I thought you meant the macro should only support the 3-argument version. Yeah, I think having an (unused by pret's master) 1-argument option would cover our bases well :) |
Reformatted the scripts to use single statement conditional jumps (e.g. - compare VAR_BRINEY_LOCATION, 1
- goto_if_eq EventScript_MoveMrBrineyToHouse
- compare VAR_BRINEY_LOCATION, 2
- goto_if_eq EventScript_MoveMrBrineyToDewford
- compare VAR_BRINEY_LOCATION, 3
- goto_if_eq EventScript_MoveMrBrineyToRoute109
+ goto_if_eq VAR_BRINEY_LOCATION, 1, EventScript_MoveMrBrineyToHouse
+ goto_if_eq VAR_BRINEY_LOCATION, 2, EventScript_MoveMrBrineyToDewford
+ goto_if_eq VAR_BRINEY_LOCATION, 3, EventScript_MoveMrBrineyToRoute109 |
Include expansion_branches.h in global.h
Main goal was to update the event macro comments, which in many cases were either missing, using outdated language, or plain incorrect. Ended up down a couple rabbit holes along the way. Notable changes aside from comment updates below:
warp macros now handle different numbers of optional arguments. In addition to the original
warp MAP, warpId, x, y
, the following are now also valid:warp MAP, x, y
,warp MAP, warpId
, andwarp MAP
.macros which use a value 0-2 to refer to STR_VAR_# may now also refer directly to the STR_VAR name, i.e.
buffermovename 1, MOVE_TACKLE
can now also bebuffermovename STR_VAR_2, MOVE_TACKLE
.A few macros like
checkitem
andupdatemoneybox
now have formerly required arguments as optional with default values.Some macros have changed names, either because they were incorrect or inconsistent with their function name. The used ones are listed below
field_tasks.c
tv.c
PARTY_NOTHING_CHOSEN
constant for party menu script functionsWARP_ID_NONE
for the special warp id to indicate coordinates should be used.StringGetEnd10
,StringCopy10
, andStringCopy7
now have names indicating what they are limiting and use the corresponding constant.Overworld_
function name prefixessub_
functions.