StRiKeR Posted June 17, 2003 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? 0 Share this post Link to post
Ichor Posted June 17, 2003 Make a script for the switch like this:script 1 (void) { SetLineSpecial(line id, 74 /* Teleport_NewMap */, map number, 0, 0, 0, 0); } 0 Share this post Link to post
StRiKeR Posted June 17, 2003 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 0 Share this post Link to post
Ichor Posted June 17, 2003 For the script, yes. However, you need to give that line an ID number for it to work. 0 Share this post Link to post
StRiKeR Posted June 17, 2003 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. 0 Share this post Link to post
Ichor Posted June 17, 2003 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. 0 Share this post Link to post
StRiKeR Posted June 17, 2003 [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). 0 Share this post Link to post
Ichor Posted June 17, 2003 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. 0 Share this post Link to post
StRiKeR Posted June 17, 2003 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 0 Share this post Link to post
Ichor Posted June 17, 2003 You know, I'm not quite sure what number to use for Doom. 0 Share this post Link to post
StRiKeR Posted June 17, 2003 Oh man :-( lol, I always envisioned this as a DOOM project. I guess I will have to use the "process of elimanation" then,lol 0 Share this post Link to post
StRiKeR Posted June 17, 2003 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? 0 Share this post Link to post
StRiKeR Posted June 17, 2003 Ok I see,where the "set line special id 74..." thing is,thats where I put the line that the switch is on? 0 Share this post Link to post
StRiKeR Posted June 17, 2003 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); } 0 Share this post Link to post
Ichor Posted June 17, 2003 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. 0 Share this post Link to post
The Ultimate DooMer Posted June 17, 2003 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. 0 Share this post Link to post
Ichor Posted June 17, 2003 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? 0 Share this post Link to post
Epyo Posted June 17, 2003 Yes, fragglescript. StRiKeR said:Does legacy support this via scipting? How do I do this? Silly Ichor. 0 Share this post Link to post
DarkWolf Posted June 17, 2003 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. 0 Share this post Link to post
StRiKeR Posted June 17, 2003 ok thanks,this is fraggle-script right? lol,not acs? 0 Share this post Link to post
DarkWolf Posted June 17, 2003 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. 0 Share this post Link to post
StRiKeR Posted June 19, 2003 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!!!!! 0 Share this post Link to post
FireBastard Posted June 21, 2003 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. 0 Share this post Link to post
Epyo Posted June 21, 2003 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. 0 Share this post Link to post