recursivesweatpants dx support

@Recursive Sweatpants let me know what you'd like to do with dx and I'll help you here
bates64
bates6484d ago
I need to make pages on docs.starhaven.dev regarding adding things to the game but it helps to walk a person through it first
Recursive Sweatpants
Recursive Sweatpants84d ago
Thank you! I guess I'd like to start with the first thing I did with Star Rod: adding a new NPC to a map. How do I do that in the decomp?
bates64
bates6484d ago
say for example you wanted to modify kmr_20 (mario's house): open src/world/area_kmr/kmr_20/kmr_20_10_npc.c you'll see at the bottom of the file a familiar struct: an NpcGroupList the NpcGroupList references NpcData structs which appear earlier in the file, which are like NpcGroups in Star Rod, if I recall their name correctly with dx you can just modify data in-place and then recompile; no need for patch files or anything let's say we wanted to add a passive Gourmet Guy who just sits there and doesn't do anything. 1. add #include "world/common/GourmetGuy.h" to src/world/area_kmr/kmr_20/kmr_20.h. this lets us reference his sprites and animations
enum {
NPC_Scene_Parakarry = 0,
NPC_Scene_Luigi = 1,

NPC_Luigi_0 = 0,
NPC_Luigi_1 = 1,
NPC_ShyGuy = 2,

+ NPC_GourmetGuy,
};
enum {
NPC_Scene_Parakarry = 0,
NPC_Scene_Luigi = 1,

NPC_Luigi_0 = 0,
NPC_Luigi_1 = 1,
NPC_ShyGuy = 2,

+ NPC_GourmetGuy,
};
here, he will be implicitly given the id 3, because its NPC_ShyGuy+1. (you may note that this map has two sets of npc ids, probably for the prologue cutscene and then after. you could verify by looking at the main script which probably switches on story progress to decide which npc group list to use.) 3. add npc structs to src/world/area_kmr/kmr_20/kmr_20_10_npc.c, near the top
#include "world/common/GourmetGuy.inc.c"

NpcData N(NpcData_GourmetGuy) = {
.id = NPC_GourmetGuy, // from that enum we declared earlier in the header file, i.e. 3
.pos = { 0.0f, 0.0f, 0.0f }, // or some other position
.yaw = 90,
.settings = &N(NpcSettings_GourmetGuy), // provided by GourmetGuy.inc.c
.flags = ENEMY_FLAG_PASSIVE,
.drops = NO_DROPS,
.animations = GOURMET_GUY_ANIMS, // provided by GourmetGuy.h
.tattle = MSG_NpcTattle_GourmetGuy,
};
#include "world/common/GourmetGuy.inc.c"

NpcData N(NpcData_GourmetGuy) = {
.id = NPC_GourmetGuy, // from that enum we declared earlier in the header file, i.e. 3
.pos = { 0.0f, 0.0f, 0.0f }, // or some other position
.yaw = 90,
.settings = &N(NpcSettings_GourmetGuy), // provided by GourmetGuy.inc.c
.flags = ENEMY_FLAG_PASSIVE,
.drops = NO_DROPS,
.animations = GOURMET_GUY_ANIMS, // provided by GourmetGuy.h
.tattle = MSG_NpcTattle_GourmetGuy,
};
4. add him to the NpcGroupList
NpcGroupList N(DefaultNPCs) = {
NPC_GROUP(N(NpcData_Luigi_0)),
NPC_GROUP(N(NpcData_Luigi_1)),
NPC_GROUP(N(NpcData_ShyGuy)),
+ NPC_GROUP(N(NpcData_GourmetGuy)),
{}
};
NpcGroupList N(DefaultNPCs) = {
NPC_GROUP(N(NpcData_Luigi_0)),
NPC_GROUP(N(NpcData_Luigi_1)),
NPC_GROUP(N(NpcData_ShyGuy)),
+ NPC_GROUP(N(NpcData_GourmetGuy)),
{}
};
btw i didnt test any of this so lmk if it works/doesnt work lol
Recursive Sweatpants
Recursive Sweatpants83d ago
Awesome, I'll play around with that tomorrow and let you know if I have any questions or issues!
bates64
bates6483d ago
generally you can do Ctrl+Shift+F and search for e.g. NPC_GourmetGuy to find a place in vanilla where your npc is used, and steal code from there
Recursive Sweatpants
Recursive Sweatpants83d ago
I'm guessing that I'll just have to plug in the coordinates and sprite data myself rather than using Star Rod's map editor for it?
bates64
bates6483d ago
coordinates: correct sprite data: we provide this for you via the GourmetGuy.h header, simply use GOURMET_GUY_ANIMS
Recursive Sweatpants
Recursive Sweatpants82d ago
Awesome, I got it to work! I think I can figure out some of the other things I learned with Star Rod from here, like how to make NPCs react when you hit them or how to set up dialogue choices. Is there a tool or an easy way to convert SpriteSheet.xml files made with the Star Rod sprite editor to the format that the decomp uses? They're very similar thankfully but the animation commands are labeled differently in the decomp compared to Star Rod. Also, it looks like for custom NPC sprites I need to define a second header file for under ver/us/build/include/sprite/npc that sets up enums for all of the rasters, palettes and animations. Is there any way to generate this or do I have to author it by hand for now?
Wrymouth
Wrymouth81d ago
The idea I believe is that the next Star Rod version will do all of this for you
bates64
bates6481d ago
both formats should be supported by decomp, it'll just warn you if you use an old format do not author anything in build by hand, ever overwrite sprite/npc.xml in your asset directory to tell decomp to build that sprite and provide that sprite in sprite/npc/SpriteName - you'll notice that the SpriteSheet.xml uses the old <Command val="4"/> syntax rather than the new one, but it still builds OK
Wrymouth
Wrymouth81d ago
Did support for the old format get added recently? Cause it wasn't like that when I was doing decomp stuff
bates64
bates6481d ago
yeah, i patched it into dx i believe if its not in dx yet i apologise, id need to cherry-pick the commit from boss-mod/wua
bates64
bates6481d ago
GitHub
support modded NPC sprites · Ponder-Pond/boss-mod@71d19e5
- improve compatibility with Star Rod SpriteSheet.xml files - SR&#39;s intention is to move to the decomp xml but the current release of SR emitted incompatible xml - use npc.xml instead of n...
bates64
bates6481d ago
ok, just checked, it is merged. should just work
Recursive Sweatpants
Recursive Sweatpants81d ago
Alright, I edited npc.xml, but now when I try to build I get this error: [1/450] sprites ver/us/build/assets/us/sprite/sprites.bin ver/us/build/include/sprite/player.h FAILED: ver/us/build/assets/us/sprite/sprites.bin ver/us/build/include/sprite/player.h /usr/bin/python3 tools/build/sprite/sprites.py ver/us/build/assets/us/sprite/sprites.bin ver/us/build/include/sprite/player.h ver/us/build/assets/us/sprite star_rod_build,dx,us Traceback (most recent call last): File "/home/recursivesweatpants/papermario-dx/tools/build/sprite/sprites.py", line 629, in <module> build( File "/home/recursivesweatpants/papermario-dx/tools/build/sprite/sprites.py", line 599, in build npc_sprite_bytes = build_npc_sprites(npc_sprite_order, build_dir) File "/home/recursivesweatpants/papermario-dx/tools/build/sprite/sprites.py", line 487, in build_npc_sprites with open(build_dir / "npc" / f"{sprite_name}.Yay0", "rb") as f: FileNotFoundError: [Errno 2] No such file or directory: 'ver/us/build/assets/us/sprite/npc/Hellfarch.Yay0' ninja: build stopped: subcommand failed.
Recursive Sweatpants
Recursive Sweatpants81d ago
And for full disclosure, I saw in the docs that apparently you can use Star Rod with the decomp by using the decomp repo as the mod folder. I set it and mindlessly hit Dump ROM Assets. I'm not sure what exactly it changed or added, if anything, but if that ended up screwing me over then let me know how I can wipe everything clean and start over. The Sprite and Map editors don't work properly anymore as well.
No description
Wrymouth
Wrymouth81d ago
that's fine, the decomp tools won't look in the dump folders at worst they're now cluttering up your decomp repo the only thing it really changes is the format in which maps are exported, but something about that broke last year too ah yeah the thing that broke was the map editor itself
bates64
bates6481d ago
you're better off having your star rod target rom not be in the wsl filesystem theres a huge performance penalty
Recursive Sweatpants
Recursive Sweatpants79d ago
Alright, I'll leave Star Rod out of the decomp for now then. I'm still getting the above error, however.
bates64
bates6479d ago
FileNotFoundError: [Errno 2] No such file or directory: 'ver/us/build/assets/us/sprite/npc/Hellfarch.Yay0' this?
Recursive Sweatpants
Recursive Sweatpants79d ago
Yeah. I went through the docs though and I haven't run ./configure again, so I'll try that.
bates64
bates6479d ago
yes, this seems like a configure issue try ./configure --clean if that doesn't work. it'll resplit and configure ninja to rebuild everything from scratch
Recursive Sweatpants
Recursive Sweatpants78d ago
Okay yeah, I think that worked! Now I'm just getting an error that my sprite heights have to be a multiple of 8, when Star Rod accepted multiples of 4. Easy fix though. Here's a best practices question: according to the documentation, when adding new assets like sprites, it's best to create a new folder under assets and edit splat.yaml to include that folder in the asset stack. Should I put every new file I make into that folder, like header files for new NPCs and the like? Or just "content" assets like sprites and maps?
bates64
bates6478d ago
code (*.c, *.h) can't be put in assets for now
Or just "content" assets like sprites and maps
this
Recursive Sweatpants
Recursive Sweatpants78d ago
Gotcha!
bates64
bates6478d ago
how are you finding it? what have you tried to do so far?
Recursive Sweatpants
Recursive Sweatpants78d ago
I've just tried to recreate what I did in Star Rod, which was make two custom NPCs. I'll admit I haven't spent a whole lot of time on it this week. So far my biggest issues were not fully understanding the workflow. Things like "you have to run ./configure whenever you add or modify assets" are mentioned in the documentation but the importance isn't emphasized a whole lot. There are also things like the fact that you have to edit multiple different files to place a new NPC into a map or you have to edit npc.xml to add a new custom npc to the list aren't very intuitive. Now that I know these things I can start figuring things out myself, but otherwise that's why I've had to ask for help here so often. I did however have a much easier time learning by example. Your simple guide on adding Gourmet Guy to a map for example helped a ton, just as Wrymouth's NPC guide for Star Rod did. Having guides for doing simple stuff like that which also explain how and why things are set up the way they are would help new users tremendously, I feel.
bates64
bates6478d ago
I agree with a lot of this I think it would be great to have guides on the docs that walk users through how to do certain common tasks they just havent been written yet some of this stuff is in flux too and will become easier in the near future re: configure. this used to not be the case, and the build command would effectively auto configure when files changed. however this added a bit of slowdown i might be able to look closer into it in future the general thing is, if ninja fails, try to configure and then reninja, if it still fails try configure clean and reninja, if it still fails something is very incorrect in your changes
Want results from more Discord servers?
Add your server
More Posts
As someone who has absolutely ZERO experience with mods. Can I get the PMMQ Jr. download link?When I say zero experience. I mean ZERO experience. This is my very very first time. I have never plI need some help getting Paper Mario TTYD64 working. Also can't seem to find the .bsp file:FeelsRegAllocMan:master quest keeps on crashingi tryde with project 64 it worked easily but my jump action commands will triger a cras if i use theCreating ISOs for TTYDIs there a way to properly create a iso game image with ttyd? Seems like as soon as I try to run ```TTYD: Infinite PitSo this mod now freezes the game every time I try to start it not sure what to doCamera Teleportation BehaviorIs there a way to have the camera instantly teleport to Mario's location instead of having it move tIs it possible to modify Mario's movesSo, I was wondering if it's possible to modify Mario's jump and hammer type moves where it does a cuMario's eye texture problem ttydHey guys! long time no see, so im making a paper Mario ttyd mod that replaces stuff with sonic charaStruggling to make a texture 128x64 instead of 128x32 (IA 8b)it cuts the top half of it...I have a errorI'm trying to compile TTYD64 and i get this errorHow to do adaptive musicHere's how to change BGM track volumes dynamically in response to gameplay. call `bgm_set_track_volProblem with Star RodI've posted this on #modding, but I'm gonna post it here so more people can see it and help. I trieCustom MusicHow do I add custom music? I've seen a tutorial on youtube using n64miditool and a guy that said thaStar Rod Helphow do i Change enemies HPStar RodI need help With This ErrorBook of Mario romhack helpHello! I recently purchased an ED64 Plus and tried booting Book of Mario, but I’m getting this pop uNeed help pleaseI’m on dolphin emulator trying to download the infinite pit mod for ttyd and I want to use a gci folFailed to create shader SpriteShader nullI get this error whenever I try to open the sprite editor in Star Rod. I'll post the log in a bit.Adding new Debuff - Frozen status issue #1 of 2Hello, I'm resurfacing this issue when enabling Frozen Status for enemies adding this code enables [Solved] Issue with loading custom mapI tried loading a custom map I began making as a way to figure out how to make maps, but when I try