Welcome to the new Diaspora forums, please let us know if you see anything broken! Notice: Some users may need to reupload their avatars due to an issue during forum setup!
Service lift
This is a small service lift that will let you fly around in space and work on your ship if it is hanging off the side of the planet. It is a little jumpy and can sometimes cause you fall damage. Paste it then lift it in the air a bit, and freeze it. Press E on it to get on and E on it again to get off.
@name Service lift
@persist Active
@persist User:entity Box:vector
@persist Loc:vector Rate Angrate Accel Self:entity
@persist Box1:vector Box2:vector Box3:vector Box4:vector
@model models/SmallBridge/Elevators,Small/sbselevp3.mdl
interval(50)
#By Katelyn
if (first() | dupefinished())
{
runOnUse(1)
Rate = 5
Angrate = 3
Box1 = entity():boxSize() / 2 + 5
Box1:setZ(-Box1:z())
Box2 = vec(-Box1:x(), Box1:y(), Box1:z()) / 2
Box3 = vec(Box1:x(), -Box1:y(), Box1:z()) / 2
Box4 = vec(-Box1:x(), -Box1:y(), Box1:z()) / 2
#entity():setPos(entity():pos() + vec(0,0,30))
Self = entity()
}
Loc = Self:pos()
if (!Active)
{
if (useClk())
{
Active = 1
User = usedBy()
}
}
else
{
Accel += 0.05
clamp(Accel, 0.3, 1.2)
if (User:keyForward() | User:keyBack() | User:keyJump() | User:keyDuck())
{
Temp = Loc + (Self:right() * Accel * Rate * (User:keyForward() - User:keyBack())) + (Self:up() * Accel * Rate * (User:keyJump() - User:keyDuck()))
if ((Temp + Box1:rotate(Self:angles())):isInWorld() &
(Temp + Box2:rotate(Self:angles())):isInWorld() &
(Temp + Box3:rotate(Self:angles())):isInWorld() &
(Temp + Box4:rotate(Self:angles())):isInWorld() &
(Temp + -Box1:rotate(Self:angles())):isInWorld() &
(Temp + -Box2:rotate(Self:angles())):isInWorld() &
(Temp + -Box3:rotate(Self:angles())):isInWorld() &
(Temp + -Box4:rotate(Self:angles())):isInWorld())
{
Self:setPos(Temp)
}
}
else
{
Accel = 1
}
if (User:keyLeft() | User:keyRight())
{
Self:setAng(Self:angles() + ang(0, Angrate * (User:keyLeft() - User:keyRight()), 0))
}
Loc = Self:pos()
User:setPosition(Loc)
if (useClk() & usedBy() == User)
{
Active = 0
User:setPosition(Loc + vec(0,0,5))
User = noentity()
}
}
Comments
"I want you to show this world what it means to fear the sky."