Closed Thread
Page 1 of 2
1 2 LastLast
Results 1 to 10 of 15

Thread: Console Screens & strings

  1. #1
    Wire Noob AndyDLP is on a distinguished road AndyDLP's Avatar
    Join Date
    Jun 2009
    Posts
    23

    Default Console Screens & strings

    Well I have tried to make a basic target info panel with a bunch of screens on it showing distance to target, HP of target and altitude. I also have another screen which I am trying to get an E2 I have made:
    Code:
    @name Target Display
    @inputs T:entity BeaconZ BeaconDistance Link:wirelink
    @outputs Altitude Health Distance Name:string
    
    interval(100)
    
    Altitude = round(BeaconZ) + 54
    Health = T:health()
    Distance = round(BeaconDistance)
    Name = T:name()
    
    
    if (!T) 
    {
        Altitude = 0 &
        Link:writeCell(2041, 1)
        Link:writeString("No Target",0,0,123,411)
        }
    
    if(~T)
    {
        Link:writeString("Name: " + Name,0,0,123,411)
    }
    
    And im really stumped as to why it wont work. Though to be honest im not that great at E2 since I have only just started using it, I have looked through E2 guide [WIP] & the E2 documentation and i havent found anything that I can relate my chip to. I have also searched wiremod forums for 'Strings to console screen' and couldnt see anything obvious.

    By the way the wire devices i am using are:
    • E2 Chip (Above) with wirelink
    • Console Screen
    • Target Finder + Beacon sensor
    • 3 Normal screens to show target info (Altitude, HP & Distance)

    Any help to make this work / shorten code would be greatly appreciated.
    Thanks in advance
    Andy

    P.S could anyone tell me the Entity:x (function?) that shows target speed / velocity??
    Last edited by AndyDLP; 06-13-2009 at 02:53 PM. Reason: Another question
    Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!

  2. #2
    Wirezard


    Matte is a jewel in the rough Matte is a jewel in the rough Matte is a jewel in the rough Matte is a jewel in the rough Matte's Avatar
    Join Date
    Jan 2009
    Location
    Norway
    Posts
    2,093

    Default Re: Console Screens & strings

    Code:
    if (!T) 
    {
        Altitude = 0 &
        Link:writeCell(2041, 1)
        Link:writeString("No Target",0,0,123,411)
        }
    
    Remove the & after "Altitude = 0".
    "If anybody says he can think about quantum physics without getting giddy, that only shows he has not understood the first thing about them."
    -- Niels Bohr

    Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!

  3. #3
    Wire Noob AndyDLP is on a distinguished road AndyDLP's Avatar
    Join Date
    Jun 2009
    Posts
    23

    Default Re: Console Screens & strings

    Still nothing im afraid :/ maybe I wired it wrong? Im not even sure if I did it right in this situation how would you do it?
    btw thanks for quick reply
    Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!

  4. #4
    High Gravity Wirer
    BlackholeWM is on a distinguished road BlackholeWM's Avatar
    Join Date
    Dec 2008
    Posts
    644

    Default Re: Console Screens & strings

    Code:
    @name Target Display
    @inputs T:entity BeaconZ BeaconDistance Link:wirelink
    @outputs Altitude Health Distance Name:string
    @persist
    @trigger all
    
    interval(100)
    
    Health = T:health()
    Distance = round(BeaconDistance)
    Name = T:name()
    
    
    if (!T) 
    {
        Altitude = 0 
        Link:writeString("No Target",0,0,123,411)
        }
    else
    {
        Link:writeString("Name: " + Name,0,0,123,411)
       Altitude = round(BeaconZ) + 54
    }
    
    There are a load of problem. First you keep trying to clear the screen if !T. Also I don't think ~T is necessary. As well as the weirdly placed &. Finally, don't define altitude twice. Does mine work? I have added in some directives.
    Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!

  5. #5
    Wire Noob AndyDLP is on a distinguished road AndyDLP's Avatar
    Join Date
    Jun 2009
    Posts
    23

    Default Re: Console Screens & strings

    No im afraid it doesnt work :-/ though im not sure if I've wired it properly, does the console screen inputs need to go to anything to work? at the moment they are wired. As you can see I'm a big noob at this

    Just to add, if someone could write a small snippet that ONLY shows target name on a console screen with a good description that would be fine since I can do without the rest I can do that in another expression or something
    Last edited by AndyDLP; 06-13-2009 at 03:30 PM.
    Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!

  6. #6
    High Gravity Wirer
    BlackholeWM is on a distinguished road BlackholeWM's Avatar
    Join Date
    Dec 2008
    Posts
    644

    Default Re: Console Screens & strings

    To wire a wirelink you need to place an 'Expression2 wirelink' on the CScreen and then wire the Link input to it.

    Doesn't anything happen when you turn it on?

    Also, just try this:

    Code:
    @name Test
    @input Link:wirelink
    @output
    @persist
    @trigger all
    Link:writeString("Test",0,0,999)
    
    Just to test what your doing.
    Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!

  7. #7
    Wire Noob AndyDLP is on a distinguished road AndyDLP's Avatar
    Join Date
    Jun 2009
    Posts
    23

    Default Re: Console Screens & strings

    Hmm for some reason I just get this error and I cant wire anything
    "Unknown directive found (@input) at line 2, char 1"
    Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!

  8. #8
    High Gravity Wirer
    BlackholeWM is on a distinguished road BlackholeWM's Avatar
    Join Date
    Dec 2008
    Posts
    644

    Default Re: Console Screens & strings

    Oops, sorry. It should be '@inputs' and '@outputs'.
    Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!

  9. #9
    Wire Noob AndyDLP is on a distinguished road AndyDLP's Avatar
    Join Date
    Jun 2009
    Posts
    23

    Default Re: Console Screens & strings

    lol how did i not notice that >,<

    Edit: Ok that works fine, is this the way to make it display entity name?

    Link:writeString("Name: " + Entity:name9(),0,0,999)
    Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!

  10. #10
    High Gravity Wirer
    BlackholeWM is on a distinguished road BlackholeWM's Avatar
    Join Date
    Dec 2008
    Posts
    644

    Default Re: Console Screens & strings

    Yes, but name(), not name9(). I suspect that was just a typo.
    Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!

Closed Thread
Page 1 of 2
1 2 LastLast

Similar Threads

  1. Mov Strings?
    By LeonBlade in forum CPU Tutorials & Programs
    Replies: 5
    Last Post: 06-01-2009, 10:50 AM
  2. Reading Strings from the Console Screen
    By Eirath245 in forum CPU Tutorials & Programs
    Replies: 10
    Last Post: 01-01-2009, 06:16 AM
  3. Help with strings.
    By Mr Affinity in forum Advanced Gates
    Replies: 19
    Last Post: 12-05-2008, 11:23 AM
  4. Strings
    By kklouzal in forum Wiremod Lua Coding
    Replies: 3
    Last Post: 07-23-2008, 03:55 AM
  5. strings in the ex gate
    By nanotech fur in forum Help & Support
    Replies: 5
    Last Post: 10-19-2007, 12:28 AM

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