Indie game storeFree gamesFun gamesHorror games
Game developmentAssetsComics
SalesBundles
Jobs
Tags

GMLive.gml

Livecoding for GameMaker: Studio / GameMaker Studio 2 · By YellowAfterlife

Do ports not work the same when using GMLive?

A topic by PelicanPolice created May 27, 2021 Views: 155 Replies: 5
Viewing posts 1 to 4

My game uses sockets and doesn't seem to be able to connect to itself or anyone else anymore when using the extension. Is there anything different about how I should go about this?

It seems like the async event doesn't trigger anymore?

Developer(+1)

The extension cannot interfere with async events, but there is a possibility that the GMS1 version is missing return value marks in some network_ or buffer_ functions, which can be addressed like

// in obj_gmlive Create
gml_func_add("network_connect(socket, url, port):", scr_network_connect);

and then

/// scr_network_connect(socket, url, port)
return network_connect(argument0,argument1,argument2);

(or by editing GMLAPI.gml)

So do I need to write the equivalent of that for every single network_ and buffer_ function that I've used? And is the : meant to be a : or a ;

Developer (1 edit) (+1)

You would need to write that for functions that do not work correctly as-is and return 0 instead of the intended value (it wasn’t until GMS2.3 that scripts with no return values would return a more meaningful undefined). The exact functions can be established by testing or by comparing existing wrappers in GMLAPI.gml to the manual.

: is a colon, which for GMLive indicates that a function is expected to return something.

(1 edit)

So I tested a simple new project and it worked exactly as expected with GMLive

Create udp socket -> obtain local ip via broadcast -> send packet to self (network_send_udp_raw) -> packet arrives fine.

I then tried my project again without GMLive and it still wasn't working. I'm thinking it could be because I restarted my computer before adding GMLive which caused my local ip to change. That's the first time that's happened in a while so it broke some things.

Now that I've fixed that, I have yet to try installing GMLive again on this project because I think I it's better suited for me when I'm tweaking UI, and actually slows down general purpose development for me. 

But for future readers I think the error here was actually on my end.