Jump to content
Search In
  • More options...
Find results that contain...
Find results in...
Sign in to follow this  
StRiKeR

Advanced LineDef Question

Recommended Posts

Ok let's say I got a linedef in my level, and the player is gonne be crossing over this linedef alot while he plays my level. How do I make it so, once he presses a switch the linedef turns into a exit(52) line? Does legacy support this via scipting? How do I do this?

Share this post


Link to post

Make a script for the switch like this:

script 1 (void)
{
    SetLineSpecial(line id, 74 /* Teleport_NewMap */, map number, 0, 0, 0, 0);
}

Share this post


Link to post

Ok awesome dude, thanks. I don't really know scripting though. Is that ALL I put in the script? I am trying to learn scripting, and trying to see if I should implement it, as it would further developement time because I would have to learn it. I guess now I have to implement it. Thanks

Share this post


Link to post

For the script, yes. However, you need to give that line an ID number for it to work.

Share this post


Link to post

Ok, cool. Will this work if the ceiling is gonna come down to about 75units above the floor when this happens? See, when the player presses this switch, I want the ceiling to come down 75units above the floor. So he will see it, and once he passes under it, he exits the level.

Share this post


Link to post

That should be no problem. Just add it to the script:

script 1 (void)
{
    Ceiling_LowerByValue(sector tag, speed, 75);
    tagwait(sector tag);
    SetLineSpecial(line id, 74 /* Teleport_NewMap */, map, 0, 0, 0, 0);
}
The switch will now lower the ceiling and set the line as an exit. The 'tagwait' simply means that the script will wait until the ceiling finishes lowering before changing that line to an exit. You really don't need it, but it can be useful sometimes.

Share this post


Link to post

[QUOTE]Ichor said:

script 1 (void)
{
    Ceiling_LowerByValue(sector tag, speed, 75);
    tagwait(sector tag);
    SetLineSpecial(line id, 74 /* Teleport_NewMap */, map, 0, 0, 0, 0);
}
Alrigh,so basically where "sector tag" is,I put the sec tag there,and put the speed where "speed" is? Do I have to change "map, 0, 0, 0,"? Like change it to "map, e1m2"? I am confused. Are you involved in any projects at the moment? My episode isn't gonna have much scripting, (probably none if I gotta do it,LOL just kidding).

Share this post


Link to post

This is Doom 2, right?
Anyway, sector tag means the tag number of the sector you want to use, in this case, the ceiling.
Speed means how fast the ceiling will lower (10 is fairly slow, while 50 is quick).
If this is Doom 2, then put in the map number you want (2 goes to map 2, etc.).
The three zeros after 'map' aren't used. However, the first zero is sometimes used in hubs.

Share this post


Link to post

I am gonna write up the script right quick to see if I can get it to work, check back in like 40minutes....maybe 20

Share this post


Link to post

You know, I'm not quite sure what number to use for Doom.

Share this post


Link to post

Oh man :-( lol, I always envisioned this as a DOOM project. I guess I will have to use the "process of elimanation" then,lol

Share this post


Link to post

Dude I don't know what I am doing, ok. The line where the actual switch is thats gonna lower the ceiling. What line type do I make this? Do I just make it a normal line,and tag it to that sector and the script takes care of the rest? The line ID where the switch is,where do I put that in the script?

Share this post


Link to post

Ok I see,where the "set line special id 74..." thing is,thats where I put the line that the switch is on?

Share this post


Link to post

ok didn't work, i used "add_fs" and put it into the pwad file. the linedef # that the switch is on is 106,and the sector tag is 3. heres the code,also i get a error in the legacy console saying "lowerceilingbyvaule:so such funtion". the level info and creator and stuff isnt even displaying!

[level info] The first level in the upcoming DOOM project "NovaShock", and so it begins...
levelname = The DiamondPort
creator = Daniel Carroll a.k.a. StRiKeR

[Scripts]

{
    Ceiling_LowerByValue(50, 0);
    tagwait(3);
    SetLineSpecial(106 , 74 /* Teleport_NewMap */, e1m1, 0, 0, 0, 0);
}

Share this post


Link to post

For the line you want to use, give that line Line_SetIdentification. Then give that line a tag number. The '74 /* Teleport_NewMap */ is the number of the special command you want to use.

Share this post


Link to post
StRiKeR said:

ok didn't work, i used "add_fs" and put it into the pwad file. the linedef # that the switch is on is 106,and the sector tag is 3. heres the code,also i get a error in the legacy console saying "lowerceilingbyvaule:so such funtion". the level info and creator and stuff isnt even displaying!


Ichor was using ACS (Hexen/ZDoom script), not FS, so maybe that's why it won't work.

Share this post


Link to post

No wonder it didn't work. I was using the wrong kind of scripting code. Silly me...

I know what ACS is, but I haven't even heard about FS until now. What does 'FS' mean anyway?

Share this post


Link to post

Yes, fragglescript.

StRiKeR said:

Does legacy support this via scipting? How do I do this?

Silly Ichor.

Share this post


Link to post

int switch1 = 0;

script 98  //exit linedef, type 272
{
 if(switch1)
  {
   exitlevel();
  }
}

script 99 //switch linedef, type 277
{
 switch1 = 1;
}
Change 98 and 99 to whatever the tag # is that those linedefs have.

Share this post


Link to post
StRiKeR said:

what about the sector?


Read fsbasic.html in the Legacy docs if you're unsure of how to activate a script via linedefs.

Share this post


Link to post

Something is wrong, I wrote a script that displays the level info, creator, bla bla bla. I know I wrote it right. I couldnt even get it to run. I added it into the wad. Still didn't run.I am gonna own this shit by the time I am done!!!!! ARGH!!!!!

Share this post


Link to post

I just got started with Legacy and as I recall you put the script into the level header. There's a utility ADD_FS with legacy that will do this. I think I read somewhere that some editor can also do this, but I forget which one it was.

Share this post


Link to post
FireBastard said:

I just got started with Legacy and as I recall you put the script into the level header. There's a utility ADD_FS with legacy that will do this. I think I read somewhere that some editor can also do this, but I forget which one it was.

Well, Deepsea has a FS menu in the F6 menu. It says, EDIT FS, SAVE FS, and EXPORT FS.

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
Sign in to follow this  
×