ACSUtils Wiki

An ACS library for ZDoom-based ports

User Tools

Site Tools


functions:sendstring

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
Last revisionBoth sides next revision
functions:sendstring [2016/10/18 20:58] – [Sending strings] korshunfunctions:sendstring [2016/10/19 00:24] korshun
Line 3: Line 3:
 ===== Sending strings ===== ===== Sending strings =====
 ''ACS_SendString(int scriptnum, str s)'' ''ACS_SendString(int scriptnum, str s)''
 +
 ''ACS_NamedSendString(str scriptname, str s)'' ''ACS_NamedSendString(str scriptname, str s)''
  
Line 12: Line 13:
 </code> </code>
  
-<note warning>Zandronum 3.0 doesn't support clientside named scripts yet!</note> +Maximum string size is unlimited, but the larger it is, the more the server will lag while sending it. 
-<note warning>These functions may **not** be used to launch **serverside** scripts, unless in singleplayer. Doing so will result in a [[.functions:error|ProgramError]]. Test your mods on a server (this is recommended for many other reasons too).</note>+ 
 +<note warning>These functions may **not** be used to launch **serverside** scripts, unless in singleplayer. Doing so will result in a [[.error|ProgramError]].  
 + 
 +Test your mods on a server (this is recommended for many other reasons too).</note>
 <note important>If multiple SendStrings are done in a row, the scripts may be launched either in order or **in reverse order**. Whether one order or the other will be used is unspecified.</note> <note important>If multiple SendStrings are done in a row, the scripts may be launched either in order or **in reverse order**. Whether one order or the other will be used is unspecified.</note>
 <note important>Zandronum 2.1.2 doesn't support named scripts at all.</note> <note important>Zandronum 2.1.2 doesn't support named scripts at all.</note>
Line 23: Line 27:
 script 123 (int a, int b, int c, int d) CLIENTSIDE script 123 (int a, int b, int c, int d) CLIENTSIDE
 { {
-        // Do nothing if the string hasn't been fully received. 
  if (!ReceiveString(a, b, c, d))  if (!ReceiveString(a, b, c, d))
  terminate;  terminate;
   
-        // The string has been fully received. It can now be retrieved using GetReceivedString().+        // Insert your code here. The string can now be retrieved using GetReceivedString().
  Log(s:"Received string: ", s:GetReceivedString());  Log(s:"Received string: ", s:GetReceivedString());
 } }