+ Reply to Thread
Page 5 of 40 FirstFirst ... 3456715 ... LastLast
Results 41 to 50 of 399

Thread: Expression Gate Documentation

  1. #41
    Wire Noob Drax's Avatar
    Join Date
    May 2007
    Posts
    8

    Default

    Ok I'm only 14 so I haven't really got into all this math, logic etc...

    However I've started understanding wire alot with normal gates. However the new Expression Gate is obviously the way forward if I want to become good at wire (as it reduces lag and simplifies the use of 15 gates into a mere 1.) I just need a few quick questions answered.

    I'm guessing this is how to do a simple addition/subtraction using the Expression Chip.

    Code:
    N@Addition/Subtraction
    I@A B C D
    O@Min Add
    Add = A + B
    Min = C - D
    I hope thats correct, if not could somebody go over it quickly, you know point out mistakes, or even tell me a simplier way of getting the same result. Thanks.

    One big problem I'm having however is understand how the Timer works (the one listed on the documentation). Could someone run over that, specifically why and how it's working, the most daunting bit is where you have Timer & Timer Plus the packages bit please.

    Oh I'm basically working on a alarm clock sort of device, so understanding that Timer area would be really helpful atm . Anyway one big thing I've been banging my head to work out is this. Basically the Timer in the documentation outputs minutes, hours and seconds. So I was wondering how is it possible to make three buttons one that sets the minutes, hours, and seconds (everytime I press them the minutes etc increase by one), and like a normal alarm clock if I try to set the seconds greater than 59 it reverts to 0. Then I can use the other button to up the hours and the other to change the minutes (reverts to 0 if greater than 59.)

    I basically want the above to be part of the Timer device in the documentation with it's own seperate screens displaying Hours, Minutes and Seconds that I put in and change with the three buttons. I of course will know how to connect it to the other Timing device in the Expression Gate, I just don't understand how to get the mainframe of this alarm setting area to work. Please help.

    Another thing is that I understood one of your replies up to this point:

    Code:
    Input1 & Input2 -> Out = 1;
    So, Input1 == 1 in that can be translated to (Input1 != 0) ... that is it is not zero, which translates to just Input1 (note they are not equal, but for the 0/1 case they are)

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

    Default

    Ok I'm only 14 so I haven't really got into all this math, logic etc...

    However I've started understanding wire alot with normal gates. However the new Expression Gate is obviously the way forward if I want to become good at wire (as it reduces lag and simplifies the use of 15 gates into a mere 1.) I just need a few quick questions answered.

    I'm guessing this is how to do a simple addition/subtraction using the Expression Chip.

    Code:
    N@Addition/Subtraction
    I@A B C D
    O@Min Add
    Add = A + B
    Min = C - D
    I hope thats correct, if not could somebody go over it quickly, you know point out mistakes, or even tell me a simplier way of getting the same result. Thanks.

    One big problem I'm having however is understand how the Timer works (the one listed on the documentation). Could someone run over that, specifically why and how it's working, the most daunting bit is where you have Timer & Timer Plus the packages bit please.

    Oh I'm basically working on a alarm clock sort of device, so understanding that Timer area would be really helpful atm . Anyway one big thing I've been banging my head to work out is this. Basically the Timer in the documentation outputs minutes, hours and seconds. So I was wondering how is it possible to make three buttons one that sets the minutes, hours, and seconds (everytime I press them the minutes etc increase by one), and like a normal alarm clock if I try to set the seconds greater than 59 it reverts to 0. Then I can use the other button to up the hours and the other to change the minutes (reverts to 0 if greater than 59.)

    I basically want the above to be part of the Timer device in the documentation with it's own seperate screens displaying Hours, Minutes and Seconds that I put in and change with the three buttons. I of course will know how to connect it to the other Timing device in the Expression Gate, I just don't understand how to get the mainframe of this alarm setting area to work. Please help.[/b]
    That should work correctly.
    Regarding the time, check the examples, there is a working clock somewhere in there, and if you search these forums you will find tutorials on making a clock.

  3. #43
    Wire Noob Drax's Avatar
    Join Date
    May 2007
    Posts
    8

    Default

    That should work correctly.
    Regarding the time, check the examples, there is a working clock somewhere in there, and if you search these forums you will find tutorials on making a clock.[/b]
    [code]One big problem I'm having however is understand how the Timer works (the Example one listed on the documentation). Could someone run over that, specifically why and how it's working, the most daunting bit is where you have Timer & Timer blink.gif

    I don't understand how or why it's working in the documentation, could you explain.

    Oh btw I didn't want help making a clock I wanted to add a alarm setting feature to it as explained in my last post. Please get back to me on that. Thanks a box anyhow

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

    Default

    [code]One big problem I'm having however is understand how the Timer works (the Example one listed on the documentation). Could someone run over that, specifically why and how it's working, the most daunting bit is where you have Timer & Timer blink.gif

    I don't understand how or why it's working in the documentation, could you explain.

    Oh btw I didn't want help making a clock I wanted to add a alarm setting feature to it as explained in my last post. Please get back to me on that. Thanks a box anyhow [/b]
    "~Timer & Timer" is the same as saying, if Timer was triggered and is true, that is, if it just changed value and is one. Which put in perspective means that whatever code is behind should only be run everytime the timer "pulses".

    Making an alarm would only be adding checks whether the current time is the same as the alarm-time, basically if "Hours == AHours & Minutes == AMinutes & Seconds = ASeconds -> ... *sound the alarm* ...;". Inside the "~Timer & Timer"-conditional, so that it can't be triggered many times in one second.

  5. #45
    Wire Amateur bprater's Avatar
    Join Date
    May 2007
    Location
    SW Florida
    Posts
    75

    Default

    Timer:

    Inputs: Run Reset
    Outputs: Time

    Toss a timer on the ground. Hit it with the debugger tool so you can see what's going on. Not outputting any time yet, eh?

    Ok, let's fix it. It needs to go HIGH or 1 on its run input. Put down a toggle wired button with values 1 on/0 off. Wire it to the timer. Press the button.

    Watch your debugger. It should start ticking up! Woohoo, we have time!

    Ok, if we are doing a count-up or count-down timer, we are gonna need it to reset. Snap another button down, this time a non-toggled one (a momentary switch) and wire it to the reset. Press the reset, the timer will reset to 0.

    Woot. That's it.

    When we use it with an ExpressionChip, it wires up a bit differently.

    The EC will look like this:
    @I Timer Button
    @O TimerGo TimerReset

    You'll have one wire coming in from the timer and 2 going out. The EC will be in control of the timer.

    Button = 1 -> TimerGo = 1;

    This will be your ninja move here:

    TimerReset = 0, Timer > 5 -> TimerGo = 0, TimerReset = 1;

    Learn what that line does and you are golden.

  6. #46
    Wire Noob Drax's Avatar
    Join Date
    May 2007
    Posts
    8

    Default

    Huge edit, I got things on the role with one huge problamo. The buttons work how I wanted. I can set the alarm for minutes, seconds and hours seperately. Plus when I get up to 59 in minutes/seconds the minutes/seconds revert to 0 like a normal alarm clock, as do the hours after 24. Only big problem is the timer on the main page does something extremely different.

    Instead of converting each 60 seconds into 1 minute and starting the second count again. It simple does the following:
    3min 180secs
    Unlike my alarm clock which I got working that allows me to set the time like so:
    3min 38sec
    The reason why this is bad is because people using the alarm clock won't understand because the top screens showing the actual timer will have:
    3min 218 and the bottom screens will show what the alarm is set to as, 3 min 38. Plus the fact a normal alarm clock reverts to 0 when the seconds get to 60 and adds 1 to the minutes.

    Here's My code strangely the minutes won't go up but the seconds do revert to zero, any help optomizing this code and fixing this problem is much appreciated...

    Code:
    N@Alarm Clock
    I@T R B1 B2 B3 A
    O@H M S AH AM AS
    ~T & T -> S += 1;
    ~R & R -> S = 0 -> H = 0 -> M = 0;;;
    S >= 60 -> S=0 -> M += 1;;
    M >= 60 -> M=0 -> H += 1;;
    ~B1 & B1 -> AH += 1;
    ~B2 & B2 -> AM += 1;
    ~B3 & B3 -> AS += 1;
    AH >= 24 -> AH = 0;
    AM >= 59 -> AM= 0;
    AS >= 59 -> AS=0;
    AS == S -> AH == H -> AM == M -> A = 1;;;
    Code:
    T = Timer
    R = Reset
    B1 =First Alarm Button (changes seconds) 
    B2 = Second Alarm Button (changes minutes) 
    B3 = Third Alarm Button (changes hours) 
    A = Alarm 
    H= Hours 
    M= Minutes 
    S = Seconds 
    AH=Alarm Hours (hours set on the alarm)
    AS=Alarm Seconds (seconds set on alarm)
    AM=Alarm Minutes (minutes set on alarm)

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

    Default

    It won't go up because you do:
    "S >= 60 -> S=0 -> M += 1;;"
    Which is the same as saying, if S is greater or equal to 60 THEN set S to 0, and if S/0 is non-zero then increase minutes.

    What you want to do is:
    "S >= 60 -> S=0, M += 1;"

  8. #48
    Wire Noob Drax's Avatar
    Join Date
    May 2007
    Posts
    8

    Default

    It won't go up because you do:
    "S >= 60 -> S=0 -> M += 1;;"
    Which is the same as saying, if S is greater or equal to 60 THEN set S to 0, and if S/0 is non-zero then increase minutes.

    What you want to do is:
    "S >= 60 -> S=0, M += 1;"[/b]
    Ah thanks so much!

    Here we go, works like a charm:

    Code:
    N@Alarm Clock
    I@T R B1 B2 B3 B4
    O@H M S AH AM AS A
    ~T & T -> S += 1;
    ~R & R -> S = 0, H = 0, M = 0;
    S >= 60 -> S=0, M += 1;
    M >= 60 -> M=0, H += 1;
    ~B1 & B1 -> AH += 1;
    ~B2 & B2 -> AM += 1;
    ~B3 & B3 -> AS += 1;
    AH >= 24 -> AH = 0;
    AM >= 59 -> AM= 0;
    AS >= 59 -> AS=0;
    A = 0
    Time2 = (AH * 3600) + (AM * 60) + AS
    Time =**(H * 3600) + (M * 60) + S
    Time2 == Time -> A = 1;
    ~B4 & B4 -> AH = 0, AM = 0, AS = 0;

  9. #49
    Wire Noob rickito's Avatar
    Join Date
    May 2007
    Location
    Spain
    Posts
    13

    Default

    I've been looking for a while here and in the thread about EG and I couldn't find if the codes are somewhere saved as txt files so I can tweak them from Windows and not from the game. Maybe you know where they are stored?

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

    Default

    I've been looking for a while here and in the thread about EG and I couldn't find if the codes are somewhere saved as txt files so I can tweak them from Windows and not from the game. Maybe you know where they are stored?[/b]
    Your saved expressions are saved in /steam/steamapps/.../garrysmod/garrysmod/data/expressiongate , and you can also edit them outside of the game, HOWEVER, make sure your lines do not exceed 92 chars or you are in for trouble when loading them into the game later.

+ Reply to Thread
Page 5 of 40 FirstFirst ... 3456715 ... LastLast

Similar Threads

  1. !!!OLD!!! Documentation of hi-speed devices
    By Black Phoenix in forum CPU, GPU, and Hi-speed Discussion & Help
    Replies: 98
    Last Post: 02-10-2011, 07:41 PM
  2. !!!OLD!!! ZGPU Documentation
    By Black Phoenix in forum CPU, GPU, and Hi-speed Discussion & Help
    Replies: 38
    Last Post: 11-29-2010, 04:54 PM
  3. !!!OLD!!! ZCPU Documentation
    By Black Phoenix in forum CPU, GPU, and Hi-speed Discussion & Help
    Replies: 144
    Last Post: 09-05-2010, 03:46 AM
  4. Moongate Documentation
    By BlackNecro in forum Wiremod Addons & Coding
    Replies: 24
    Last Post: 04-22-2009, 01:32 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