Home Showcase
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

KatelynKatelyn Registered, Administrator Posts: 171
edited April 2011 in Showcase #1
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

  • Lambda217Lambda217 Registered, Moderator Posts: 534
    Now this will come in handy!


    "I want you to show this world what it means to fear the sky."
  • KatelynKatelyn Registered, Administrator Posts: 171
    You are actually a little shaky on it because of setPos, but it is useful when there is no noclipping on.
  • Alex4921Alex4921 Registered Posts: 139
    Just tap V at the speed of light,it gives you a fairly basic noclip.
    The quieter you are,the more you are able to hear.

Leave a Comment

BoldItalicStrikethroughOrdered listUnordered list
Emoji
Image
Align leftAlign centerAlign rightToggle HTML viewToggle full pageToggle lights
Drop image/file