Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- [NYI] Spawn Tiles
- Options: Action
- Return Type: (None)
- Parameters
- Region = No Region <Region>
- ------- 0.88 -> Tiles
- Tile Size = 0.0 <Real>
- Tile Unit = No Game Link <Game Link - Unit>
- Grammar Text: Spawn Tiles(Region, Tile Size, Tile Unit)
- Hint Text: (None)
- Custom Script Code
- Local Variables
- Half Width = ((Width of Region) / 2.0) <Real>
- Half Height = ((Height of Region) / 2.0) <Real>
- x array = 0 <Integer>
- y array = 0 <Integer>
- Max X array = 0 <Integer>
- Max Y array = 0 <Integer>
- ------- 60 array is to have enough room for arrays in case of a fairly small unit to make the floor with
- X coordinate = 0.0 <Real[5]>
- Y coordinate = 0.0 <Real[5]>
- Actions
- 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)
- Actions
- Unit - Remove (Picked unit) from the game
- ------- 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!
- ------- 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.
- ------- Create the middle unit we build from. This is to ensure the symmetry of the placement.
- Unit - Create 1 Tile Unit for player 0 at (Center of Region) facing 0.0 degrees (Ignore Placement)
- Variable - Set X coordinate[0] = (X of (Position of (Last created unit)))
- Variable - Set Y coordinate[0] = (Y of (Position of (Last created unit)))
- UI - Display (Text(Tile Size) with Any Precision decimal places) for (All players) to Chat area
- ------- Central Vertical line
- General - While (Conditions) are true, do (Actions)
- Conditions
- (Y of (Position of (Last created unit))) <= (Y coordinate[0] + (Half Height - Tile Size))
- Actions
- Variable - Modify y array: + 1
- Variable - Set Y coordinate[y array] = ((Y of (Position of (Last created unit))) + Tile Size)
- 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)
- 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)
- UI - Display (Text((Y of (Position of (Last created unit)))) with Any Precision decimal places) for (All players) to Chat area
- Variable - Set Max Y array = y array
- Variable - Set y array = 0
- ------- Moving RIGHT from there, building every vertical line
- General - While (Conditions) are true, do (Actions)
- Conditions
- (X of (Position of (Last created unit))) <= (X coordinate[0] + (Half Width - Tile Size))
- Actions
- Variable - Modify x array: + 1
- Variable - Set X coordinate[x array] = ((X of (Position of (Last created unit))) + Tile Size)
- 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)
- General - Repeat (Actions) Max Y array times
- Actions
- Variable - Modify y array: + 1
- 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)
- 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)
- Variable - Set Max X array = x array
- Variable - Set x array = 0
- Variable - Set y array = 0
- ------- Moving LEFT from the center, building every vertical line
- General - Repeat (Actions) Max X array times
- Actions
- Variable - Modify x array: + 1
- Variable - Set X coordinate[x array] = ((X of (Position of (Last created unit))) + Tile Size)
- 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)
- General - Repeat (Actions) Max Y array times
- Actions
- Variable - Modify y array: + 1
- 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)
- 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