I have now made a tutorial for the dll! Its in the zip and its called tutorial.rtf.
I also updated the dll and scripts so if you have already started making your game using the old scripts then to use the new ones do this:
Under scripts, remove the folder the dll scripts are in
Go to File->Merge game and select the DllScripts.gm6
The only real update to it is writestring() and readstring() are more extensive and now requires less programming to use.
This is the old way you could of used writestring() and readstring() (you can still do it this way in the new update):
readstring(bytesleft()); //had to put how much letters to recieve.
Thats all well and good if your only sending one string over winsock, but what if you want to something like x, y, user and password in one message? How are you going to know how long the username string is and the password string? The new update makes strings alot easier to use because you can use them like readshort() or readint() where you dont have to give an argument.
//Write the data
//Reading the data
x = readshort();
y = readshort();
username = readstring();
password = readstring();
How does it work? Simple. If you set the second argument in writestring() to
true then that means to add a Null (ascii code 0) terminator character after the string. Now when you dont set argument0 or if argument0 is 0 in readstring() then it tells the dll to read until it reaches the null terminator.
What if i want to send a string over a text based protocol..Text bases protocols dont allow the ascii code 0.
You can define your own seperator string other than the ascii code 0!
//Writing the data
writestring(username + ":" + password + ":");
//Reading the data
username = readstring(0, ":");
password = readstring(0, ":");
Warning: Do not write a string with a null terminator if your going to read it using your own seperating string! This will crash the game.
Also i have removed the splitstring() function because its not needed anymore!
Edited by 39ster, 05 July 2005 - 09:38 AM.