Remove the & after "Altitude = 0".Code:if (!T) { Altitude = 0 & Link:writeCell(2041, 1) Link:writeString("No Target",0,0,123,411) }
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:
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.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) }
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 01:53 PM. Reason: Another question
Remove the & after "Altitude = 0".Code:if (!T) { Altitude = 0 & Link:writeCell(2041, 1) Link:writeString("No Target",0,0,123,411) }
"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
Wire FPGA
Still nothing im afraid :/ maybe I wired it wrong? Im not even sure if I did it rightin this situation how would you do it?
btw thanks for quick reply
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.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 }
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 02:30 PM.
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:
Just to test what your doing.Code:@name Test @input Link:wirelink @output @persist @trigger all Link:writeString("Test",0,0,999)
Hmm for some reason I just get this error and I cant wire anything
"Unknown directive found (@input) at line 2, char 1"
Oops, sorry. It should be '@inputs' and '@outputs'.
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)
Yes, but name(), not name9(). I suspect that was just a typo.
Bookmarks