ok i have 2 problems with this script here.......i got this script from TMT i think and i been playing with it trying to get everything right......now for the probs......i spawn a cratelid2.tik for my lift floor and have it triggered by a electrical_pulse_switch.tik.....1st prob is everything spawns correctly except for my cratelid2.tik.....it doesnt show up until i hit the trigger to activate the lift...then it appears and u have to get on it then.....how can i make it show all the time?.......2nd prob is the trigger works great but when my lift returns to the bottom it doesnt wait to be triggered again it just waits 5 secs then goes back up automatically and continues for the rest of the map without anyone triggering it......i've been looking and reading but cant seem to get it working right any and all help would be greatly appreciated...thx in advance
What you have said make perfect sence thats what you wrote for it to do .
1. you spawned the cratelid in the thread called by the setthread statement so of course it won't spawn until the trigger is triggered
2. the only thing between the moveup statements and the movedown statements is a 5 second wait
3. You turned off the trigger but no where have you turned it back on
4. Movement is in a endless while loop
*************
ToDo
*************
1. spawn cratelid in the main thread not in the thread started by setthread
2. create a level variable to keep track of where the lift is top or bottom defined with a default value in the main thread IE. level.elepos = 0 ( bottom)
3. add a switch statement or if statement in the thread based on the level variable so if it is at the top move it to the bottom and set level variable to new position ( maybe a switch at the top with setthread set to same thread too )
4. turn trigger(s) back on at end of thread
5. use $targetname wittill animdone after anim statements to pause script untill the animation is done ( substitute $targetname with actual targetname of entity )
6. remove while loop so that thread runs when trigger is triggered then waits to be triggered again after trigger is turned back on . ( You don't need a while loop when using setthread . Setthread automatically starts the thread when the trigger is triggered )
************
suggestion
************
1. don't use setthread call the thread from the main thread and put statements into a while loop first line of which is $mytriggername waittill trigger so thread does not run continually and only runs after trigger is triggered . If you do that no need to turn on and off the trigger but then you will need to make two threads if you have a top switch and another variable to keep track of if the elevator is moveing and not move it with the top or botton trigger/switch if it is moving already only move it if it is stopped ( set moving variable when it starts and stops ).
. create a level variable to keep track of where the lift is top or bottom defined with a default value in the main thread IE. level.elepos = 0 ( bottom)
3. add a switch statement or if statement in the thread based on the level variable so if it is at the top move it to the bottom and set level variable to new position ( maybe a switch at the top with setthread set to same thread too )
and i have no idea what ur talking about....still trying to get all this
although i have been playing with the script and have it to where i can move the crate np but it doesnt run anymore....u said make if statement but i dont have leves i just have the floor i guess would be level 1 then it goes up 915 units then returns down 915 to the bottom...i think i understand taking the while out and that should not make it loop?...
wow i understood that .....everything worked perfect except the return i had to take out the else then it dropped after the wait...thx alot man for the help its getting there....now though lol....i need 2 of these can i just copy it basically over and just add 1 to the names or is there a simpler way?....well i know there is just dont know how to simplify the scripts YET =)
Well the else ment that you would have to use the trigger again to bring the elevator back down just like a real elevator
Yes there is a simpler way . Have the trigger target the switch and have the switch target the cratelid . Why do you ask ? So you can write a thread that both elevators can use , one that does not use literal targetnames but instead is more generic and can be use by several entities . In fact get use to doing scirpts this way it will save you having to rewrite the same lines over and over again . When a thread runs because of a setthread statement "self" in the thread refers to the trigger that started the thread .
alright thx alot man yes that was alot easier also thats what i needed was the lift to auto return i probably didnt tell u thats y i took the else out...there is no trigger to bring it back down....its all running perfect now i really appreciate it...now on to the rest of the mods lol...i promise ill be back lol