The Blocks Builder
Developer Last Online: Sep 2016
Category: [Script] | SRB2 Version: v2.1.x | Rating: (1 votes - 5.00 average) | ||
Submitted: April 30th, 2014 | ||||
WAD File Contains Lua Level(s) |
This is the script used by the Blocks Builder.
If you don't know what it is, you can read the original thread: http://srb2skybase.org/mb/showthread...7631#post27631
You are free to use and even modify it in your own mods.
The Blocks Builder itself is basically a thinker that you activate on level load that will act on a group of FOFs depending on player's actions.
Here we'll try making a 4 * 4 * 4 Blocks Builder.
You have first to create a map where you create a in-level grid where every sector has a different tag:
SectorsGrid.png
Numbers are the sector tags. Of course your grid may be bigger, and you may start with another tag, as long as the order is the same.
Note that every sector geometry should be identical, and should be a square.
You have now to create a FOF for each potential block.
You can know how many FOF you'll have to make using this expression:
n = x * y * z * types
where n is the number of FOFs, x-y-z the dimensions of the building slot (ex: 16*16*16 blocks), and types how many different kinds of blocks the player will be able to place. n cannot exeed 32768.
The tags given to the control sectors are irrevelant (at least it is for this script), however there is something very important: the tags of the lines and the indexes of the sectors have to be increased by 1 for each new FOF, the tag starting from the top-left sector tag on the previous grid, and coming back to this value every time it reaches the bottom-right sector tag on the grid.
Sorry if it's not very easy to understand, I'll still try to give you an example:
FOFs.png
Here the lines are tagged from 1 to 64, since our grid had 4 * 4 * 4 = 64 blocks, and their indexes numbers are raising from left to right.
Note: as you need many control sectors, it is preferable to create unclosed sectors, with only one line per sector.
Once you made that, just copy-paste the sectors (use Sectors Mode) as until you have a group of line for each kind of block. Don't change their tags, just change their apparence / effect.
Now you just have to create a double-sided linedef executor "BLOCKSBUILDERTHINKER" called on level load. Refer to the header of the script to know how to setup the Blocks Builder thinker.
If you need more examples, you could check the maps from the official Blocks Builder.
If you don't know what it is, you can read the original thread: http://srb2skybase.org/mb/showthread...7631#post27631
You are free to use and even modify it in your own mods.
The Blocks Builder itself is basically a thinker that you activate on level load that will act on a group of FOFs depending on player's actions.
Here we'll try making a 4 * 4 * 4 Blocks Builder.
You have first to create a map where you create a in-level grid where every sector has a different tag:
SectorsGrid.png
Numbers are the sector tags. Of course your grid may be bigger, and you may start with another tag, as long as the order is the same.
Note that every sector geometry should be identical, and should be a square.
You have now to create a FOF for each potential block.
You can know how many FOF you'll have to make using this expression:
n = x * y * z * types
where n is the number of FOFs, x-y-z the dimensions of the building slot (ex: 16*16*16 blocks), and types how many different kinds of blocks the player will be able to place. n cannot exeed 32768.
The tags given to the control sectors are irrevelant (at least it is for this script), however there is something very important: the tags of the lines and the indexes of the sectors have to be increased by 1 for each new FOF, the tag starting from the top-left sector tag on the previous grid, and coming back to this value every time it reaches the bottom-right sector tag on the grid.
Sorry if it's not very easy to understand, I'll still try to give you an example:
FOFs.png
Here the lines are tagged from 1 to 64, since our grid had 4 * 4 * 4 = 64 blocks, and their indexes numbers are raising from left to right.
Note: as you need many control sectors, it is preferable to create unclosed sectors, with only one line per sector.
Once you made that, just copy-paste the sectors (use Sectors Mode) as until you have a group of line for each kind of block. Don't change their tags, just change their apparence / effect.
Now you just have to create a double-sided linedef executor "BLOCKSBUILDERTHINKER" called on level load. Refer to the header of the script to know how to setup the Blocks Builder thinker.
If you need more examples, you could check the maps from the official Blocks Builder.
Downloads
- BlocksBuilder-v3.0.lua (17.3 KB, 286 views)
- Sample.wad (85.9 KB, 293 views)
Additional Notes
- Please be mindful of using other people's works. If the modification is not marked as "Re-usable Content", ask the developer for permission before using their work in your mod.