You can set whether any line that has an ID is impassable or not at any time of your choosing using SetLineBlocking. If you mark it as impassable in the editor, then using [wiki]SetLineBlocking[/wiki](line,BLOCK_NOTHING) will make it passable.
Try this to set up a working test:
- 1) Pick the line that you want to change from impassable to passable.
2) Give that specific line the special [wiki]Line_SetIdentification[/wiki] and give it a unique ID number.
3) In a script use SetLineBlocking( theUniqueIDNumberYouJustGaveTheLine, BLOCK_NOTHING);
So, if you give the line the ID of 1, SetLineBlocking( 1, BLOCK_NOTHING ); will make it passable. If you give it an ID of 37, SetLineBlocking( 37, BLOCK_NOTHING ); will work.
mac53 wrote:What does it mean next to [Script 1][int lineid]? I thought that either (void) or OPEN declared what type of the script's function is! I don't know, the one from the wiki confuses me...
When you declare a script that doesn't have a special type (like OPEN, ENTER, DEATH, etc...), you have the option to give it arguments to pass in. If you aren't giving it arguments, then you use
(void). If you are giving arguments, then you have to list them. In the example you showed, there is ONE argument specified:
int lineid. What this means is that you can give a value to the script and it can use whatever value you give it to do something.
For a simple example, let's say you had 3 doors in your map and they are only openable by hitting a different switch for each of them. The door's sector tags are 3, 4, and 5. Now, you could make the three switches and give them each a different script, like this:
Code: Select all
script 1 (void)
{
Door_Open( 3, 48, 0 ); // Open door tagged 3
}
script 2 (void)
{
Door_Open( 4, 48, 0 ); // Open door tagged 4
}
script 3 (void)
{
Door_Open( 5, 48, 0 ); // Open door tagged 5
}
Or, instead, you can write a single script and give it one arguement, the sector tag to open.
Code: Select all
script 1 (int sectorTag)
{
Door_Open( sectorTag, 48, 0 ); // Open door tagged sectorTag
}
Now when this script executes, it will use whatever value you have given for
sectorTag and open the corresponding door. To give
sectorTag a value, you pass it in the ACS_Execute call. Where before you might have just put ACS_Execute on a line and just given the first number as the number of the script, now you give the first number as the script and the
third number as the value of the first argument. So all your switches would have the special ACS_Execute with a first argument of 1, but the third arguement would be 3 on one of them (to open door 3), 4 on another (to open door 4), and 5 on the last one (to open door 5.)