Jump to content

My scripted elevator only works once?


Recommended Posts

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
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

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
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

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

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

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
×
×
  • Create New...