I’m developing an improved version of Infinite Craft (just for fun), and everything was going smoothly until suddenly none of the elements work anymore. The whole system is glitching, and even when I revert to older versions, they stop functioning too. Has anyone experienced this or knows how to fix it?
here is my code click view markdown to view (it was too big to post)
If reverting to older versions doesn’t work, then presumably it’s not a change in your code that broke it, but a change in the API, no? That’s always the risk when relying on external services for a core part of your game.
Are there any error’s in the web-browser’s Web Developer Tools Console?
My Console showed the following two error messages when I tried to combine Earth & Fire.
POST https://api.groq.com/openai/v1/chat/completions 401 (Unauthorized)
AI Error: Error: API Request Failed: 401 - {"error":{"message":"Invalid API Key","type":"invalid_request_error","code":"invalid_api_key"}}
at Game.fetchCombinationFromAI (primal.html:2572:19)
at async Game.mergeElements (primal.html:2523:30)
Which clearly indicates that Groq was rejecting the requests from the HTML file, because they were Unauthorized due to an Invalid API Key being provided with the requests.