+ Reply to Thread
Results 1 to 7 of 7

Thread: [E2 Help] Asgard Transporter

  1. #1
    Wire Amateur Milo's Avatar
    Join Date
    May 2008
    Posts
    69

    Default [E2 Help] Asgard Transporter

    hey im trying to build a chat controlled transporter for players here is what i got:

    Code:
    @name Asgard
    @inputs 
    @outputs OX OY OZ DX DY DZ Send Retrive Evrything
    @persist Chat:array Target:entity AimPos:vector 
    @trigger all
    runOnChat(1)
    Chat=lastSaid():explode(":")
    if (Chat:string(1)=="player")
    {
        Target = findPlayerByName(Chat:string(2))
        TargetPos = Target:pos()
        OX = TargetPos:x()
        OY = TargetPos:y()
        OZ = TargetPos:z()
        Evrything = 0
        Send = 1
    
    }
    if (Chat:string(1)=="set")
    {
        AimPos = owner():aimPos()
        DX = AimPos:x()
        DY = AimPos:y()
        DZ = AimPos:z()
        
    }
    it sends the cords rigth but the send just stays at 1 so if i use it, usuallly dosent work at all, or it teleports the player over and over agian till a new chat message is said...
    how do i fix this pice of crap ?

  2. #2
    Wirererer adadr's Avatar
    Join Date
    Jan 2009
    Location
    South Dakota, USA
    Posts
    303
    Blog Entries
    3

    Default Re: [E2 Help] Asgard Transporter

    may need an else at the end, or itll just stay at 1.

  3. #3
    Wire Sofaking Azrael's Avatar
    Join Date
    Aug 2007
    Posts
    1,946

    Default Re: [E2 Help] Asgard Transporter

    Send will never return to 0 again. Add an else case.

  4. #4
    Wire Amateur Milo's Avatar
    Join Date
    May 2008
    Posts
    69

    Default Re: [E2 Help] Asgard Transporter

    Now have
    @name Asgard
    @inputs
    @outputs OX OY OZ DX DY DZ Send Retrive Evrything
    @persist Chat:array Target:entity AimPos:vector
    @trigger all
    runOnChat(1)
    Chat=lastSaid():explode(":")
    if (Chat:string(1)=="get")
    {
    Target = findPlayerByName(Chat:string(2))
    TargetPos = Targetos()
    OX = TargetPos:x()
    OY = TargetPos:y()
    OZ = TargetPos:z()
    Evrything = 0
    Send = 1
    }
    else
    {
    Send=0
    }
    if (Chat:string(1)=="set")
    {
    AimPos = owner():aimPos()
    DX = AimPos:x()
    DY = AimPos:y()
    DZ = AimPos:z()

    }
    It outputs Send inuntill another chat message is sent + it dosent teleport, nothing happends

  5. #5
    Wire Amateur Milo's Avatar
    Join Date
    May 2008
    Posts
    69

    Default Re: [E2 Help] Asgard Transporter

    Please ?!!! waited an hour...
    Code:
    "I have a better Pythagorean theorem than you"

  6. #6
    Wire Tutor chinoto's Avatar
    Join Date
    Apr 2008
    Location
    Brooklyn Park, MN. Lost my thumbdrive yet again...
    Posts
    1,983

    Default Re: [E2 Help] Asgard Transporter

    I added a timer that makes it turn off "Send" 100ms after turning it on.
    Code:
    @name Asgard
    @inputs 
    @outputs OX OY OZ DX DY DZ Send Retrieve Everything
    @persist Target:entity AimPos:vector 
    @trigger all
    #Whats the point in "Retrieve" if it is never set and "Everything" if its only set to 0?
    runOnChat(1)
    if (chatClk(owner())) {
        Chat=lastSaid():explode(":")
        if (Chat:string(1)=="player") {
            TargetPos = findPlayerByName(Chat:string(2)):pos()
            OX = TargetPos:x()
            OY = TargetPos:y()
            OZ = TargetPos:z()
            Everything = 0
            Send = 1
            timer("send-stop",100)
        }
        if (Chat:string(1)=="set") {
            AimPos = owner():aimPos()
            DX = AimPos:x()
            DY = AimPos:y()
            DZ = AimPos:z()
        }
    }
    if (clk("send-stop")) {Send=0}
    (\__/) Expression 2 Resources: E2 Beginner's Guide | E2 Formatting Guide | E2 Function Reference | E2 Examples | Me
    (='.'=) PM me code and I'll send it back optimized if possible. (I find it fun dammit!)
    (")_(") Drunkie referring to an E2: "It's obvious that Chinoto made this, his coding style is all over it."

  7. #7
    Wire Amateur Milo's Avatar
    Join Date
    May 2008
    Posts
    69

    Default Re: [E2 Help] Asgard Transporter

    #Whats the point in "Retrieve" if it is never set and "Everything" if its only set to 0?
    its not complete... different commands for each
    but thanks
    Code:
    "I have a better Pythagorean theorem than you"

+ Reply to Thread

Similar Threads

  1. Asgard teleport [REQ]
    By chaos101 in forum Finished contraptions
    Replies: 29
    Last Post: 09-29-2009, 05:22 PM
  2. How to add glow to the model of Asgard Transporter ?
    By lotus006 in forum Installation and Malfunctions Support
    Replies: 1
    Last Post: 04-19-2009, 01:36 AM
  3. Asgard Transporter - Origins and Destinations
    By Cpt. Archie in forum Gate Nostalgia (Old School Wiring) Discussion & Help
    Replies: 3
    Last Post: 07-30-2008, 08:52 AM
  4. Easy to use: Asgard teleporter
    By LinkMandos in forum Finished contraptions
    Replies: 2
    Last Post: 10-14-2007, 08:28 AM
  5. Multi-Targeting Transporter Control Setup
    By cbale2000 in forum Finished contraptions
    Replies: 6
    Last Post: 07-18-2007, 02:54 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
proceed-collector
proceed-collector
proceed-collector
proceed-collector
linguistic-parrots
linguistic-parrots
linguistic-parrots
linguistic-parrots