LarsFlieger
Member
I'm trying to get an result from a fetch in gamemaker. I have a
I map the getMap function with the game maker editor to a function. When I call this function I'm not able to get the result with ds_map. Does anyone know how to do that? Is it even possible to get a promise request in GML?
Best regards,
Lars.
client.js
file with the following code:
JavaScript:
async function getMap(id) {
const data = await fetch(`http://localhost:3000/map/${id}`)
const map = await data.json()
return map
}
/*
Maps looks like this:
{
id: 1,
name: "Map Name",
author: "Michael",
data: "example"
}
*/
Best regards,
Lars.