using a math_counter's current value

Discussion in 'Mapping Questions & Discussion' started by KlashFire, Sep 13, 2015.

  1. KlashFire

    KlashFire L1: Registered

    Messages:
    17
    Positive Ratings:
    1
    yes, I know ongetvalue and getvalue are a thing, but I am new to this and very confused.

    is there a way to get the current value of a math_counter and use it in a logic_case

    i.e. if the mathcounter is currently set to 5, make the button press in
     
  2. henke37

    aa henke37

    Messages:
    1,919
    Positive Ratings:
    449
    The OnGetValue will forward the current value to the reciving entity. So forward it to the logic_case entity.
     
    • Thanks Thanks x 1
  3. KlashFire

    KlashFire L1: Registered

    Messages:
    17
    Positive Ratings:
    1
    thanks, but can you show me how this would be done in an output. still a bit confused.
    I want to make it so that if the math_counter has a value of, lets say, 5 - a button will press in.

    also, weren't you one of the "hackers" on the ace attorney translation project?
     
  4. worMatty

    aa worMatty Repacking Evangelist

    Messages:
    1,072
    Positive Ratings:
    836
    logic_case can be told to fire a specific set of Case outputs when you send it an InValue input.

    Name your case values like this. The names correspond to the math_counter values you want stuff to happen with:

    [​IMG]

    This is what the logic_case's Outputs tab would look like:

    [​IMG]

    Then set up your math_counter:

    [​IMG]

    OutValue fires each time the math_counter's value is changed. So if you plan for something to happen on every math_counter value (say you have five buttons) then that's what you probably want to use.

    If you only want something to happen when the math_counter hits 5, then you set its Maximum Legal Value to 5 and you use the OnHitMax output instead. That fires when the math_counter hits its maximum value. The maximum value is clamped, so it will never go higher than that.

    [​IMG]

    OnGetValue only fires when you send the math_counter the GetValue input. It's a good way of keeping track of a number, and then outputting it on demand. Not sure what you need all this for, but that's just so you know.

    See the inputs and outputs information for this entity at the wiki.
     
    • Thanks Thanks x 5