The most important thing is the cable model, make sure
its base is on the centre origin, you can position it in MED.
For the codes, it is up to you, here is an example :
Code:
entity* cable; // pointer for cable
var speed = 0.1; // play with it
// attach it to the cable
action cable_act
{
while(my == NULL) {wait(1);}
cable = my;
}
// attach it to the elevator
action elevator
{
while(my != NULL)
{
// other codes if any......
if (key_d) // press key 'd' to drive elevator down
{
move_mode = ignore_passents;
// adjust speed if it doesn't catch up the cable
ent_move(nullvector, vector(0,0,speed*time));
cable.scale_z += speed * time;
}
if (key_u) // press key 'u' to drive elevator up
{
move_mode = ignore_passents;
ent_move(nullvector, vector(0,0,-speed * time);
cable.scale_z -= speed * time;
}
wait(1);
}
}
Codes are not tested, you may need to adjust it to meet your
requirements.