DooMBoy Posted August 17, 2002 OK, I've wrote and compiled a script for the version of E1M1 I've been working on, it looks like this:#include "zcommon.acs" script 1 void { Print s("Heh!"); delay (const:35); } I've created a switch, tagged the line ACSAlwaysExecute, and set the script to 1. Yet when I try to hit the switch, the game tells me "P_StartScript Script 1 not found." Help! 0 Share this post Link to post
Fredrik Posted August 17, 2002 Is the Behavior entry where it's supposed to be? 0 Share this post Link to post
boris Posted August 17, 2002 DooMBoy said:Print s("Heh!"); make thatprint(s:"Heh!"); 0 Share this post Link to post
Biffy Posted August 17, 2002 DooMBoy, also be aware that the "delay" entry in your script does nothing except keep the script running for a second so you can't get more than one "heh" a second, unless you use AcsAlwaysExecute instead of AcsExecute. 0 Share this post Link to post
The Ultimate DooMer Posted August 17, 2002 There are also no brackets round 'void' 0 Share this post Link to post
Ichor Posted August 17, 2002 Try this: #include "zcommon.acs" script 1 (void) { print(s:"Heh!"); delay(const:35); } 0 Share this post Link to post
The Ultimate DooMer Posted August 17, 2002 Damn, I forgot to mention the zcommon.acs thing this time. (I suggested it last time someone had this problem) /me realises stupid mistake, but can't delete the post, so prints this message instead and says Doh! 0 Share this post Link to post
DooMBoy Posted August 19, 2002 Ichor said:Try this: #include "zcommon.acs" script 1 (void) { print(s:"Heh!"); delay(const:35); } I did exactly that, saved the file to the level, saved the Behavior, and still won't work. What next? 0 Share this post Link to post
The Ultimate DooMer Posted August 19, 2002 There's certainly nothing wrong with the script code. Which editor are you using? 0 Share this post Link to post
DooMBoy Posted August 19, 2002 The editor I am using is DeePSea. Though I have a sneaking suspicion that ZDoom 1.22 (the version of ZDoom that I'm using) is the wrong version to use. 0 Share this post Link to post
The Ultimate DooMer Posted August 19, 2002 That's probably it. The latest version is at http://zdoom.notgod.com/ftp/123beta33.zip 0 Share this post Link to post
DooMBoy Posted August 19, 2002 Well, I got my first script to execute! :) Now, how do I put more than one script in a level and get it to execute? 0 Share this post Link to post
Fredrik Posted August 19, 2002 Simply name your scripts script 1/script 2/script 3 etc. Change script number in the trigger line's args accordingly. 0 Share this post Link to post
DooMBoy Posted August 19, 2002 I've tried that, and it doesn't work. It'll execute the first script, but no go with the second one. :( 0 Share this post Link to post
Biffy Posted August 19, 2002 Use a different line to trigger the second script, not the same line as for the first. Make sure you pay attention to how it's triggered, as in walk-over, use, shoot, and whether you flag the line as repeatable or not, etc. Later, when you want to use the same line for multiple scripts, change its texture, block or unblock it, you can look into setlineidentification and setlinespecial. Setlineidentification assigns a number to a line. Setlinespecial assigns the function or script number to the line. 0 Share this post Link to post
Enjay Posted August 19, 2002 Try having a look through Rick Clark's scripting tutorials ( http://zdoom.notgod.com/zdkb/scriptprimer.html ) in the Zdoom knowledge base ( http://zdoom.notgod.com/zdkb/ ). Some of the tutorials are quite involved, but a great many are very clearly and simply put. They tend to deal with WAD Author, but most of the priciples are easily transferable to other editors, especially where something like scripting is concerned. 0 Share this post Link to post
ReX Posted August 21, 2002 DooMBoy said:I've tried that, and it doesn't work. It'll execute the first script, but no go with the second one.How are you trying to set up your scripts? (Post your script here for detailed comments.) Your OPEN script should contain all the specials that you want activated at startup. Your regular scripts will all be triggered after the game starts. (Some scripts may even be triggered by other scripts.) As Biffy said, make sure you have your linedef triggers set properly. Here is an example set of scripts: #include "zcommon.acs" script 1 OPEN { TranslucentLine(1,64); //Glass throughout map Setlineblocking(1,BLOCK_EVERYTHING);//Glass throughout map TranslucentLine(2,128); //Laser SetLineSpecial(2,80,3,0,0,0,0); //Laser, script 3 TranslucentLine(3,128); //Force field SetLineSpecial(3,80,5,0,0,0,0); //Force Field script 5 Sector_SetColor(4,96,96,96); //Underwater color Sector_SetColor(5,32,224,0); //Hydraulics (green) Sector_SetColor(6,224,128,32); //Computers (orange) Sector_SetColor(31,255,255,0); //Computers (yellow) Ceiling_CrushAndRaise(25,96,128); //Pistons Sector_SetDamage(44,400,0); //Elevator shaft ChangeCamera (const:7, 1, 0); //Opening cut scene ACS_Execute (const:25, 0, 0, 0, 0); //Opening cut scene } ////////////////////////////////////////////////////////////////////// // Script 3: Activates laser barrier when player tries to cross // // Disintegrates player // ////////////////////////////////////////////////////////////////////// int laserflag; script 3 (void) { if (laserflag==0) damagething(400); } ////////////////////////////////////////////////////////////////////// // Script 4: Deactivates laser barrier // // Removes texture, eliminates damage // ////////////////////////////////////////////////////////////////////// script 4 (void) { if (laserflag==0) setlinetexture (2, SIDE_FRONT, TEXTURE_MIDDLE, "-"); setlinetexture (2, SIDE_BACK, TEXTURE_MIDDLE, "-"); setlineblocking(2, OFF); laserflag=1; print (s:"Laser has been deactivated."); } ////////////////////////////////////////////////////////////////////// // Script 5: Repulsion & damage from Force Field (red key) // ////////////////////////////////////////////////////////////////////// script 5 (void) { thrustthing(random(192, 255), 8); damagething(5); } ////////////////////////////////////////////////////////////////////// // Script 6: Deactivates Force Field (Red Key Card required) // // Removes texture, eliminates damage // ////////////////////////////////////////////////////////////////////// int force1; script 6 (void) { if (force1==0) setlinetexture (3, SIDE_FRONT, TEXTURE_MIDDLE, "-"); setlinetexture (3, SIDE_BACK, TEXTURE_MIDDLE, "-"); setlineblocking(3, OFF); force1=1; print (s:"Force Field has been deactivated."); } 0 Share this post Link to post
ReX Posted August 21, 2002 Enjay said:Try having a look through Rick Clark's scripting tutorials ...Welcome back, Nigel. I trust your travels were enjoyable and at least somewhat relaxing. 0 Share this post Link to post
Enjay Posted August 21, 2002 ReX said:Welcome back, Nigel. I trust your travels were enjoyable and at least somewhat relaxing. Thanks, yeah, lots of travelling around the UK, getting drunk in many towns :-) Not sure if relaxing is quite the word, but great fun none the less. 7 weeks of vacation, only about 1 & 1/2 of which were spent at home. Oh yeah, and (as always) nice clear, well laid out scripts as examples from the guy I did most of my copying and pasting from when trying to get a grip on how to put a script together. 0 Share this post Link to post
DooMBoy Posted August 21, 2002 #include "zcommon.acs" script 1 void { print {s:"Scripting is teh l337."); } :) 0 Share this post Link to post