+ Reply to Thread
Results 1 to 3 of 3

Thread: Expressions for everything

  1. #1
    Wire Noob anescient's Avatar
    Join Date
    Jun 2007
    Posts
    23

    Default

    I'm only just starting with lua and these mods, so I don't know the feasability of this.

    I'd like to see simple physics objects support expressions as their parameters. For example, instead of thrusters having separate UI thingies for multiplier, min, max, etc., there would just be a textbox with an expression, with some reasonable default, such as:

    Thrust = [ clamp(Input * 100, -5000, 5000) ]

    Each left-hand-side would be fixed, as appropriate to the object, with available inputs listed. If lua has appropriate object-oriented features and the mod environment allows it, this should be easy. All that's needed is an abstraction of the expression gate's functionality, even a simplified version with only one output and no extra variables allowed.

  2. #2
    Wire Sofaking -=Fox=-'s Avatar
    Join Date
    Feb 2007
    Location
    Somewhere in my Mind...
    Posts
    1,846
    Blog Entries
    7

    Default

    Well actually you could use an expression gate to control all of your thrusters for the device you have,

    I have an example in Contraptions and Saves called a Battery Powered Buggys, I got one that runs on ONE expression Gate that does everything.

    If you need to make a thruster that will go two directions with 5000 & -5000 being the power, a little math and an expression gate will go a LONG ways

    Something Similar to:
    (Open a plan Ascii File)

    N@Two Way Thruster
    I@ ButtonA ButtonB
    O@Thrust
    Thrust = A + B
    A = ButtonA + 5000
    B = ButtonB - 5000

    This is off the top of my head so wait for a couple of replies or try it out to see if it works.

    In theory with this is if you press both at the same time it will zero it, and if no buttons are pressed it should add up to 0 so nothing will happen.
    So if you an input for ButtonA it should output 5000, and -5000 for ButtonB

    An even simpler way to try this out would be to use basic components but sometimes i find that exasperating when i know what i want the output to be.

    There maybe be a simpler way to do this.
    http://tiny.cc/OMFGWTFBBQ

    Best People On Wiremod!

    Black Phoenix, Azrael, Jat Goodwin, Magos Mechanicus, ITSBTH, Fizyk, g33v3s,tuusita, InfectiousFight, ief015

    Pointless things that are pointless, are pointlessly pointless, therefore pointlessness is pointless.
    So pointlessly pointing out the pointlessness of this pointless signature is utterly pointless.
    My IQ is 123

  3. #3
    Wirererer EntropyGuardian's Avatar
    Join Date
    Apr 2007
    Posts
    154

    Default

    I don't know exactly what the OP is asking, and I really doubt Fox's post addresses it, but in regards to this:

    Something Similar to:
    (Open a plan Ascii File)

    N@Two Way Thruster
    I@ ButtonA ButtonB
    O@Thrust
    Thrust = A + B
    A = ButtonA + 5000
    B = ButtonB - 5000

    This is off the top of my head so wait for a couple of replies or try it out to see if it works.

    In theory with this is if you press both at the same time it will zero it, and if no buttons are pressed it should add up to 0 so nothing will happen.
    So if you an input for ButtonA it should output 5000, and -5000 for ButtonB

    An even simpler way to try this out would be to use basic components but sometimes i find that exasperating when i know what i want the output to be.

    There maybe be a simpler way to do this.[/b]
    N@Two Way Thruster
    I@ButtonA ButtonB
    O@Thrust
    Thrust = (ButtonA - ButtonB) * 5000

    Would do the exact same thing. Although if you are using 5000, then I would just set the multiplier on the thruster to 5000 and use a subtract gate to save a bit of time in the long run.

+ Reply to Thread

Similar Threads

  1. Help with expressions
    By flametank952 in forum Expression 2 Discussion & Help
    Replies: 2
    Last Post: 01-06-2009, 04:48 PM
  2. Help with Expressions.
    By isdevilis in forum Installation and Malfunctions Support
    Replies: 5
    Last Post: 11-08-2008, 03:43 PM
  3. Need some help with expressions
    By Matt in forum Installation and Malfunctions Support
    Replies: 3
    Last Post: 01-11-2008, 09:52 AM
  4. Expressions
    By NIR_Fluff in forum Ideas & Suggestions
    Replies: 5
    Last Post: 05-29-2007, 02:27 PM

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