+ Reply to Thread
Page 1 of 2 12 LastLast
Results 1 to 10 of 19

Thread: [Help] Expression Chip

  1. #1
    Wire Noob Vorsai's Avatar
    Join Date
    Aug 2007
    Posts
    24

    Default

    This is my first expression chip. The little bit of programming knowledge knowledge let me start this off without too much problems, but then I get snagged on debugging. Never was my strong suit.

    I was making a chip for a 3 tier tracking platform.

    Here is my code:

    <div class='codetop'>CODE</div><div class='codemain' style='height:200px;white-spacere;overflow:auto'>N@ Tracking Chip
    I@ Bearing Elevation
    O@ Thrust Length

    #Horizontal Tracking
    If Bearing > 0 -> Thrust = 1;
    If Bearing < -1 -> Thrust = -1;
    If Bearing = 0 -> Thrust = 0;

    #Vertical Tracking
    If Elevation < 0 -> Length = 5
    If Elevation > 0 -> (Length = floor(Elevation) + 50);</div>

    Here are the problems I seem to be having:

    For Horizontal Tracking, as long as it has a target, it tracks perfectly. As soon as it looses its target however, it&#39;s giving the thrusters a value of 1 and it just spins in place until a new target is found. I originally added third horizontal tracking line to fix this, but it didn&#39;t do anything. Not sure what is wrong with it.

    For Vertical Tracking, as soon as the target is above 0, it gets the elevation of the target, but kind of jumps up and down a bit like the hydraulic length is varying by a few numbers. I also have no idea what is going on there either.

    Any help would of course be greatly appreciated.

  2. #2
    Wire Amateur MurmeliWirer's Avatar
    Join Date
    Jun 2007
    Posts
    51

    Default

    Well that horizontal tracking can be fixed by adding input "Tfinder" and wire it to the Target finder and then add line:
    Tfinder == 0 -> Thrust = 0;
    And for that elevation, im not sure how elevation works.

  3. #3
    Wire Noob Vorsai's Avatar
    Join Date
    Aug 2007
    Posts
    24

    Default

    Righto I&#39;ll try that thank you.

    The only reason I added 50 to the elevation to begin with is because it tracks people&#39;s feet, adding 50 puts it to about chest level...

    Though I suppose if I can&#39;t fix it I can just let it track the feet...

  4. #4
    Wire Noob Vorsai's Avatar
    Join Date
    Aug 2007
    Posts
    24

    Default

    Lol it didn&#39;t work.

    I looked at all the lines again and they make sense, not sure why they don&#39;t work.

    I hooked up screens to the chip to see what values it was giving off, and they are giving off the right values I want. The thing is, the thrusters and hydraulic aren&#39;t reflecting those values. >.>

  5. #5
    Wire Noob Vorsai's Avatar
    Join Date
    Aug 2007
    Posts
    24

    Default

    I&#39;ve been playing around with it and I haven&#39;t gotten anywhere.

    If anybody has any other ideas that would be excellent. >.>

  6. #6
    Wire Amateur MurmeliWirer's Avatar
    Join Date
    Jun 2007
    Posts
    51

    Default

    Well, for that elevation if you add 50 to it and some guy goes far away from the turret it will just fire over them, so you need to calculate the distance using the elevation and distance of the target, check -orb- &#39;s perfect hs turret tutorial, also for the bearing you could use delta, orb has also tutorial on that. And one think i have to note: when you post you get an "Edit" Button as extra.

  7. #7
    Wire Noob Vorsai's Avatar
    Join Date
    Aug 2007
    Posts
    24

    Default

    I&#39;ll check that out thanks.

    I&#39;m still figuring out how to apply all these concepts to make a working chip. >.>

    Edit: I actually watched the video on the smart turret, and I should be able to code that in no time. Thanks for the help.

  8. #8
    Wire Noob Vorsai's Avatar
    Join Date
    Aug 2007
    Posts
    24

    Default

    Now I&#39;ve gotten the horizontal to work perfectly thanks to some new coding, but using an accumulator for the vertical, my chip is giving out a constant value of 1 for reset, rendering the accumulator, useless.

    <div class='codetop'>CODE</div><div class='codemain' style='height:200px;white-spacere;overflow:auto'>@N Vertical
    @I Accum
    @O Reset

    #Vertical
    If Accum < 0 -> Reset = 1;
    If Accum > 75 -> Reset =1;
    If Accum > 0 & Accum < 75 -> Reset = 0;</div>

    That gives out a constant value of 1 for reset for some reason, no matter what the value of the accumulator is. The accumulator being connected to the elevation of a beacon sensor.

    Sorry for the trouble people. >.>

  9. #9
    Expressionism 2.0 Syranide's Avatar
    Join Date
    Mar 2007
    Location
    Sweden
    Posts
    4,573

    Default

    "If" is unnecessary and has no purpose.

    Have you tried simply connecting a constant with a value between 0 and 75? and see if it works? Because if you are using an accumulator it is very possible that it accumulates quicker than what the debugger updates, and all you see is reset all the time.

    And although it doesn&#39;t really matter, you forgot the case where Accum is equal to 0 or 75.

    Code:
    @N Vertical
    @I Accum
    @O Reset
    Reset = 1;
    Accum > 0 & Accum < 75 -> Reset = 0;
    Code:
    @N Vertical
    @I Accum
    @O Reset
    Reset = Accum < 0 | Accum > 75
    Are two shorter ways of coding the same thing.

  10. #10
    Wire Noob Vorsai's Avatar
    Join Date
    Aug 2007
    Posts
    24

    Default

    Thanks so much.

    I wasn&#39;t expecting help from -the- expression gate person.

    Though, why wouldn&#39;t "If" be needed in that particular case if you don&#39;t mind me asking.

+ Reply to Thread
Page 1 of 2 12 LastLast

Similar Threads

  1. Expression Chip 2 and Cpu Chip aint working
    By bradmcco in forum Installation and Malfunctions Support
    Replies: 1
    Last Post: 01-19-2009, 07:53 AM
  2. Expression Chip 2 help.
    By Teh1337bix in forum Installation and Malfunctions Support
    Replies: 4
    Last Post: 12-03-2008, 10:02 PM
  3. Expression Chip
    By Pantz Master in forum Installation and Malfunctions Support
    Replies: 3
    Last Post: 09-10-2008, 05:31 PM
  4. Expression Chip: 3 = ()
    By Sharpshot in forum Bug Reports
    Replies: 4
    Last Post: 02-29-2008, 11:47 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
proceed-collector
proceed-collector
proceed-collector
proceed-collector
linguistic-parrots
linguistic-parrots
linguistic-parrots
linguistic-parrots