I have had a problem that I have never had before. I am making an elevator that has multiple floors but the script doesnt seem to work. There are no errors in the console. Could someone help?
the headings (moveup & movedown) are setthreads on triggers that dont work. Somehow the game doesnt see the triggers or something. My game is a little messed up that might be the problem
The computer doesnt see mohaa as installed but I can still play it and a whole bunch of other junk. So I need to reinstall the game but I dont have disc 2 and so on.
Here are some good lines to "debug" your triggers.
iprintlnbold_noloc "Down trigger has been used!" iprintlnbold_noloc "Up trigger has been used!"
If you add them to the top of your threads, the message will tell you if the setthread worked. You can also use the same kind of message printing line to say what a variable is equal to at any point in the script.
My guess is that level.elepos will equal "NIL" (no value) because it starting value was not set (in prespawn) before it was used. So, NIL - 1 will end up as "$floor-1" and not "$floor4".
For example -
level waittill prespawn
level.elepos = 5
Also, you can move "$elevator_cab speed 64" to prespawn because it only needs to be set one time. And, you should make both triggers "nottriggerable" until the elevator stops moving, up and down.
I used the debug lines and none of them printed. The triggers dont seem to be firing. I think it has something to do with my game. I had the level.elepos = 1 after prespawn and before spawn but nothing happened. Again no errors in the console.
Is this your entire script? If it is, the error is unsurprising, since the game starts reading the script right from the top, i.e. the movedown thread is fired right away (simply because it is the first thread in the file) and then sets $down_trigger nottriggerable prohibiting any further use of the trigger. I would suggest starting your script with a somewhat hideous 'end' line.
Copy and paste your entire script here. Is the rest of the script working? What is the name of your .bsp file and your .scr file? Are they both in the same folder? -- maps/dm?
You may want to recheck the setthread key/values.
Key: setthread
Value: movedown
Key: setthread
Value: moveup
Make sure the triggers are "trigger_use" entities.
Last edited by tltrude on Tue Aug 28, 2007 3:08 pm, edited 1 time in total.