Advertisement
Guest User

Untitled

a guest
Mar 2nd, 2014
197
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 5.04 KB | None | 0 0
  1. [NYI] Spawn Tiles
  2. Options: Action
  3. Return Type: (None)
  4. Parameters
  5. Region = No Region <Region>
  6. ------- 0.88 -> Tiles
  7. Tile Size = 0.0 <Real>
  8. Tile Unit = No Game Link <Game Link - Unit>
  9. Grammar Text: Spawn Tiles(Region, Tile Size, Tile Unit)
  10. Hint Text: (None)
  11. Custom Script Code
  12. Local Variables
  13. Half Width = ((Width of Region) / 2.0) <Real>
  14. Half Height = ((Height of Region) / 2.0) <Real>
  15. x array = 0 <Integer>
  16. y array = 0 <Integer>
  17. Max X array = 0 <Integer>
  18. Max Y array = 0 <Integer>
  19. ------- 60 array is to have enough room for arrays in case of a fairly small unit to make the floor with
  20. X coordinate = 0.0 <Real[5]>
  21. Y coordinate = 0.0 <Real[5]>
  22. Actions
  23. Unit Group - Pick each unit in (Tile Unit units in Region owned by player 0 matching Excluded: Missile, Dead, Hidden, with at most Any Amount) and do (Actions)
  24. Actions
  25. Unit - Remove (Picked unit) from the game
  26. ------- REMEMBER THE BOUNDARIES WILL BE UNITS, SO IF YOU HAVE A "REMOVE UNIT" TRIGGER THAT GOES IN BETWEEN ROUNDS IN YOUR GAME, EXCLUDE THE TILE UNIT!
  27. ------- Due to the amount of untis this creates, I have no idea if it causes lag... Chirus would know! But anyways, you can change the unit being used and/or their distance from each other.
  28. ------- Create the middle unit we build from. This is to ensure the symmetry of the placement.
  29. Unit - Create 1 Tile Unit for player 0 at (Center of Region) facing 0.0 degrees (Ignore Placement)
  30. Variable - Set X coordinate[0] = (X of (Position of (Last created unit)))
  31. Variable - Set Y coordinate[0] = (Y of (Position of (Last created unit)))
  32. UI - Display (Text(Tile Size) with Any Precision decimal places) for (All players) to Chat area
  33. ------- Central Vertical line
  34. General - While (Conditions) are true, do (Actions)
  35. Conditions
  36. (Y of (Position of (Last created unit))) <= (Y coordinate[0] + (Half Height - Tile Size))
  37. Actions
  38. Variable - Modify y array: + 1
  39. Variable - Set Y coordinate[y array] = ((Y of (Position of (Last created unit))) + Tile Size)
  40. Unit - Create 1 _8 Tile for player 0 at ((Center of Region) offset by (X coordinate[0], (Y coordinate[0] - (y array * Tile Size)))) facing 0.0 degrees (Ignore Placement)
  41. Unit - Create 1 _8 Tile for player 0 at ((Center of Region) offset by (X coordinate[0], Y coordinate[y array])) facing 0.0 degrees (Ignore Placement)
  42. UI - Display (Text((Y of (Position of (Last created unit)))) with Any Precision decimal places) for (All players) to Chat area
  43. Variable - Set Max Y array = y array
  44. Variable - Set y array = 0
  45. ------- Moving RIGHT from there, building every vertical line
  46. General - While (Conditions) are true, do (Actions)
  47. Conditions
  48. (X of (Position of (Last created unit))) <= (X coordinate[0] + (Half Width - Tile Size))
  49. Actions
  50. Variable - Modify x array: + 1
  51. Variable - Set X coordinate[x array] = ((X of (Position of (Last created unit))) + Tile Size)
  52. Unit - Create 1 _8 Tile for player 0 at ((Center of Region) offset by (X coordinate[x array], Y coordinate[y array])) facing 0.0 degrees (Ignore Placement)
  53. General - Repeat (Actions) Max Y array times
  54. Actions
  55. Variable - Modify y array: + 1
  56. Unit - Create 1 _8 Tile for player 0 at ((Center of Region) offset by (X coordinate[x array], (Y coordinate[0] - (y array * Tile Size)))) facing 0.0 degrees (Ignore Placement)
  57. Unit - Create 1 _8 Tile for player 0 at ((Center of Region) offset by (X coordinate[x array], Y coordinate[y array])) facing 0.0 degrees (Ignore Placement)
  58. Variable - Set Max X array = x array
  59. Variable - Set x array = 0
  60. Variable - Set y array = 0
  61. ------- Moving LEFT from the center, building every vertical line
  62. General - Repeat (Actions) Max X array times
  63. Actions
  64. Variable - Modify x array: + 1
  65. Variable - Set X coordinate[x array] = ((X of (Position of (Last created unit))) + Tile Size)
  66. Unit - Create 1 _8 Tile for player 0 at ((Center of Region) offset by (X coordinate[x array], Y coordinate[y array])) facing 0.0 degrees (Ignore Placement)
  67. General - Repeat (Actions) Max Y array times
  68. Actions
  69. Variable - Modify y array: + 1
  70. Unit - Create 1 _8 Tile for player 0 at ((Center of Region) offset by (X coordinate[x array], (Y coordinate[0] - (y array * Tile Size)))) facing 0.0 degrees (Ignore Placement)
  71. Unit - Create 1 _8 Tile for player 0 at ((Center of Region) offset by (X coordinate[x array], Y coordinate[y array])) facing 0.0 degrees (Ignore Placement)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement