-
Notifications
You must be signed in to change notification settings - Fork 12
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
Rkg script #23
base: main
Are you sure you want to change the base?
Rkg script #23
Conversation
assert AButton == 0 or AButton == 1, \ | ||
f"A button input has value `{AButton}` at line {csv_line}" | ||
|
||
assert BButton == 0 or BButton == 1, \ | ||
f"B button input has value `{BButton}` at line {csv_line}" | ||
|
||
assert ItemButton == 0 or ItemButton == 1, \ | ||
f"Item button input has value `{ItemButton}` at line {csv_line}" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
"<button> button input on line {csv_line} is out of range! Expected 0 - 1, got `{<button>}`"
assert -7 <= YDirection <= 7, \ | ||
f"Y direction input has value `{YDirection}` at line {csv_line}" | ||
|
||
assert -7 <= XDirection <= 7, \ | ||
f"X direction input has value `{XDirection}` at line {csv_line}" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We (regrettably) shouldn't assume the CSV is 0-centered.
"<direction> direction input has inconsistent centering at line {csv_line}"
"<direction> direction input on line {csv_line} is out of range! Expected {range} - {range + 14}, got `{<direction>}`"
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In what situation would this not be the case?
How do we know then how to parse the csv if this is not always the case? A parameter that specifies the format?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There are still people who use 7-centered.
The most we can do is infer the center by checking unshared boundaries (> 7, < 0). If that fails, we may want to default to whichever number has the highest frequency, since neutral inputs are most likely the more common of the two. Alternatively, we can ask the user via input what center the script is.
assert 0 <= TrickInput <= 4, \ | ||
f"Trick input has value `{TrickInput}` at line {csv_line}" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
"Trick input on line {csv_line} is out of range! Expected 0 - 4, got `{TrickInput}`"
|
||
def get_dummy_data(): | ||
"""Generate dummy metadata to put in the header of the rkg file""" | ||
return MetaData(0, 0, 0, True) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Dummy metadata is invalid - this will generate a ghost with Mario on Standard Kart S.
if len(inputs) > 0x2774: | ||
print("Too many ghost inputs for a standard RKG file") | ||
else: | ||
# Pad input data until it is of length 0x2774 | ||
inputs.extend([0x00] * (0x2774 - len(inputs))) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good idea for general use, though you may want to add a boolean for this project since we can rewrite the ghost parsing to extend the size.
With regards to metadata, there are two approaches that I think would be good. If no arguments are passed to the script, we can query with If there are arguments passed into the script, we assume that the arguments are IDs and use them directly. On a separate note, due to the Mario/Standard Kart S thing, we may want to check that the character/vehicle combination is valid. |
#5 Initial commit, the following still needs to happen:
Personally I'm not a fan of getting the metadata through a prompt because then you would have to fill in the id's of the character and vehicle which people don't know by heart.
How will this script be used exactly? If it is used by a discord bot or something then imo it makes more sense to just pass all the metadata as arguments to the script directly.