Elevator troubles!
Moderator: Moderators
- StarGeneral
- Sergeant
- Posts: 67
- Joined: Wed Oct 17, 2007 5:21 am
Elevator troubles!
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
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
"Si vis pacem, para bellum."
"If you want peace, prepare for war."
"If you want peace, prepare for war."
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
For debugging your script, always try to find these ^~^~^ lines
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 ...- StarGeneral
- Sergeant
- Posts: 67
- Joined: Wed Oct 17, 2007 5:21 am
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.
I need some more help with this.
"Si vis pacem, para bellum."
"If you want peace, prepare for war."
"If you want peace, prepare for war."
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?
there's no setting of targets at all in this map, it's targetname.StarGeneral wrote:set to the right targets
check out this, it is the working elevator, map-file inside the pk3.
Compare it to what you did.
- StarGeneral
- Sergeant
- Posts: 67
- Joined: Wed Oct 17, 2007 5:21 am
- StarGeneral
- Sergeant
- Posts: 67
- Joined: Wed Oct 17, 2007 5:21 am
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. (?)
Also, when I was hearing that lighthouse humming sound, it was coming from the waypoints, not the switch. (?)
"Si vis pacem, para bellum."
"If you want peace, prepare for war."
"If you want peace, prepare for war."
waypoints
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".
The sound will come from whatever entity you want. Your script says its the one named "$elevator_cab".
No offense ment, but 95% of scripts not working properly are caused by the engine not catching on things you ment but didn't sayStarGeneral wrote:I meant targetname, i thought you would catch on
Last edited by wacko on Sat Oct 20, 2007 3:10 pm, edited 1 time in total.
Re: waypoints
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).tltrude wrote:The elevator cab will move to wherever the waypoints are
- StarGeneral
- Sergeant
- Posts: 67
- Joined: Wed Oct 17, 2007 5:21 am
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.
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.
"Si vis pacem, para bellum."
"If you want peace, prepare for war."
"If you want peace, prepare for war."
- StarGeneral
- Sergeant
- Posts: 67
- Joined: Wed Oct 17, 2007 5:21 am
text
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).
- StarGeneral
- Sergeant
- Posts: 67
- Joined: Wed Oct 17, 2007 5:21 am
