Page 1 of 1

Elevator troubles!

Posted: Thu Oct 18, 2007 6:03 am
by StarGeneral
Im trying to make a giant elevator platform for my secret armory map, but for some reason the elevator wont go, i've got everything named correctly, look at my script here and tell me whats wrong ok?

main:

level waittill prespawn

level.elepos = 0

level waittill spawn

thread elevator_standby
end

elevator_standby:
$elevator_cab speed 64
$elev_trigger bind $elev_switch
$elev_switch bind $elevator_cab
thread move
end

move:
$elev_trigger waittill trigger

if (level.elepos == 0)
{
goto moveup
}
else
{
goto movedown
}
end

moveup:
/
$elev_switch anim turn

$elev_trigger nottriggerable

$elevator_cab loopsound lighthouse_run

$elevator_cab moveto $topfloor
$elevator_cab waitmove

$elevator_cab stoploopsound

$elev_switch anim idle

$elev_trigger triggerable

level.elepos = 1

goto move
end

movedown:

$elev_switch anim turn

$elev_trigger nottriggerable
$elevator_cab loopsound lighthouse_run
$elevator_cab moveto $bottomfloor
$elevator_cab waitmove
$elevator_cab stoploopsound
$elev_switch anim idle
$elev_trigger triggerable
level.elepos = 0

goto move
end

Posted: Thu Oct 18, 2007 7:26 am
by wacko
delete the "/" in thread moveup. if u did name everything correctly, it will work then.

You could have found that error yourself, if u did have read the console output: There's a

Code: Select all

Bad token:
TOKEN_DIVIDE:
/
^~^~^ Script file compile error: Couldn't parse ...
For debugging your script, always try to find these ^~^~^ lines

Posted: Fri Oct 19, 2007 12:34 am
by StarGeneral
The elevator still wont work, I don't know why, I went back and made sure everything was set to the right targets and everything. I have a clue though, the first time I made my script the elevator was making the humming sound its supposed to when idle, now it makes no sound at all!

I need some more help with this.

Posted: Fri Oct 19, 2007 2:50 am
by erick
That looks like my elevator tutorial. Well I am glad to see someone using it. If you have everything named correctly that should work. Make sure you have trigger_use(s) instead of trigger_multiple(s). Double check everything. Make sure your switch is animate_equipment_electric-switch-pulse or nopulse it doesnt matter. Just have the correct switch. Are your waypoints set correctly?

Posted: Fri Oct 19, 2007 6:55 am
by wacko
StarGeneral wrote:set to the right targets
there's no setting of targets at all in this map, it's targetname. :?

check out this, it is the working elevator, map-file inside the pk3.
Compare it to what you did.

Posted: Fri Oct 19, 2007 11:05 pm
by StarGeneral
I meant targetname, i thought you would catch on, Ill look at the example and see what I did wrong.

Posted: Fri Oct 19, 2007 11:06 pm
by StarGeneral
oh and about the waypoints, I cant set them in the middle of the elevator because its so large, and the grid isnt any help because its not specific enough, could that be the problem?

Also, when I was hearing that lighthouse humming sound, it was coming from the waypoints, not the switch. (?)

waypoints

Posted: Fri Oct 19, 2007 11:20 pm
by tltrude
The elevator cab will move to wherever the waypoints are. So, they do need to be centered in the elevator shaft. Looking from the top view on the 2D screen, your waypoints can be linded up. But, centering them will have to be done with test and adjust. Also it is helpful to make temp brushes to messure with.

The sound will come from whatever entity you want. Your script says its the one named "$elevator_cab".

Posted: Fri Oct 19, 2007 11:40 pm
by wacko
StarGeneral wrote:I meant targetname, i thought you would catch on
No offense ment, but 95% of scripts not working properly are caused by the engine not catching on things you ment but didn't say :wink: What I mean is, in both scripting itself and talking about it, we must use proper wording. In your case, it could have been the reason: Using key target instead of targetname wouldn't work and that's what I wanted to point out.

Re: waypoints

Posted: Sat Oct 20, 2007 3:08 pm
by wacko
tltrude wrote:The elevator cab will move to wherever the waypoints are
More precisely, and I did it wrong in my demo above, the "moveto $waypoint" will move the center of the script_object (the elevator) to the center of the waypoint. With more complex objects it may become difficult to find the center, but there u can add a brush with texture origin to the script_object and this brush's center will become the center of the whole script_object (like it's done with rotating_doors).

Posted: Sun Nov 04, 2007 6:30 pm
by StarGeneral
Sweet, my elevator works now. I had to re-size the elevator shaft completely but it looks even better now. I measured the elevator so the waypoints would be in the exact center and they were...however, I realized after looking over the script again that I had named my waypoints incorrectly.

In the script it says topfloor, bottomfloor.
I had mine set to floor1 and floor2, I re-set them and it works beautifully.

Thanks for the help everyone. :D

Posted: Sun Nov 04, 2007 6:37 pm
by StarGeneral
1 MORE question actually...I accidently added two values to worldspawn that I didnt want, how do I get rid of them? they screwed up my sun!

Posted: Sun Nov 04, 2007 7:02 pm
by hogleg
Pull up worldspawn in your entity menu, highlite unwanted value and clik del key/pair
:wink:

text

Posted: Sun Nov 04, 2007 11:36 pm
by tltrude
Another way to delete them would be to open your .map file with a text editor, like Wordpad or Notepad. The Worldspawn stuff will be at the top of the page. Just delete the lines and then save it as a .map file (not .txt).

Posted: Mon Nov 05, 2007 1:09 am
by StarGeneral
thanks guys, big help :)