Closed ngrealish closed 11 months ago
I've made a branch, but I can't test it out because of OpenAI's API rate limits. Feel free to try it out at FlooferLand/unifree/tree/ternary and provide any feedback!
@FlooferLand I think we have a more comprehensive solution with the RAG LLM approach (https://github.com/ProjectUnifree/unifree/pull/47)
@ngrealish once the PR above is merged ternary operator would be translated correctly.
PLEASE FILE TRANSLATION REQUESTS We now have a framework to accommodate them.
Fix has been merged into master.
In C# / Unity, to write a Ternary operator, syntax is
variable = (condition) ? true : false;
Where in GDScript, it's
variable = true if (condition) else false
Here is an example from one of my projects:
C#:
max_pos.x = (booster_offset.x > max_pos.x) ? booster_offset.x : max_pos.x
GDScript:max_pos.x = booster_offset.x if (booster_offset.x > max_pos.x) else max_pos.x
If there's a way to add this to the conversion or train gpt for this, that'd be great for someone like me who uses ternary operators quite often.