OCD2 Posted August 7, 2020 Share Posted August 7, 2020 Hello, As per title, my scripted elevator only works once. The triggers have a count of -1, and the elevator works, both up and down - but only one time. Then it will not function any longer. What could I have done wrong? Link to comment
mrwonko Posted August 7, 2020 Share Posted August 7, 2020 The target_scriptrunner needs a count of -1 Link to comment
OCD2 Posted August 7, 2020 Author Share Posted August 7, 2020 4 minutes ago, mrwonko said: The target_scriptrunner needs a count of -1 Thank you fast man, that was the problem. I did have a working elevator, but ended up having surprise duplicate brushes on my lift that I had to delete, maybe deleting the extra trigger changed the values on the script runner? Link to comment
OCD2 Posted August 7, 2020 Author Share Posted August 7, 2020 Second add on question: How do I script the elevator to have doors that open when it reaches its destination? Link to comment
NAB622 Posted August 8, 2020 Share Posted August 8, 2020 You can just add that into the script, either by using move blocks on the doors or by having the script fire a func_door by targetname, with a use block. Ideally, the doors should be part of the building and not the elevator, or bad things can happen. Side note: instead of using a target_scriptrunner, you can put a usescript on the trigger_multiple, it should have the same result and save you an entity. OCD2 likes this Link to comment
OCD2 Posted August 8, 2020 Author Share Posted August 8, 2020 33 minutes ago, NAB622 said: You can just add that into the script, either by using move blocks on the doors or by having the script fire a func_door by targetname, with a use block. Ideally, the doors should be part of the building and not the elevator, or bad things can happen. Side note: instead of using a target_scriptrunner, you can put a usescript on the trigger_multiple, it should have the same result and save you an entity. Thank you, I will look up move blocks / use blocks. And thank you for the tip about doors and placement. Truly appreciate the help. Link to comment
OCD2 Posted August 8, 2020 Author Share Posted August 8, 2020 Another piggyback question - My scripted elevators work as intended - though after using them once, they return to a resting position that is just a step lower than they started. What would cause that / what did I do wrong? Link to comment
NAB622 Posted August 8, 2020 Share Posted August 8, 2020 Post a screenshot of your script. It's probably something to do with the method of movement. Link to comment
OCD2 Posted August 8, 2020 Author Share Posted August 8, 2020 7 minutes ago, NAB622 said: Post a screenshot of your script. It's probably something to do with the method of movement. https://jkhub.org/albums/zHF5vTZ Link to comment
NAB622 Posted August 8, 2020 Share Posted August 8, 2020 Ohhh, you're using the tag stuff for movement....I hate that method. I don't know if it's responsible for your problem or not, but it's a silly method in my opinion, because it requires you to recompile the entire map for any change in movement. When you are using a move block, you can just move the elevator to any arbitrary coordinates in the map you like - there's no need to use target_position or ref_tag or any of that nonsense. Better still, if your elevator has no "Origin" brush, then 0 0 0 is the starting position of the elevator, and you can move it relative to that. So, moving it on the Z axis by 192 units will move the elevator up 192 units (I forget which order the axes are in). Plus, you can guarantee that the elevator is always back where it started by telling it to move to 0 0 0. The biggest advantage to this method, though, is that if you change something in the script, all you have to do is recompile the script and reload the map, and you can see your changes immediately. You will not have to recompile the entire map. If your elevator does have an "Origin" brush (Which is required for rotation), then the exact center of the "Origin" brush will be the elevator's coordinates in the script instead of 0 0 0 - it's a little more tricky to use this way, but you can still make a working elevator without too much effort. Also - keep in mind that you can take an even easier approach to this entire thing, and just use func_doors for everything, and have the script use the movers in the order and timing that you want. This is by far the easiest, although least flexible, way to go. Link to comment
OCD2 Posted August 8, 2020 Author Share Posted August 8, 2020 Interesting information! Thank you for all of your help. Link to comment
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now