Advertisement
Guest User

Untitled

a guest
Apr 8th, 2013
125
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.09 KB | None | 0 0
  1. 1. The main problem right now is that you're doing everything clientside, which means it's running on the player's (the Events Team member's) computer. It can't interact very well with other players here (things like collecting other players' chat, etc.).
  2.  
  3. In short, you need to move the important non-UI bits (storing the answer, checking the answer against player guesses) to serverside, and handle only the UI stuff (the interface where the ET inputs the question and answer) on clientside.
  4.  
  5. You have to communicate using triggers. There's a reasonable explanation of triggers and serverside/clientside on [URL="http://forums.graalonline.com/forums/showpost.php?p=1579584&postcount=6"]this post[/URL]. [URL="http://forums.graalonline.com/forums/showpost.php?p=1541241&postcount=9"]This post[/URL] gives an example of communicating with an NPC (rather than, say, a weapon script).
  6.  
  7. 2. The rough equivalent of PHP's explode is the tokenize function:
  8.  
  9. [PHP]
  10. temp.str = "abc def ghi";
  11. temp.tokens = temp.str.tokenize(); // first parameter defaults to a space if not given
  12. echo(temp.tokens[1]); // echoes def
  13.  
  14. temp.tokens = temp.str.tokenize("e"); // you can also specify the delimiter if you prefer
  15. echo(temp.tokens[1]); // echoes f ghi
  16. [/PHP]
  17.  
  18. Note that there is an odd restriction that the delimiter can only be one character in length.
  19.  
  20. 3. To show an image on a level, you use showimgs. You can either use the old-style syntax like showimg(idx, x, y, image) (and then changeimgpart to achieve what you want) or use findImg. I prefer the latter:
  21.  
  22. [PHP]
  23. // 200 is the index; each image needs an index, which must be unique only
  24. // for the current script
  25. //
  26. // indexes below 200 are usually shown to other players (there are some restrictions
  27. // so this is not always true), indexes >= 200 are only shown to the current player
  28. with (findImg(200)) {
  29. image = "block.png";
  30.  
  31. x = 32;
  32. y = 32;
  33.  
  34. partx = 32; // x offset of the subimage relative to the top left corner
  35. party = 0; // y offset of the subimage
  36. partw = 32; // width of the subimage
  37. parth = 32; // height of the subimage
  38. }
  39. [/PHP]
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement