Jump to content
Search In
  • More options...
Find results that contain...
Find results in...
Kyka

SetLineSpecial help.

Recommended Posts

So I was playing level 04 of Agent Spork's "Ultimate Simplicity", and in that level there are 4 switches. These switches have the 121 (H Line Identification) action set on them, with the lineID being "10". And these switches are used to trigger the following script. How is this done?

Script 4 (void)
{
	if(quad == 3)
	{
		SetLineSpecial(10,0,0,0,0,0,0);
		Floor_LowerByValue(0,16,28);
		Floor_LowerByValue(13,8,28);
		Print(s:"Sequence Complete!");
		TagWait(13);
		SetLineBlocking(1,0);
	}
	
	
	if(quad == 2)
	{
		SetLineSpecial(10,0,0,0,0,0,0);
		Floor_LowerByValue(0,16,28);
		Floor_LowerByValue(13,8,32);
		Print(s:"One more to go..");
		TagWait(13);
		SetLineSpecial(10,80,4,0,0,0,0);
		quad++;
	}
	
	if(quad == 1)
	{
		SetLineSpecial(10,0,0,0,0,0,0);
		Floor_LowerByValue(0,16,28);
		Floor_LowerByValue(13,8,32);
		Print(s:"Two more to go..");
		TagWait(13);
		SetLineSpecial(10,80,4,0,0,0,0);
		quad++;
	}
	if(quad == 0)
	{
		SetLineSpecial(10,0,0,0,0,0,0);
		Floor_LowerByValue(0,16,28);
		Floor_LowerByValue(13,8,32);
		Print(s:"Three more to go..");
		TagWait(13);
		SetLineSpecial(10,80,4,0,0,0,0);
		quad++;
	}
}

Everything else about this code I follow what is going on, but I sure could really use a good explanation of the SetLineSpecial function. Obviously the "10" is the lineID and the "4" is the script number, but what is the "80" for?. And the last 4 zeros? And why does the first SetLineSpecial have (10, 0, 0, 0, 0, 0, 0) but the second one has (10, 80, 4, 0, 0, 0, 0)

I have used used SetLineIdentification special within scripts, but I don't know how it works in this way.

Any help appreciated. Thanks :)

Share this post


Link to post

I have read the ZDoom wiki page, and it didn't really correspond to what i was seeing in the above script. There isn't even the same number of arguments in the brackets. I couldn't make any sense of it.

121:Line_SetIdentification (lineid, moreflags, reserved1, reserved2, lineid_hi) is the format listed on the ZDoom wiki page.

I mean, what is moreflags? and reserved1 and reserved2? and lineid_hi for that matter?

Whereas here, I am seeing something more along the lines of
121:Line_SetIdentification (lineid, action, script tag, argument1, argument2, argument3, argument4.)

The ZDoom wiki is usually pretty good, but its explanation for this function wasn't very helpful. Perhaps it was just because it assumes basic knowledge that I should have but don't.

Anyway, thanks for the explanation Stewboy. :D

[dumb]And I still don't get how it can be used to trigger a script.[/dumber]

Share this post


Link to post

Here is a example zdoom-in-hexen map, see the comments in the scripts which should hopefully explain it.

http://www.sendspace.com/file/3sekiv

Lemme know if you don't understand something or whatever. I'd probably be quite clueless with this stuff but I just happened to already know a little bit of python so that helped me.

--------

SetLineSpecial (int lineid, int special [, int arg0 [, int arg1 [, int arg2 [, int arg3 [, int arg4]]]]])

1st parameter: lineid
To give a line a lineid, right click a line, give it linedef action 121, then 'set line id'

2nd: the special line #
(for example right click a line, under ceiling, 'h ceiling crush once(43)' would be 43.

3rd - 7th:
these are the parameters of the particular line special (like movement speed or sector tag or whatever it says).
(right click a line, select action, pick anything. Now the stuff you can enter to the boxes at right are the parameters u enter for 3rd - 7th above.
However you can omit unused parameters (like if there's only 3 used parameters, only enter the first three OR enter 0's for the rest if you want).

Share this post


Link to post

Thanks heaps for that level gggmork. Man, that cleared things up really well. Now I get what is going on. I mean, I have used the lineID thing before, but not like this, only in simple ways (using it as a part of a script that offset textures to create the effect of flashing lights etc etc.)

You should upload that wad to the ZDoom wiki itself, for other people to download as an example wad.

Share this post


Link to post
Kyka said:

So I was playing level 04 of Agent Spork's "Ultimate Simplicity", and in that level there are 4 switches. These switches have the 121 (H Line Identification) action set on them, with the lineID being "10". And these switches are used to trigger the following script. How is this done?

It's done by giving an ID to the line, that ID being 0, that way they can be targeted by scripts. (Note that in UDMF, you can assign the ID directly in the editor, so Line_SetIdentification is useless in that format.)

Kyka said:

Everything else about this code I follow what is going on, but I sure could really use a good explanation of the SetLineSpecial function. Obviously the "10" is the lineID and the "4" is the script number, but what is the "80" for?.

Action specials by numbers for the answer.

Kyka said:

And the last 4 zeros?

void SetLineSpecial (int lineid, int special [, int arg0 [, int arg1 [, int arg2 [, int arg3 [, int arg4]]]]])

Kyka said:

And why does the first SetLineSpecial have (10, 0, 0, 0, 0, 0, 0) but the second one has (10, 80, 4, 0, 0, 0, 0)

The first has its special cleared (set to 0) so it deactivates the switches. The second has the special set to execute script 4 (special 80 with args0 4), so it makes the switches functional.

Simple.

Kyka said:

I have used used SetLineIdentification special within scripts

You shouldn't. Line_SetIdentification is a special that can only be used in the editor, for a Doom-in-Hexen map.

Kyka said:

I have read the ZDoom wiki page, and it didn't really correspond to what i was seeing in the above script. There isn't even the same number of arguments in the brackets. I couldn't make any sense of it.

121:Line_SetIdentification (lineid, moreflags, reserved1, reserved2, lineid_hi) is the format listed on the ZDoom wiki page.

I mean, what is moreflags? and reserved1 and reserved2? and lineid_hi for that matter?

What is moreflags? "moreflags: Allows setting of line flags that don't fit in the flag word anymore."
You know what line flags are -- block monsters, impassable, secret, shown, etc. There are map flags that you can't set in the editor because the binary "word" used to store them in the map format is only 32-bit long, so you can have only 32 flags. So, for more flags, either a hack needed to be made, or the map format had to be changed. Ultimately, with Line_SetID and UDMF, both solutions were used.

Anyway, use moreflags to define line flags you can't set in the editor. You even have the list!
"The following bits are defined for moreflags:

* 1: defines a zone boundary for sound environments.
* 2: defines a railing. A railing has the lowest 32 map units blocked but is passable above that.
* 4: block floating monsters
* 8: clip mid textures to floor and ceiling
* 16: wrap mid textures so that they fill the entire height between floor and ceiling. This implies clipping them to floor and ceiling.
* 32: 3dMidtex: Treats the mid texture on this linedef as a part of solid geometry. The texture part of such a linedef blocks actor movement (like a railing) and players and monsters can walk on such textures. Linedefs with this flag set can be attached to moving sectors via the Sector_Attach3dMidtex action special.
* 64: performs a check whether a switch is reachable for the player before activating it. If a switch is too high or low or completely in the ground or ceiling it will not activate. "

Kyka said:

Whereas here, I am seeing something more along the lines of
121:Line_SetIdentification (lineid, action, script tag, argument1, argument2, argument3, argument4.)

You are confusing void SetLineSpecial and 121: Line_SetIdentification. They are not the same thing at all! SetLineSpecial is an ACS function, which can only be called in a script. Line_SetId is a line special that can only be placed in the map editor! They are different functions with different purposes and different ways to be used!

Share this post


Link to post

Thanks for that Gez. That is really helpful. Heh. No wonder I was a bit lost there...

Gez said:

The first has its special cleared (set to 0) so it deactivates the switches. The second has the special set to execute script 4 (special 80 with args0 4), so it makes the switches functional.

Simple.


This was the biggest thing I couldn't work out, believe it or not, so thanks for taking the time to answer all my silly questions sequentially. You haven't missed anything. I appreciate this heaps.

Share this post


Link to post

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×