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!

ZPM auto-linker

KatelynKatelyn Registered, Administrator Posts: 171
edited August 2011 in Showcase #1
I know many don't have a use for this since you can't spawn ZPMs, but here is an e2 that will auto-link to a node, then auto-grab a ZPM, and pull it and link it. Press use on it to release the ZPM.


I got some updates coming. Wait a bit before you get this. I forgot to include the Percentage output, and I have it where it rotates into the chamber now.
@name ZPM Linker
@outputs Percentage
@persist Table:table Ani In
@model models/props_phx/misc/potato_launcher_chamber.mdl
#By Katelyn
if (first())
{
    runOnUse(1)
    entity():setColor(vec())
    timer("Node", 10)    
    Ani = 15
}
if (clk("Node"))
{
    findClearWhiteList()
    findIncludePlayerProps(owner())
    findInSphere(entity():pos(), 2048)
    findClipToClass("resource_node")
    
    if (find())
    {
        print("Node linked.")
        Table["Node", entity] = find()
        entity():setColor(vec() + 255)
        holoCreate(1, entity():pos() + entity():up() * 10)
        holoAng(1, entity():angles())
        holoAlpha(1, 0)
        holoParent(1, entity())
        timer("ZPM", 10)
    }
    else
    {
        timer("Node", 5000)
    }
    
}
if (clk("ZPM"))
{
    findClearWhiteList()
    findIncludePlayerProps(owner())
    findInSphere(entity():pos(), 15)
    findClipToClass("Zero_Point_Module")
    
    if (find())
    {
        print("ZPM linked.")
        Table["ZPM", entity] = find()
        Table["ZPM", entity]:propFreeze(1)
        Table["ZPM", entity]:setSolid(0)
        Table["ZPM", entity]:setAng(entity():angles())
        Table["ZPM", entity]:unWeld()
        Table["ZPM", entity]:setPos(holoEntity(1):pos())
	Table["ZPMlink", wirelink] = Table["ZPM", entity]:getWirelink()
        
        timer("Aniinstart", 10)
    }
    else
    {
        timer("ZPM", 500)
    }
    
}
if (clk("Aniinstart"))
{
    Table["ZPM", entity]:parentTo(holoEntity(1))
    timer("Aniin", 10)
}
if (clk("Aniin"))
{
    holoPos(1, entity():pos() + entity():up() * (Ani - 5))
    holoAng(1, entity():toWorld(ang(0, Ani * 15, 0)))
    Ani = Ani - 0.1
    if (Ani > 0)
    {
        timer("Aniin", 25)
    }
    else
    {
        Table["ZPM", entity]:link(Table["Node", entity])
        Table["ZPM", entity]:weld(entity())
        Table["ZPM", entity]:propFreeze(0)
        In = 1
    }
}
if (In)
{
    Percentage = Table["ZPMlink", wirelink]["ZPM %", number]
}
if (In & useClk(owner()))
{
    timer("Aniout", 10)
    Table["ZPM", entity]:unLink(Table["Node", entity])
    print("ZPM unlinked")
    Ani = 0
}
if (clk("Aniout"))
{
    holoPos(1, entity():pos() + entity():up() * (Ani - 5))
    holoAng(1, entity():toWorld(ang(0, Ani * 15, 0)))
    Ani = Ani + 0.1
    if (Ani <= 15)
    {
        timer("Aniout", 25)
    }
    else
    {
        timer("ZPM", 10000)
        In = 0
        Table["ZPM", entity]:propFreeze(0)
        Table["ZPM", entity]:setSolid(1)
        Table["ZPM", entity]:deparent()
        Table["ZPM", entity]:unWeld()
        Table["ZPM", entity]:setAng(entity():angles())
        Table["ZPM", entity]:setPos(holoEntity(1):pos())
        Table["ZPM", entity] = noentity()
    }
}

Comments

  • DaraconDaracon Registered Posts: 41
    Next time i see you on can i grab the updated code off you =3
  • KatelynKatelyn Registered, Administrator Posts: 171
    That is the latest version. It displays the percentage right.

Leave a Comment

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