Suche Multiplayertutorial (bis 4 Spieler)

  • GM 8

Diese Seite verwendet Cookies. Durch die Nutzung unserer Seite erklären Sie sich damit einverstanden, dass wir Cookies setzen. Weitere Informationen

  • Suche Multiplayertutorial (bis 4 Spieler)

    Hallo,

    ich suche ein Multiplayer(online) Tutorial, bisher habe ich nur das auf deutsch gefunden: GM 8 Simple Platform Online Multiplayer für 2 Spieler

    Es sollten bis 4 Spieler spielen können und es sollte eine Liste geben, in der gerade alle aktuellen Server laufen.
    Ein Chat wäre auch schön aber ist nicht notwendig. Ich hoffe ihr kennt ein Tutorial, dass meine Erwartungen erfüllen.


    MFG Dufner
    Husi012 hat mich nicht mehr in seiner Signatur, ich bin trotzdem noch fame.
  • Ich weiß nicht, ob du mit dem DLL's arbeiten willst oder auch mit der Standard-Funktion vom Game Maker.
    Ansonsten kannst du meinen Tutorial mal anschauen, ist nicht erklärbar gemacht worden, aber eigentlich sehr Simple. Dort kann man auch bis zur 4 Spielern spielen, allerdings müsstest du die Server-liste selber noch dazu erstellen.


    Du findest das Tutorial hier:


    Spoiler anzeigen
    http://www.gm-d.de/wbb/index.php/Thread/20946/
  • Ich würde nicht die mplay-Funktionen einfacher einstufen als die Verwendung der 39dll.
    Die 39dll ist nicht so Performance-lastig, weil du die Größe der Pakete, die von Clients an Server und umgekehrt, bestimmen kannst! Dadurch kann man sich viel Performance sparen.
    Zu dem finde ich die Verwendung der 39dll wirklich einfacher zu verstehen und kann dir diese eher ans Herz legen. Ich kenne keine Online-Engine oder gescheites Multiplayerspiel, das ohne die 39dll mit Game Maker erstellt wurde. Tutorials gibt es genug, auch hier im Forum wirst du ein paar finden. Was Online-Engine betrifft, wirst du dich warscheinlich an die Englische Game Maker Community, YouTube oder Google wenden dürfen. Soweit ich weiß gibt es in diesem Forum, auch nicht wirklich ein Tutorial über ein Multiplayer mit Unbegrenzten Clients, also nicht nur Zwei. Sowas könnte meiner Meinung auch mal nicht schaden, da ich mich sowieso über die Umsetzung interessiere.
  • Dufner schrieb:

    oke ^^ bevor ich mich da reinlese, weisst du ob erklärt wird, wie man es bis zu viert spielen kann und ob es auch computer, die sich bewegen synchroniesiert werden?

    Keine ahnung grade, les es dir doch einfach mal kurz durch?
    Und zum anderen, klar wieso auch nicht? Erklärt weis ich nicht, machbar ist es aber, wieso auch nicht.
  • Bei jedem schwartz geschriebenem code wo #... steht

    Quellcode

    1. #define dllinit
    2. /*
    3. Initializes the dll.
    4. Argument0: The dll filename. Set this argument to 0 if you want to use "39dll.dll"
    5. Argument1: Set to true to load socket functions
    6. Argument2: Set to true to load utilities.
    7. */
    8. global._39dll = argument0;
    9. if(is_real(argument0))global._39dll= "39dll.dll";
    10. external_call(external_define(global._39dll, "dllInit", dll_cdecl, ty_real, 0));
    11. //Buffer
    12. global._BufA = external_define(global._39dll, "writebyte", dll_cdecl, ty_real, 2, ty_real,ty_real);
    13. global._BufB = external_define(global._39dll, "writestring", dll_cdecl, ty_real, 2, ty_string, ty_real);
    14. global._BufC = external_define(global._39dll, "writeshort", dll_cdecl, ty_real, 2, ty_real, ty_real);
    15. global._BufD = external_define(global._39dll, "writeint", dll_cdecl, ty_real, 2, ty_real, ty_real);
    16. global._BufE = external_define(global._39dll, "writefloat", dll_cdecl, ty_real, 2, ty_real, ty_real);
    17. global._BufF = external_define(global._39dll, "writedouble", dll_cdecl, ty_real, 2, ty_real, ty_real);
    18. global._BufG = external_define(global._39dll, "readbyte", dll_cdecl, ty_real, 1, ty_real);
    19. global._BufH = external_define(global._39dll, "readstring", dll_cdecl, ty_string, 1, ty_real);
    20. global._BufI = external_define(global._39dll, "readshort", dll_cdecl, ty_real, 1, ty_real);
    21. global._BufJ = external_define(global._39dll, "readint", dll_cdecl, ty_real, 1, ty_real);
    22. global._BufK = external_define(global._39dll, "readfloat", dll_cdecl, ty_real, 1, ty_real);
    23. global._BufL = external_define(global._39dll, "readdouble", dll_cdecl, ty_real, 1, ty_real);
    24. global._BufM = external_define(global._39dll, "clearbuffer", dll_cdecl, ty_real, 1, ty_real);
    25. global._BufN = external_define(global._39dll, "setpos", dll_cdecl, ty_real, 2, ty_real, ty_real);
    26. global._BufO = external_define(global._39dll, "getpos", dll_cdecl, ty_real, 2, ty_real, ty_real);
    27. global._BufQ = external_define(global._39dll, "buffsize", dll_cdecl, ty_real, 1, ty_real);
    28. global._BufR = external_define(global._39dll, "writechars", dll_cdecl, ty_real, 2, ty_string, ty_real);
    29. global._BufS = external_define(global._39dll, "readchars", dll_cdecl, ty_string, 2, ty_real, ty_real);
    30. global._BufU = external_define(global._39dll, "createbuffer", dll_cdecl, ty_real, 0);
    31. global._BufX = external_define(global._39dll, "freebuffer", dll_cdecl, ty_real, 1, ty_real);
    32. global._BufY = external_define(global._39dll, "writeushort", dll_cdecl, ty_real, 2, ty_real, ty_real);
    33. global._BufZ = external_define(global._39dll, "writeuint", dll_cdecl, ty_real, 2, ty_real, ty_real);
    34. global._BufAA = external_define(global._39dll, "readushort", dll_cdecl, ty_real, 1, ty_real);
    35. global._BufAB = external_define(global._39dll, "readuint", dll_cdecl, ty_real, 1, ty_real);
    36. global._BufAC = external_define(global._39dll, "copybuffer", dll_cdecl, ty_real, 2, ty_real, ty_real);
    37. global._BufAD = external_define(global._39dll, "copybuffer2", dll_cdecl, ty_real,4 , ty_real, ty_real, ty_real, ty_real);
    38. global._BufAE = external_define(global._39dll, "bytesleft", dll_cdecl, ty_real, 1, ty_real);
    39. global._BufAF = external_define(global._39dll, "bufferexists", dll_cdecl, ty_real, 1, ty_real);
    40. global._BufAG = external_define(global._39dll, "readsep", dll_cdecl, ty_string, 2, ty_string, ty_real);
    41. if(argument1)
    42. {
    43. //Sockets
    44. global._SokA = external_define(global._39dll, "tcpconnect", dll_cdecl, ty_real, 3, ty_string, ty_real, ty_real);
    45. global._SokB = external_define(global._39dll, "tcplisten", dll_cdecl, ty_real, 3, ty_real, ty_real, ty_real);
    46. global._SokC = external_define(global._39dll, "tcpaccept", dll_cdecl, ty_real, 2, ty_real, ty_real);
    47. global._SokD = external_define(global._39dll, "sendmessage", dll_cdecl, ty_real, 4, ty_real, ty_string, ty_real, ty_real);
    48. global._SokE = external_define(global._39dll, "receivemessage", dll_cdecl, ty_real, 3, ty_real, ty_real, ty_real);
    49. global._SokF = external_define(global._39dll, "setsync", dll_cdecl, ty_real, 2, ty_real, ty_real);
    50. global._SokG = external_define(global._39dll, "setformat", dll_cdecl, ty_real, 3, ty_real, ty_real, ty_string);
    51. global._SokH = external_define(global._39dll, "udpconnect", dll_cdecl, ty_real, 2, ty_real, ty_real);
    52. global._SokI = external_define(global._39dll, "hostip", dll_cdecl, ty_string, 1, ty_string);
    53. global._SokJ = external_define(global._39dll, "lastinIP", dll_cdecl, ty_string, 0);
    54. global._SokK = external_define(global._39dll, "closesock", dll_cdecl, ty_real, 1, ty_real);
    55. global._SokL = external_define(global._39dll, "tcpip", dll_cdecl, ty_string, 1, ty_real);
    56. global._SokM = external_define(global._39dll, "socklasterror", dll_cdecl, ty_real, 0);
    57. global._SokN = external_define(global._39dll, "myhost", dll_cdecl, ty_string, 0);
    58. global._SokO = external_define(global._39dll, "compareip", dll_cdecl, ty_real, 2, ty_string, ty_string);
    59. global._SokP = external_define(global._39dll, "sockexit", dll_cdecl, ty_real, 0);
    60. global._SokQ = external_define(global._39dll, "sockstart", dll_cdecl, ty_real, 0);
    61. global._SokR = external_define(global._39dll, "getmacaddress", dll_cdecl, ty_string, 0);
    62. global._SokS = external_define(global._39dll, "peekmessage", dll_cdecl, ty_real, 3, ty_real, ty_real, ty_real);
    63. global._SokT = external_define(global._39dll, "setnagle", dll_cdecl, ty_real, 2, ty_real, ty_real);
    64. global._SokU = external_define(global._39dll, "tcpconnected", dll_cdecl, ty_real, 1, ty_real);
    65. global._SokX = external_define(global._39dll, "getsocketid", dll_cdecl, ty_real, 1, ty_real);
    66. global._SokY = external_define(global._39dll, "lastinPort", dll_cdecl, ty_real, 0);
    67. }
    68. if(argument2)
    69. {
    70. //File functions
    71. global._FilA = external_define(global._39dll, "fileopen", dll_cdecl, ty_real, 2, ty_string, ty_real);
    72. global._FilB = external_define(global._39dll, "fileclose", dll_cdecl, ty_real, 1, ty_real);
    73. global._FilC = external_define(global._39dll, "filewrite", dll_cdecl, ty_real, 2, ty_real, ty_real);
    74. global._FilD = external_define(global._39dll, "fileread", dll_cdecl, ty_real, 3, ty_real, ty_real, ty_real);
    75. global._FilE = external_define(global._39dll, "filepos", dll_cdecl, ty_real, 1, ty_real);
    76. global._FilF = external_define(global._39dll, "filesetpos", dll_cdecl, ty_real, 2, ty_real, ty_real);
    77. global._FilG = external_define(global._39dll, "filesize", dll_cdecl, ty_real, 1, ty_real);
    78. global._UtilA = external_define(global._39dll, "md5string", dll_cdecl, ty_string, 1, ty_string);
    79. global._UtilB = external_define(global._39dll, "md5buffer", dll_cdecl, ty_string, 1, ty_real);
    80. global._UtilC = external_define(global._39dll, "adler32", dll_cdecl, ty_real, 1, ty_real);
    81. global._UtilD = external_define(global._39dll, "bufferencrypt", dll_cdecl, ty_real, 2, ty_string, ty_real);
    82. global._UtilE = external_define(global._39dll, "iptouint", dll_cdecl, ty_real, 1, ty_string);
    83. global._UtilF = external_define(global._39dll, "uinttoip", dll_cdecl, ty_string, 1, ty_real);
    84. global._UtilG = external_define(global._39dll, "netconnected", dll_cdecl, ty_real, 0);
    85. }
    86. #define dllfree
    87. external_free(global._39dll);
    88. #define tcpconnect
    89. /*
    90. creates a socket and connects to the ip and port
    91. Argument0 = Ip to connect to.
    92. Argument1 = Port to connect to.
    93. Argument2 = Blocking(0)/Non-blocking(1)/Non-blocking++(2) mode.
    94. Set argument2 to 2 if you want it to be non-blocking and also not freeze
    95. the game while it is connecting. Use tcpconnected() to find out when it has
    96. connected
    97. */
    98. return external_call(global._SokA, argument0, argument1, argument2);
    99. #define tcplisten
    100. /*
    101. Creates a listening socket to monitor a certain port for incoming
    102. connections.
    103. Argument0 = Port to listen on
    104. Argument1 = Max amount of people allowed to be in the connected but not
    105. accepted list
    106. Argument2 = Blocking(0)/Non-Blocking(1) mode. Affects the tcpaccept script.
    107. returns the id of the socket or a negative error code.
    108. */
    109. return external_call(global._SokB, argument0, argument1, argument2);
    110. #define tcpaccept
    111. /*
    112. Accepts any incoming connections on a listening socket.
    113. Argument0 = Listening socket.
    114. Argument1 = Blocking/Non-Blocking mode.
    115. returns the id of a newly created socket or a negative number.
    116. */
    117. return external_call(global._SokC, argument0, argument1);
    118. #define tcpip
    119. //Returns the ip that the socket is connected to.
    120. //Argument 0 = socket id.
    121. return external_call(global._SokL, argument0);
    122. #define setnagle
    123. /*
    124. Turns on/off the naggle (TCP_NODELAY) algorithm.
    125. argument0 = socket id to affect
    126. argument1 = true/false (true means NODELAY, false means DELAY)
    127. */
    128. return external_call(global._SokT, argument0, argument1);
    129. #define tcpconnected
    130. /*
    131. argument0 = Socket id to check
    132. Returns true if the tcp socket is connected to a local/remote host.
    133. */
    134. return external_call(global._SokU, argument0);
    135. #define udpconnect
    136. /*
    137. Creates a udp socket.
    138. Argument0 = Port to use.
    139. Argument1 = Blocking/non-blocking mode.
    140. HOW TO SEND MESSAGES:
    141. sendmessage(sockid, "ip.to.send.to", portosendto, [bufferid]);
    142. */
    143. return external_call(global._SokH, argument0, argument1);
    144. #define sendmessage
    145. /*
    146. Sends the data in a buffer through the selected tcp or udp socket.
    147. Argument0 = Socket to send to.
    148. [Argument1] = Ip to send to (for udp sockets)
    149. [Argument2] = Port to send to (for udp socket)
    150. [Argument3]: The buffer id to send. Leave out this argument or set
    151. it to 0 to use the default buffer.
    152. Returns the amount of bytes sent + the bytes used to format the message
    153. NOTE:
    154. If you're sending over a tcp socket and dont want to use the default buffer
    155. than send a message like this:
    156. sendmessage(sockid, "", 0, bufferid);
    157. */
    158. return external_call(global._SokD, argument0, argument1, argument2, argument3);
    159. #define receivemessage
    160. /*
    161. Receives data from the selected tcp or udp socket and copies to the
    162. internal buffer.
    163. Argument0 = Socket to recieve from.
    164. [Argument1] = Amount of bytes to receive. Optional. Overrides the format
    165. mode if used.
    166. [Argument2]: The buffer id to receive to. Leave out this argument or set
    167. it to 0 to use the default buffer.
    168. returns the amount of bytes recieved
    169. NOTE:
    170. If you dont want to save the data to the defualt buffer, than do it like this:
    171. receivemessage(sockid, 0, bufferid);
    172. */
    173. return external_call(global._SokE, argument0, argument1, argument2);
    174. #define peekmessage
    175. /*
    176. Copies any data recieved on a specified socket to the internal buffer but
    177. does not remove it from the recv buffer.
    178. Argument0 = TCP or UDP socket to recieve from
    179. [Argument1] = Bytes to receive. Optional (otherwise receives as much as
    180. possible)
    181. [Argument2]: The buffer id to receive to. Leave out this argument or set
    182. it to 0 to use the default buffer.
    183. Returns amount of bytes recieved.
    184. NOTE:
    185. If you dont want to save the data to the defualt buffer, than do it like this:
    186. peekmessage(sockid, 0, bufferid);
    187. or peekmessage(sockid, bytestoreceive, bufferid);
    188. */
    189. return external_call(global._SokS, argument0, argument1, argument2);
    190. #define setformat
    191. /*
    192. When sending messages over a tcp socket the messages need to be seperated.
    193. The dll provides two methods of seperation.
    194. Method 0: Binary mode. Setting this mode makes every tcp message have a 2 byte
    195. integer attached at the front which represents the amount of data in that
    196. message. This is the default method and is reccomended in online games.
    197. Method 1: Text mode. Setting this mode makes every tcp message have a delimeter
    198. added at the end which is used to identify the end of the message. This is
    199. reccomended for text based protocols like irc.
    200. Method 2: No formatting. Only the data in the internal buffer is sent and
    201. no seperation methods are included.
    202. Argument0 = socket id
    203. Argument1 = method number
    204. [Argument2] = seperation string when using method 1.
    205. MAKE SURE THE CORRECT FORMAT MODE IS SET WHEN RECIEVING A MESSAGE THAT IS IN A
    206. SPECIFIC FORMAT.
    207. returns argument0
    208. */
    209. return external_call(global._SokG, argument0, argument1, argument2);
    210. #define lastinIP
    211. /*
    212. Returns the last incoming IP received from any of the sockets.
    213. It will return an IP from the following situations:
    214. 1. When you receive a message, lastinIP() will return the IP
    215. address of the person who sent that message.
    216. 2. When you've just accepted a connection with tcpaccept(), lastinIP()
    217. will return the ip address of the computer that was accepted.
    218. */
    219. return external_call(global._SokJ);
    220. #define lastinPort
    221. /*
    222. Returns the last incoming port number received from any of the sockets.
    223. It will return a port number from the following situations:
    224. 1. When you receive a message, lastinPort() will return the senders
    225. port number that theyre using to send the message.
    226. */
    227. return external_call(global._SokY);
    228. #define setsync
    229. /*
    230. Changes the blocking/non-blocking mode of a socket.
    231. Argument0 = Socket to change.
    232. Argument1 = Mode to set to. 0 = Blocking. 1 = Non-blocking.
    233. */
    234. return external_call(global._SokF, argument0, argument1);
    235. #define closesocket
    236. /*
    237. Disconnects and frees the selected socket.
    238. Argument0: socket id to close
    239. */
    240. return external_call(global._SokK, argument0);
    241. #define socklasterror
    242. //Returns the error code for the last socket related error.
    243. //It will be a negative number.
    244. return external_call(global._SokM);
    245. #define myhost
    246. //Returns your host name
    247. return external_call(global._SokN);
    248. #define compareip
    249. /*
    250. This script compares an ip to a masked ip. Will return true if they match.
    251. e.g 127.0.0.1 matches 127.0.0.*
    252. e.g 127.1.0.1 does not match 127.0.0.*
    253. Useful when banning hackers who have a dynamic ip.
    254. Argument0 = Ip
    255. Argument1 = Masked ip.
    256. */
    257. return external_call(global._SokO, argument1, argument0);
    258. #define sockexit
    259. //Call this when you want to free winsock. (The dll automatically does this
    260. //when you free the dll)
    261. return external_call(global._SokP);
    262. #define sockstart
    263. //Call this when you want to start winsock only after you have used sockexit()
    264. return external_call(global._SokQ);
    265. #define hostip
    266. /*
    267. Gets the ip of the specified host name.
    268. Argument0 = host name.
    269. returns the ip address.
    270. */return external_call(global._SokI, argument0);
    271. #define getsockid
    272. /*
    273. Argument0: Socket id to get the WINSOCK id from.
    274. returns: the WINSOCK id associated with the socket object.
    275. */
    276. return external_call(global._SokX, argument0);
    277. #define writebyte
    278. /*
    279. Write 1 byte. The value can be between 0 and 255
    280. Argument0 : value;
    281. [Argument1]: The buffer id to write too. Leave out this argument or set
    282. it to 0 to use the default buffer.
    283. */
    284. return external_call(global._BufA, argument0, argument1);
    285. #define writeshort
    286. /*
    287. Writes a 2 byte integer to the buffer. the value can be between
    288. -32768 and +32767
    289. Argument0 : value
    290. [Argument1]: The buffer id to write too. Leave out this argument or set
    291. it to 0 to use the default buffer.
    292. */
    293. return external_call(global._BufC, argument0, argument1);
    294. #define writeushort
    295. /*
    296. Writes a 2 byte UNSIGNED integer to the buffer. the value can be between
    297. 0 and +65536
    298. Argument0 : value
    299. [Argument1]: The buffer id to write too. Leave out this argument or set
    300. it to 0 to use the default buffer.
    301. */
    302. return external_call(global._BufY, argument0, argument1);
    303. #define writeint
    304. /*
    305. Writes a 4 byte integer to the internal buffer. The value can be between
    306. -2147483648 and +2147483647
    307. Argument0: value
    308. [Argument1]: The buffer id to write too. Leave out this argument or set
    309. it to 0 to use the default buffer.
    310. */
    311. return external_call(global._BufD, argument0, argument1);
    312. #define writeuint
    313. /*
    314. Writes a 4 byte UNSIGNED integer to the internal buffer. The value can be between
    315. 0 and +4294967296
    316. Argument0: value
    317. [Argument1]: The buffer id to write too. Leave out this argument or set
    318. it to 0 to use the default buffer.
    319. */
    320. return external_call(global._BufD, argument0, argument1);
    321. #define writefloat
    322. /*
    323. Writes a 4 byte real number (number that can contain a decimal place).
    324. Argument0: Value;
    325. [Argument1]: The buffer id to write too. Leave out this argument or set
    326. it to 0 to use the default buffer.
    327. */
    328. return external_call(global._BufE, argument0, argument1);
    329. #define writedouble
    330. /*
    331. Same as writefloat but the number can be much larger. It can write any number GM supports.
    332. Warning: It uses 8 bytes!!
    333. Argument0: value.
    334. [Argument1]: The buffer id to write too. Leave out this argument or set
    335. it to 0 to use the default buffer.
    336. */
    337. return external_call(global._BufF, argument0, argument1);
    338. #define writechars
    339. /*
    340. Writes a sequence of characters to the buffer.
    341. Argument0: String to write.
    342. [Argument1]: The buffer id to write too. Leave out this argument or set
    343. it to 0 to use the default buffer.
    344. */
    345. return external_call(global._BufR, argument0, argument1);
    346. #define writestring
    347. /*
    348. Write a null terminated string to the buffer
    349. Warning: DO NOT set argument1 to true like you would in the old method. Doing this
    350. will make it try and write to a buffer with the ID of 1 (1 = true)
    351. Argument0 = String to write.
    352. [Argument1]: The buffer id to write too. Leave out this argument or set
    353. it to 0 to use the default buffer.
    354. */
    355. return external_call(global._BufB, argument0, argument1);
    356. #define copybuffer
    357. /*
    358. appends one buffers data to the end of another
    359. Argument0 = destination buffer;
    360. Argument1 = Source buffer
    361. note: 0 is default buffer
    362. */
    363. return external_call(global._BufAC, argument0, argument1);
    364. #define copybuffer2
    365. /*
    366. appends PART of one buffers data to the end of another
    367. Argument0 = destination buffer;
    368. Argument1 = start pos in source buffer
    369. Argument2 = Number of bytes to copy from source
    370. Argument3 = source buffer
    371. */
    372. return external_call(global._BufAD, argument0, argument1, argument2, argument3);
    373. #define readbyte
    374. /*
    375. Returns a byte from the buffer.
    376. [Argument0]: The buffer id to read from. Leave out this argument or set
    377. it to 0 to use the default buffer.
    378. */
    379. return external_call(global._BufG, argument0);
    380. #define readshort
    381. /*
    382. Returns a short int from the buffer.
    383. [Argument0]: The buffer id to read from. Leave out this argument or set
    384. it to 0 to use the default buffer.
    385. */
    386. return external_call(global._BufI, argument0);
    387. #define readushort
    388. /*
    389. Returns a unsigned short int from the buffer.
    390. [Argument0]: The buffer id to read from. Leave out this argument or set
    391. it to 0 to use the default buffer.
    392. */
    393. return external_call(global._BufAA, argument0);
    394. #define readint
    395. /*
    396. Returns a int from the buffer.
    397. [Argument0]: The buffer id to read from. Leave out this argument or set
    398. it to 0 to use the default buffer.
    399. */
    400. return external_call(global._BufJ, argument0);
    401. #define readuint
    402. /*
    403. Returns a unsigned int from the buffer.
    404. [Argument0]: The buffer id to read from. Leave out this argument or set
    405. it to 0 to use the default buffer.
    406. */
    407. return external_call(global._BufAB, argument0);
    408. #define readfloat
    409. /*
    410. Returns a float from the buffer.
    411. [Argument0]: The buffer id to read from. Leave out this argument or set
    412. it to 0 to use the default buffer.
    413. */
    414. return external_call(global._BufK, argument0);
    415. #define readdouble
    416. /*
    417. Returns a double from the buffer.
    418. [Argument0]: The buffer id to read from. Leave out this argument or set
    419. it to 0 to use the default buffer.
    420. */
    421. return external_call(global._BufL, argument0);
    422. #define readchars
    423. /*
    424. Reads a sequence of characters from the buffer.
    425. Argument0: number of charactered to read
    426. [Argument0]: The buffer id to read from. Leave out this argument or set
    427. it to 0 to use the default buffer.
    428. */
    429. return external_call(global._BufS, argument0, argument1);
    430. #define readstring
    431. /*
    432. Returns a null terminated string from the buffer.
    433. [Argument0]: The buffer id to read from. Leave out this argument or set
    434. it to 0 to use the default buffer.
    435. */
    436. return external_call(global._BufH, argument0);
    437. #define readsep
    438. /*
    439. Finds a string in a buffer and returns the data before the string and increments the
    440. buffers readpos.
    441. Argument0: Seperator string.
    442. [Argument1]: The buffer id to read from. Leave out this argument or set
    443. it to 0 to use the default buffer.
    444. Example:
    445. writechars("Hello:World:");
    446. show_message(readsep(":")); //will display "Hello"
    447. show_message(readsep(":")); //will display "World"
    448. */
    449. return external_call(global._BufAG, argument0, argument1);
    450. #define readbit
    451. /*
    452. Reads the bit at a certain position in a number
    453. argument0 = number
    454. argument1 = bit position (0-7)
    455. returns the bit value (true/false)
    456. */
    457. return (argument0 & power(2, argument1))>0;
    458. #define buildbyte
    459. /*
    460. returns a byte based on true/false arguments
    461. argument0-argument7 = bit values
    462. */
    463. return argument0*128 + argument1*64 + argument2*32 + argument3*16 + argument4*8 + argument5*4 + argument6*2 + argument7*1;
    464. #define getpos
    465. /*
    466. Returns the read or write pos
    467. Argument0 = read/write. 0 = write pos. 1 = read pos
    468. [Argument1]: The buffer id to use. Leave out this argument or set
    469. it to 0 to use the default buffer.
    470. */
    471. return external_call(global._BufO, argument0, argument1);
    472. #define clearbuffer
    473. /*
    474. [Argument0]: The buffer id to use. Leave out this argument or set
    475. it to 0 to use the default buffer.
    476. */
    477. return external_call(global._BufM, argument0);
    478. #define buffsize
    479. /*
    480. Returns the amount of bytes in a buffer.
    481. [Argument0]: The buffer id to use. Leave out this argument or set
    482. it to 0 to use the default buffer.
    483. */
    484. return external_call(global._BufQ, argument0);
    485. #define setpos
    486. /*
    487. Sets the read/write pos in a buffer
    488. Argument0 = pos.
    489. [Argument1]: The buffer id to use. Leave out this argument or set
    490. it to 0 to use the default buffer.
    491. */
    492. return external_call(global._BufN, argument0, argument1);
    493. #define bytesleft
    494. /*
    495. Returns how much bytes are left to read. Buffsize-Buffreadpos.
    496. [Argument0]: The buffer id to check how many bytes are left. Leave out this argument or set
    497. it to 0 to use the default buffer.
    498. */
    499. return external_call(global._BufAE, argument0);
    500. #define createbuffer
    501. /*
    502. Creates a new buffer and returns the buffers ID
    503. */
    504. return external_call(global._BufU);
    505. #define freebuffer
    506. /*
    507. Frees (deletes) a buffer. You cannot free the default buffer (0)
    508. Argument0: buffer id
    509. */
    510. return external_call(global._BufX, argument0);
    511. #define bufferexists
    512. /*
    513. Returns true if the buffer exists
    514. Argument0: Buffer id to check if it exists.
    515. */
    516. return external_call(global._BufAF, argument0);
    517. #define md5string
    518. /*
    519. returns a md5 hash of argument0
    520. argument0 = string
    521. */
    522. return external_call(global._UtilA, argument0);
    523. #define md5buffer
    524. /*
    525. returns the MD5 hash of the data inside the buffer
    526. */
    527. return external_call(global._UtilB, argument0);
    528. #define bufferencrypt
    529. /*
    530. Encrypts the buffer with the RC4 encryption algorithm
    531. Argument0 = (string) password.
    532. */
    533. return external_call(global._UtilD, argument0, argument1);
    534. #define bufferdecrypt
    535. /*
    536. same as bufferencrypt but used to prevent confusion on how to decrypt.
    537. Argument0 = (string) password
    538. */
    539. return external_call(global._UtilD, argument0, argument1);
    540. #define fileopen
    541. /*
    542. Opens or creates a file for reading or writing.
    543. Argument0 = Filename.
    544. Argument1 = mode. 0 = reading, 1 = writing, 2 = both reading and writing
    545. Returns a file id.
    546. */
    547. return external_call(global._FilA, argument0, argument1);
    548. #define fileclose
    549. /*
    550. Closes a open file
    551. argument0 = file id
    552. */
    553. return external_call(global._FilB, argument0);
    554. #define filewrite
    555. /*
    556. Writes the data in a buffer into the open file.
    557. argument0 = file id
    558. [Argument1]: The buffer id to read from. Leave out this argument or set
    559. it to 0 to use the default buffer.
    560. */
    561. return external_call(global._FilC, argument0, argument1);
    562. #define fileread
    563. /*
    564. Reads bytes from the file and copies to the internal buffer (starting at the
    565. write position)
    566. Argument0 = file id.
    567. Argument1 = Number of bytes to read.
    568. [Argument2]: The buffer id to receive to. Leave out this argument or set
    569. it to 0 to use the default buffer.
    570. */
    571. return external_call(global._FilD, argument0, argument1, argument2);
    572. #define filepos
    573. /*
    574. argument0 = file id
    575. Returns the read/write pos in the open file.
    576. */
    577. return external_call(global._FilE, argument0);
    578. #define filesetpos
    579. /*
    580. Sets the read/write pos in the open file.
    581. argument0 = file id
    582. Argument1 = position to set to.
    583. */
    584. return external_call(global._FilF, argument0, argument1);
    585. #define filesize
    586. /*
    587. argument0 = file id
    588. Returns the size of the file in bytes.
    589. */
    590. return external_call(global._FilG, argument0);
    591. #define adler32
    592. /*
    593. This function creates checksum value of the data inside the buffer.
    594. This can be used for data verification.
    595. note: Checksums are similar to MD5 but faster and less accurate. It also
    596. returns a number not a string. Uses adler-32 checksum algorithm.
    597. The value can be sent as an unsigned int
    598. */
    599. return external_call(global._UtilC, argument0);
    600. #define getmacaddress
    601. /*
    602. returns the computers local MAC address. Do not just rely on this for player banning and the
    603. mac address can easily be spoofed.
    604. */
    605. return external_call(global._SokR);
    606. #define iptouint
    607. /*
    608. Converts a ip string (ie 202.13.23.1) to a number.
    609. The number is the right size to be written as a unsigned int
    610. in a buffer.
    611. argument0 = ip address
    612. returns: number
    613. */
    614. return external_call(global._UtilE, argument0);
    615. #define uinttoip
    616. /*
    617. Converts a number to a ip address.
    618. argument0 = number (integer)
    619. returns: ip address (string)
    620. */
    621. return external_call(global._UtilF, argument0);
    622. #define netconnected
    623. /*
    624. checks if the local computer is connected to the internet
    625. returns true if it is...
    626. */
    627. return external_call(global._UtilG);
    Alles anzeigen
    Husi012 hat mich nicht mehr in seiner Signatur, ich bin trotzdem noch fame.
  • Die *.gml Datei ist keine allmächtige Codedatei die du einfach in irgendein Objekt reinklatscht und magischerweiße dein Spiel zum Multiplayerspiel macht. Die 39dll gibt dir nur die Möglichkeit auf die Windows Sockets, also die Netzwerkfunktionen von Windows zuzugreifen, wie z.B. TCP oder UDP. Du kannst Daten zu anderen Computer über das Internet senden - mehr kann das Teil erstmal nicht.

    Du klingst so als ob du einfach das Tutorial kopieren willst und dann deine eigenen Sprites draufklatschen (wenn überhaupt), so funktioniert das aber nicht, spätetens wenn du neue Features einbauen willst (Schüsse, KI-Gegner... etc) kommt schon wieder eine Frage.

    Für die Serverliste brauchste btw einen externen Server der das ganze verwaltet (lässt sich sicher mit MySQL und PHP was zusammenskripten), evtl. dazu noch eine HTTP DLL um mit diesen Server zu kommunzieren, die 39dll kann das selbst auch, aber das wird dann ein Stück schwieriger.
    wupto.net/ Nicht meine Seite!
    We love Koalas.

    GM-D-Spam-o-Meter: 32%
  • henrik1235 schrieb:

    Die *.gml Datei ist keine allmächtige Codedatei die du einfach in irgendein Objekt reinklatscht und magischerweiße dein Spiel zum Multiplayerspiel macht. Die 39dll gibt dir nur die Möglichkeit auf die Windows Sockets, also die Netzwerkfunktionen von Windows zuzugreifen, wie z.B. TCP oder UDP. Du kannst Daten zu anderen Computer über das Internet senden - mehr kann das Teil erstmal nicht.

    Du klingst so als ob du einfach das Tutorial kopieren willst und dann deine eigenen Sprites draufklatschen (wenn überhaupt), so funktioniert das aber nicht, spätetens wenn du neue Features einbauen willst (Schüsse, KI-Gegner... etc) kommt schon wieder eine Frage.

    Für die Serverliste brauchste btw einen externen Server der das ganze verwaltet (lässt sich sicher mit MySQL und PHP was zusammenskripten), evtl. dazu noch eine HTTP DLL um mit diesen Server zu kommunzieren, die 39dll kann das selbst auch, aber das wird dann ein Stück schwieriger.



    schöne Worte ^^ nein, ich will es ja nicht einfach reinklatschen, denn wie du gesagt hast habe ich auch noch andere objekte, aber ich bräcuhte ein Tutorial, dass ich auch verstehe und am besten auf deutsch ist!


    Dieser Fehler kommt immer:


    ___________________________________________
    COMPILATION ERROR in Script: dllinit
    Error in code at line 1:
    #define dllinit
    ^
    at position 1: Unexpected symbol.
    Husi012 hat mich nicht mehr in seiner Signatur, ich bin trotzdem noch fame.

    Dieser Beitrag wurde bereits 1 mal editiert, zuletzt von Dufner ()

  • du musst die .gml datei nicht rauskopieren, du musst sie über den Game Maker rein importieren. Jedes #define beschreibt ein neues script und somit fallen dann die #define Zeilen weg und dir werden alle scripte automatisch angelegt. Wie du vielleicht gemerkt hast gibt es eine gm6 Vorlage im 39dll Ordner, mit der du glaub ich schon alles in ein leeres Game Maker Projekt reingeladen bekommst. Achte mal drauf. Weil STRG+C/V kannst du bei einer .gml datei nicht einfach so verwenden.