Initial soh_ap transpiler - #1
Conversation
Get Basic output generating for soh_ap
…t of rls_match.py for now
Add SharedSpirit. May need special attention when creating the SharedSpirit functions. Fixed function definitions not having default values for parameters.
|
Thanks for taking this on, this is great progress! Things to solve: std::string SohApTranspiler::GenerateExpression(const rls::ast::Identifier& node) const {
auto type = project.getType(&node);
if (!type.has_value()) {
return node.name;
}
switch (type.value()) {
case rls::ast::Type::Distance:
return "EnemyDistance." + node.name;
default:
return node.name;
}
} |
|
Awesome! Thank you for the feedback. I just fixed the other places that needed to be renamed in my local repo. I'll work on implementing some of this. Going to need some time though 😅 |
|
I changed |
Add basic enum identifier. Still needs work. Fix lambdas
|
I think the most recent changes should fix how I was using Made the
This works in some cases, but not all. As an example: This works because we needed to define the items we need to use: This example doesn't work though. Trying to use the |
|
Ok, we should be able to distinguish the two now. https://github.com/xxAtrain223/RandoLogicScript/compare/fae58bb0668a25d9f546c5ee3347fb7e2c52de82..dbbd70f69a833640207126df5f3856e9bfe2f866#diff-9ba7a3ed12ed289f9433d9fb999b958866e19bcdf44e829e35ae45ce577e1bd1
|
|
Sounds good to me. I'll implement this asap. Just a list of things I need to do so I remember:
|
Add enum types to access rules Add event locations Brainstorm settings
add locations enum
…alls from output.
- Disable function creation for now - Update enum names to match upstream Ship AP - Fix duplicated values in enum output - Add enum value method for fixing names in python
Add OptionFilter unit tests
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Fix up remaining OptionFilter issues i could think of. Add more unit tests. Make rls_match work with RB. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
…nal rules Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Key renderEnumValue/pythonTypeName on the RLS enum name instead of ast::Type, and lower MemberExpr, StringLiteral and ListExpr. Generate normal RLS enums into enums.gen.py as IntEnums; extern enums are glob patterns with no members, so the world still supplies those. Declared enums render under their own class name, so WaterLevel no longer folds into Events. Also fix the console rejecting `-t soh_ap` (the guard checked "ap" while the dispatch checked "soh_ap") and a missing <algorithm> include in the sema tests. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Hello!
Been working on this on and off, and I finally have something I think (mostly) works.
Some of the biggest changes include:
aptosoh_ap. It makes it clearer what game it is for. (May have missed some places that needed to be changed over. Please lmk as I am bad at c++ and cmake stuff)sohexample here. Kept the structure as similar as possible while modifying any c++ output to python (or close to. Will need to have more discussions about this)rls_matchfunctionality. Again this was me following along with your example, but I did have to do some wacky python stuff in here, so I figured I would call it out.Now on to things that I noticed about what is currently auto generating that I am not exactly sure how we are going to solve.
regions.gen.pya requirement we will need for Ship AP is that we pass theworld(orbundle. This is tuple of stuff we crammed together to more easily pass things to all the functions). Not sure how we are going to modify for exampleis_child()andhas(RG_OPEN_CHEST)to also pass our arbitrary junk. Maybe replace one of the parenthesis?&forand, and|foror. But there are times when we may need to compare bools together. I'm not 100% sure how I would make this context known with the existingBinaryExpr.I think you have done a great job so far! Most of this stuff seems like wizardry to me, but it is incredible to see it come together. Please feel free to tear all of this apart because I won't lie, I barely know what I am doing.
edit: Also I think a valid answer to any of the weird and wacky things I said above could be "That would be crazy to try and add to this". I think a huge win for Ship AP would be if we could auto generate both the functions and the regions/locations/events/exits, but honestly even if we could just get one of them (preferably the regions/etc) I would be happy 😄