Closed Thread
Page 11 of 353 FirstFirst ... 9101112132161111 ... LastLast
Results 101 to 110 of 3521
Like Tree5Likes

Thread: Expression Gate 2

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

    Default Re: Expression Gate 2

    Quote Originally Posted by taz_doh View Post
    first question: what is :VECTOR and :NORMAL???
    second: did you really need to put @persist
    and the last one: did you put the ~ function???
    Just to make it clear, :NORMAL is implied if nothing if specified, so "A" is identical to "A:NORMAL", so don't use NORMAL.

    In addition to shandolums answer on question two.

    @persist (as you might've understood) specifies that a value is persistent, this is done for a number of reasons, one reason is that this allows the compiler to tell you if you are using a variable that does not exist (aka misspellt) which can be very helpful.
    [a possiility is that I add a "@persist all" option that makes all variables persistent (aka egate1 style), we'll see]

    It is also because the compiler now needs to know the type of variables, although it can deduce types itself, the type of a variable could potentially change during the execution. So this is a way of also forcing you to specify that.

    Another reason is that it is very common for people to forget to reset variables on each execution which causes previous value to persist. This makes sure that this does not happen.

    Currently, you are not allowed to use variables which are not guaranteed to be initialized (or persistent), this will probably be relaxed to allow use of variables which are potentially initialized to simplify the language slightly and because it is probably very very useful/common aswell.

    Code:
    if(...) {
        A = 0
    } else {
        A = 1
    }
    B = A // A is guaranteed to be initialized
    Code:
    if(...) {
        A = 0
    }
    B = A // A is potentially initialized (currently not allowed, but probably will be)
    Code:
    B = A // A is never initialized (never allowed unless A is persistent)
    (Also, ~Variable is implemented in the latest revision)
    Last edited by Syranide; 08-31-2008 at 06:10 PM.

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

    Default Re: Expression Gate 2

    Quote Originally Posted by taz_doh View Post
    where you can found the commands.txt?
    can i have a definition of :NORMAL??
    and what is the error :Expected symbol (lcb) Near Variable (X1) at line 161
    line 161 was:
    Code:
    X1=X2=X3=X4=X5=X6=X7=X8=X9=X=Ox=0
    I know I got a lot of question^_^

    Edit:its
    Code:
    if(Condition1&Condition2){
    A=B
    }
    You solved it I presume?
    Anways, for reference until we get better error message, LCB is left curly bracket {. Meaning that you had forgot to put a { after your if-condition.

  3. #103
    Wirererer taz_doh's Avatar
    Join Date
    May 2007
    Location
    Quebec
    Posts
    154

    Default Re: Expression Gate 2

    there is another question:where can i found a list of the error??
    because now i got
    Code:
    expected symbol(rpa) near variable (Xi) at line 204
    and this is my line...
    Code:
    O=sqrt((Ox-Xi)^2)
    edit: I found where i can see what was the error but I'm not able to fix mine...
    thanks you for your help Syranide and shandolums

    Edit(Again):is the sin function was there?most precisely asin?
    and is sqrt work or no?
    Last edited by taz_doh; 08-31-2008 at 07:22 PM.
    VIVE LE QUEBEC
    sorry if I write some non-existent words

  4. #104
    GUN
    GUN is offline
    Wire Sofaking GUN's Avatar
    Join Date
    Jan 2008
    Location
    California
    Posts
    668

    Default Re: Expression Gate 2

    questions. why is there no "save as" button and, is += added ? cause as soon as i try to use it i get
    Code:
    entities\gmod_wire_expression2\core/init.lua:912: attempt to call field '?' (a nil value)
    add: what is the shortcut to open the editor? if i right click i get this


    Code:
    entities/gmod_wire_expression2/init.lua:167: attempt to concatenate global 'outputs' (a nil value)

    Maybe we're all gonna die, but we're gonna die in *really cool ways*.





  5. #105
    Wirererer taz_doh's Avatar
    Join Date
    May 2007
    Location
    Quebec
    Posts
    154

    Default Re: Expression Gate 2

    you need to update your svn and you need to do 2click on the gate you want to edit
    VIVE LE QUEBEC
    sorry if I write some non-existent words

  6. #106
    GUN
    GUN is offline
    Wire Sofaking GUN's Avatar
    Join Date
    Jan 2008
    Location
    California
    Posts
    668

    Default Re: Expression Gate 2

    i have latest svn, but when i get the exp tool out, if youu look at the description thing it says secondary: open expression gate in editor, but when i right click all i get is that error

    edit add: turns out that you cant bunch up anything with - cause i tried to do F-S and it got that error so it seams that you have to space out the - in any case this is error "entities\gmod_wire_expression2\core/init.lua:944: attempt to concatenate field '?' (a nil value)"
    Last edited by GUN; 08-31-2008 at 08:24 PM.

    Maybe we're all gonna die, but we're gonna die in *really cool ways*.





  7. #107
    Wirererer taz_doh's Avatar
    Join Date
    May 2007
    Location
    Quebec
    Posts
    154

    Default Re: Expression Gate 2

    did you try to do double click in the menu, on the gate you want to edit?

    and did you got the output/input when you spawn your gate?
    Last edited by taz_doh; 08-31-2008 at 09:41 PM.
    VIVE LE QUEBEC
    sorry if I write some non-existent words

  8. #108
    GUN
    GUN is offline
    Wire Sofaking GUN's Avatar
    Join Date
    Jan 2008
    Location
    California
    Posts
    668

    Default Re: Expression Gate 2

    Quote Originally Posted by taz_doh View Post
    did you try to do double click in the menu?

    and did you got the output/input when you spawn your gate?
    yea i can reopen the menu, but im saying that the secondary mouse function is missing. you should be able to reopen the editor with second mouse click but it doesn't work

    add: just finished my first big exp2 code and im happy how it turned out
    Code:
    @name CALC V2
    @inputs ZERO ONE TWO THREE FOUR FIVE SIX SEVEN EIGHT NINE R
    @inputs PLUS MINUS DIVIDE MULTIPLY EQUAL CLEAR
    @outputs SCREEN V V1 V2 V3
    @persist V V1 V2 V3
    
    if(ZERO){V=V*10}
    if(ONE){V=V*10+1}
    if(TWO){V=V*10+2}
    if(THREE){V=V*10+3}
    if(FOUR){V=V*10+4}
    if(FIVE){V=V*10+5}
    if(SIX){V=V*10+6}
    if(SEVEN){V=V*10+7}
    if(EIGHT){V=V*10+8}
    if(NINE){V=V*10+9}
    if(R){V=0}
    if(V>=9999999){V=9999999}
    
    if(PLUS){V1=V V=0 V2=1}
    if(MINUS){V1=V V=0 V2=2}
    if(DIVIDE){V1=V V=0 V2=3}
    if(MULTIPLY){V1=V V=0 V2=4}
    
    if(EQUAL&V2==1){SCREEN=V3=V V=V1+V}else{SCREEN=V}
    if(EQUAL&V2==2){SCREEN=V3=V V=V1 -V}
    if(EQUAL&V2==3){SCREEN=V3=V V=V1/V}
    if(EQUAL&V2==4){SCREEN=V3=V V=V1*V}
    
    if(EQUAL&V2==3&V3==0){CLEAR=1}
    
    if(CLEAR){V=0 V1=0 V2=0 V3=0 SCREEN=0}
    its a calculator that takes numbers by a 10 button keypad and then saves it to some VRAM inside the exp2 and then saves the second set of numbers AND the button for add subtract mul and divide and saves that to a different ram location "V2" for the arithmetic VRAM and then pessing EQUAL will save the final to "V3" and then display the data in "V3" and it doesent let you divide by 0 lol. ide say not too bad for just starting out about 3 hours ago :P
    Last edited by GUN; 08-31-2008 at 11:25 PM.

    Maybe we're all gonna die, but we're gonna die in *really cool ways*.





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

    Default Re: Expression Gate 2

    Quote Originally Posted by koolrob4002 View Post
    questions. why is there no "save as" button and, is += added ? cause as soon as i try to use it i get
    Code:
    entities\gmod_wire_expression2\core/init.lua:912: attempt to call field '?' (a nil value)
    You are correct, the special assignments are not implemented, I'll try to have them fixed today.
    EDIT: These are now available in the latest revision, thanks!

    Quote Originally Posted by koolrob4002 View Post
    add: what is the shortcut to open the editor? if i right click i get this


    Code:
    entities/gmod_wire_expression2/init.lua:167: attempt to concatenate global 'outputs' (a nil value)
    I don't think there is a shortcut right now, but I'm not sure, shandolum knows.
    Last edited by Syranide; 09-01-2008 at 03:19 AM.

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

    Default Re: Expression Gate 2

    Quote Originally Posted by taz_doh View Post
    there is another question:where can i found a list of the error??
    because now i got
    Code:
    expected symbol(rpa) near variable (Xi) at line 204
    and this is my line...
    Code:
    O=sqrt((Ox-Xi)^2)
    edit: I found where i can see what was the error but I'm not able to fix mine...
    thanks you for your help Syranide and shandolums

    Edit(Again):is the sin function was there?most precisely asin?
    and is sqrt work or no?
    As for the first, there seems to be some error in the parser, add spaces around the minus for now, it currently interprets it as something else right now for some reason. Adding spaces fixes it. (EDIT: Now fixed! There was an internal conflict that had accidentally got the same name as the subtract-rule)

    Can't really understand what you are saying last, sin works, asin is there as well and sqrt should work.

    EDIT: line 204 :lol:
    Last edited by Syranide; 09-01-2008 at 03:13 AM.

Closed Thread
Page 11 of 353 FirstFirst ... 9101112132161111 ... LastLast

LinkBacks (?)


Similar Threads

  1. Expression Gate : Can't save expression
    By m0nday in forum Bug Reports
    Replies: 2
    Last Post: 08-06-2008, 12:29 PM
  2. Gate - Expression -> Gone!
    By Qvazzler in forum Installation and Malfunctions Support
    Replies: 10
    Last Post: 05-25-2007, 10:26 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