The 17th step (top step) has to move west 16 and then move to the empty spot where step one was--below the ground. There is probably a better way of doing this, so any wild ideas are welcome, ha ha.
Last edited by tltrude on Mon May 05, 2003 3:48 pm, edited 2 times in total.
maybe, it's because a step with count 16 will go through 1st if clause, gets count 17, go therefore through 2nd if clause, gets count 0, then also through the rest, coming out with count 1, so you won't have steps with count 0, at least not very long... don't know whether this is a problem?
just an idea
movemeup:
if (self.count == 17)
{
self moveto $step_way1
self waitmove
self moveto $step_way2
self waitmove
self.count = 0
}
if (self.count == 16)
{
self moveWest 16
self waitmove
self.count ++
}
if (self.count<16 and self.count>0) //don't know whether this is correct!?
self moveUp 16
self moveWest 16
self waitmove
self.count ++
This line (the 2nd time it appears) causes a command overflow and makes your script crash back to the main menu. This is because you're looping your code without waiting for anything, thus the steps get a command to move again before they've finished their previous move.
Why not make a special debug version of movemeup: ? Then make $step1 use this debug version instead.
The debug version could print useful texts like the current count value to the screen or console (output to screen has a slight delay so it's not very accurate).
I just need a new brain. Turned out to be spelling errors in the map.
stap_way1
stap_way2
It works now--only minor adjustments left. Thanks jv_map!!
Ps: Wacho - I will post the escalator as part of my explodingdoor tutorial map. I decompiled your Shopp bsp and copied your escalator, but it had a lot of missing brushes. So, I had to rebuild the whole thing. Anyway, you are welcome to the script, and thankyou for making such a great map!
I was playing around with your script (and my ideas ) but it ended in a error 'Bad Token' for a moveUp line.
Now with your new script, the steps are moving, but some wait some move, they get mix up, gather somewhere and so on. Where should I set the info_waypoints? Well, I'll see in your tut map...
Btw, is thre a way to let script_objects 'jump' to another waypoint and/or to change the speed they're moving?
Well, I was wrong. It needed more than minor adjustments. The steps were out of sync and were all over the place. But, I did finally get it working with the script below. There is one step that moves funny (bobs), but it is not very noticeable. I will post the map here when I get it final compiled. Here is part of the script--it's very long now.
What I do not understand: if (($step2.count != 16) || ($step2.count != 17))
means if $step2.count is not 16 or is not 17 then do something!?
Which step could have a count that is not not 16 or not 17?
count--cond1--cond2--total
0...........1..........1........1
2...........1..........1........1
...
16.........0..........1........1
17.........1..........0........1, so the result is always 1
You are right, any step that does not (!=) have a count of 16 or (||) does not have a count of 17 will just move up. It would probably work fine without that line--I put it in for safty because steps were getting count of 18 and higher.
Any line that say:
$stepX.count ++
adds one to the count that was first set in "prep" for that step. Because it is in a "while" loop, it keeps adding one everytime the step moves. When it gets to 16, the step moves west only (at the top) and, when it gets to 17, it shoots back down to the bottom of the stack where its count is reset to zero.
I think jv_maps is right about goto loops being bad for complex threads. But then, he is always right!!!
So the script - when you say, it comes to counts of 18 - isn't working correctly? The script skips lines? That would be a good reason for my escalator trials behaving so strange. Or do you see s/th completely wrong:
I had it like you have it now and had the same problems. I think it is because there were too many threads trying to use the same "self" code. Although I did not try it with the "while" line and brackets, I suspect it would be just as bad. A lot of it has to do with timing and how long it takes a step to get back to the bottom.
Here is a link to download my updated Exploding Door Tutorial map:
You are welcome to use anything you like from it. Maybe you can get the escalator working better, now that we at least have it moving somewhat normally!
Wacko is right, if (($step2.count != 16) || ($step2.count != 17)) always returns 1, unless the count would be both 16 and 17 . Unless you're into quantum mechanics, that's never the case .
It seems a good idea to use some for statements, which could reduce the code drastically. For example, the escalator_prep: could also be written like this: