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?
Livecoding for GameMaker: Studio / GameMaker Studio 2 · By
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)
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.
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.