+ Reply to Thread
Results 1 to 5 of 5

Thread: E1 -> E2 Help please

  1. #1
    Wire Noob Coresyn's Avatar
    Join Date
    Jan 2010
    Posts
    2

    Question E1 -> E2 Help please

    I know E1 is going to be outdated, but I just want this code to work before I learn E2.I was wondering if someone could correct the code. I get an error that says: Expected symbol ( ; ) at line 18. Even though there is one there, I still get the error. Any help?

    Code:
    N@HoloScanner
    I@On Angle Speed Ranger QualityInc QualityDec
    O@Thrust HLen XHL YHL ZHL Fade Clear Percent Quality
    !Quality -> Quality = 4;
    ~QualityInc & QualityInc -> Quality += 1;
    ~QualityDec & QualityDec -> Quality -= 1;
    Quality < 1 -> Quality = 1;
    Quality > 8 -> Quality = 8;
     
    !On -> XHL = 0, YHL = 0, ZHL = 0, Percent = 0, LastAngle = 0, HLen = 128, Clear = 1 end;
     
    Thrust = 0
    Clear = 0
    Fade = 0.05
     
    HLen <= (Quality*2)+8 -> end;
    Speed < (Quality*24) -> Thrust = 1;
     
    LastAngle > Angle -> HLen -= (Quality*2);
    LastAngle = Angle
     
    Percent = ((128-HLen)/(120-(Quality*2)))*100
     
    Ranger > 90 -> end;
    Ranger > 0 -> XHL = cos(Angle)*(Ranger-48);
    Ranger > 0 -> YHL = sin(Angle)*(48-Ranger);
    Ranger > 0 -> ZHL = HLen;
    Last edited by Bull; 01-31-2010 at 12:03 AM.

  2. #2
    Wire Sofaking jacoby6000's Avatar
    Join Date
    Feb 2008
    Location
    behind you when you aren't looking
    Posts
    792

    Default Re: E1 -> E2 Help please

    This is mostly equations so putting it from E1 to E2 would be easy! Ill show you how to convert one of your conditionals into E2, then you should be ably to take it from there!
    E1 version
    Code:
    Quality > 8 -> Quality = 8;
    E2 version
    Code:
    if(Quality > 8){Quality = 8}
    Make all your conditionals that format, and remove the semicolons and done ^_^ oh, and change @I to @inputs etc;
    Quote Originally Posted by Garrysmod View Post
    Warning: You're trying to render in the wrong place. This doesn't play nice with multi-core rendering, so we're not going to let you draw here.
    I'm not stupid!
    In [his] experience that was a sentence never to be uttered except to prove its own inaccuracy
    --Orson Scott Card

  3. #3
    has a custom title mattwd0526's Avatar
    Join Date
    Apr 2009
    Location
    Born Bostonian
    Posts
    2,652

    Default Re: E1 Help

    Don't totally remember E1, but could it be the lack of a comma between Clear = 1 and end? (One of the earlier lines, starting with !On -> XHL = 0...)

  4. #4
    billywitchdoctor.com Whosdr's Avatar
    Join Date
    Dec 2008
    Posts
    2,300

    Default Re: E1 -> E2 Help please

    Something like this.

    Code:
    N@HoloScanner
    I@On Angle Speed Ranger QualityInc QualityDec
    O@Thrust HLen XHL YHL ZHL Fade Clear Percent Quality
    if (!Quality) {Quality = 4}
    if (~QualityInc & QualityInc) {Quality += 1}
    if (~QualityDec & QualityDec) {Quality -= 1}
    if (Quality < 1) {Quality = 1}
    if (Quality > 8) }Quality = 8}
     
    if (!On) {
        XHL = 0
        YHL = 0
        ZHL = 0
        Percent = 0
        LastAngle = 0
        HLen = 128
        Clear = 1
    }
     
    if (first()) {
        Thrust = 0
        Clear = 0
        Fade = 0.05
    } 
    
    if (HLen <= (Quality*2)+8) {"What does 'end' do?"}
    if (Speed < (Quality*24) ) {Thrust = 1}
     
    if (LastAngle > Angle) {HLen -= (Quality*2), LastAngle = Angle}
     
    Percent = ((128-HLen)/(120-(Quality*2)))*100
     
    if (Ranger > 90) {"what does 'end' do?"}
    
    if (Ranger > 0) {
        XHL = cos(Angle)*(Ranger-48)
        YHL = sin(Angle)*(48-Ranger)
        ZHL = HLen
    }
    .siht daer ot gniyrt emit detsaw ev'uoY

  5. #5
    Wire Noob Coresyn's Avatar
    Join Date
    Jan 2010
    Posts
    2

    Default Re: E1 -> E2 Help please

    Thanks for the help guys! I'll try out that code now Whosdr, and thanks Jacoby for telling me how to change it! If none of the other solutions work, I'll try and find a missing comma

    EDIT: After a few tiny edits, the code worked perfectly
    Last edited by Coresyn; 01-31-2010 at 10:29 AM.

+ Reply to Thread

Tags for this Thread

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