+ Reply to Thread
Page 9 of 40 FirstFirst ... 789101119 ... LastLast
Results 81 to 90 of 399

Thread: Expression Gate Documentation

  1. #81
    Wirererer Core Xii's Avatar
    Join Date
    May 2007
    Location
    Finland
    Posts
    393

    Default

    Just a note on delta however, delta does not refer to the last execution, but the last assignment to that variable (that's why delta actually works when you have multiple inputs).[/b]
    Oh, so the delta from its last change? Makes more sense.
    Grammar is the difference between "helping your uncle, Jack, off his horse" and "helping your uncle jack off his horse".

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

    Default

    Thanks alot that's cleared quite a few things up. Is there anyway of working out how much something is decreasing in by second or something like that. Thanks so much. So to make somin wait five seconds before it closes I would do the following.

    Hydraulic >= 230 -> Hydraulic = 0 schedule (1000)

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

    Default

    There is no construct for making it get delta for the last second or so, but you can do it yourself (since you have both CurTime() and schedule()/interval()). If you don't want to use delta that is, that gives you the distance since the last update.

  4. #84
    Wire Amateur llivavin's Avatar
    Join Date
    Jun 2007
    Posts
    52

    Default

    Hrm can you explian vectors a bit more?
    I am an ass, Get the fuck over it.

  5. #85
    Wirererer Ergzay's Avatar
    Join Date
    Jun 2007
    Posts
    232

    Default

    I've tried to make a hydraulic drawbridge that acts as the value of a timer. This way instead of it slamming ackwardly open when a value is entered into the hydraulic controller, it will gradually and smoothly open. However then hydraulic remains at the value '1'. I need some help sorting out the code.
    D is connected to a Beacon Sensor that outputs the distance.
    P1 is connected to a Pulser and R1 is the output to Run it.
    P2 is connected to another pulser and R2 is the output to Run it.
    P3 is connected to another pulser and R3 is the output to Run it.
    B1 is connected to a button which has the purpose of stopping every opening of the drawbridge after it's been pressed.
    L is connected to the output length of two hydraulic controllers.

    Even though this all seems to have no problems it doesn't want to work. The hydraulic simply remains at 1, and yes it is unfrozen, ballsocketed and isn't welded to anything. Thanks for any help .[/b]
    I'm not sure if you have gotten this question answered already, but why don't you just set the pulse time of a single pulsar to .33 seconds. You could simplify the code a lot and it would work just as well if I get what you are trying to do.
    Your code is a little too confusing to try and simplify it from there as you are using some odd things.
    Very simply in psuedocode:
    If person is close enough then
    every pulse increment hydraliclength +1
    until hydraliclength == finishlength

    You just simply tweak it to your uses by changing the pulse length shorter or longer and the increment larger or smaller.

  6. #86
    Wirererer Ergzay's Avatar
    Join Date
    Jun 2007
    Posts
    232

    Default

    I'm wondering if I can do nested if statements and how would I go about them
    for example:

    Code:
    Out = (First == 1 ? (Second == 1 ? 2 : 1) : (Second == 2 ? 3 : 4))
    Would that work? and could you combine them with "->" as well?

    Could you also do:

    Code:
    This == 1 -> (Also == 1 ? Alsoalso = 1 : Alsoalso = 0);

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

    Default

    Hrm can you explian vectors a bit more?[/b]
    Well I don't really want to go into it, because if you haven't read the math it won't do you any good, the best I can tell you is to google for tutorials on it if you really want to mess around with it. Anyways, vectors allow you to specify points and movement in 3D space, vector support basically gives you access to all the common functions used for calculating with them. Examples could be a GPS to GPS-beacon sensor, more advanced flight control or missile guiding etc.

    I'm wondering if I can do nested if statements and how would I go about them
    for example:

    Code:
    Out = (First == 1 ? (Second == 1 ? 2 : 1) : (Second == 2 ? 3 : 4))
    Would that work? and could you combine them with "->" as well?

    Could you also do:

    Code:
    This == 1 -> (Also == 1 ? Alsoalso = 1 : Alsoalso = 0);
    [/b]
    Both of those are possible, but:

    Code:
    This == 1 -> (Also == 1 ? Alsoalso = 1 : Alsoalso = 0);
    Should be:

    Code:
    This == 1 -> Alsoalso = (Also == 1 ? 1 : 0);
    Or simply:

    Code:
    This == 1 -> Alsoalso = Also == 1;
    But it is possible to nest multiple -> too, "A -> ..., B -> ... ; ... ;"

  8. #88
    Wire Amateur llivavin's Avatar
    Join Date
    Jun 2007
    Posts
    52

    Default

    could you give a simple vector expression ((wanna see if what i understand of it is right))
    I am an ass, Get the fuck over it.

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

    Default

    Code:
    V = vector(1, 2, 3)
    
    V = vecmul(V, V)
    Legth = veclength(V)
    
    X = vecx(V)
    P = vecpitch(V)
    Some non-sense code I wrote in the expression gate thread.

  10. #90
    Wire Sofaking Shandolum's Avatar
    Join Date
    Apr 2007
    Location
    Europe -> Denmark
    Posts
    887

    Default

    Could you add the delta(rectified) option to the expression-chip. Would be really usefull.

    Also messed around with your vector funktion, NICE.
    Code:
    N@Vector test
    I@X1 X2 Y1 Y2 Z1 Z2
    O@Pitch Yaw Distance
    
    V1=vector(X2-X1, Y2-Y1, Z2-Z1)
    Pitch=(vecpitch(V1)>180?-360+vecpitch(V1):vecpitch(V1))
    Yaw=vecyaw(V1)-180
    Distance=veclength(V1)
    Will make a -180 to 180 pitch and yaw out of two points in space. And distance between them.

    Messed around some more:
    Code:
    N@Vector test 2
    I@X1 X2 Y1 Y2 Z1 Z2 Length
    O@DX DY DZ
    
    #First the vectors for the two GPS
    VA****= vector(X1, Y1, Z1)
    VB****= vector(X2, Y2, Z2)
    
    #Then making the vector
    V1****= vecsub(VA, VB) #Subtracting them
    
    #Now for the normalization of the vector
    V2****= vecnormalize(V1) #The normalized vector
    
    #Now to put it to good use (hoverdrive)
    V3****= vecsmul(V2, Length) #Length = distance in units the vector will be. Multiplying the normalized vector with the length.
    Destination = vecadd(V3, VA) #Adding the new vector to the original position (point of origin).
    DX****= vecx(Destination) #The X value for the destination
    DY****= vecy(Destination) #The Y value for the destination
    DZ****= vecz(Destination) #The Z value for the destination
    And now you have a good hover drive expression-gate that teleports you a set distance forward.
    This would be better if you could use the X Y Z values from the hover drive as the point of origin.
    Everything can be improved upon. Nothing is Perfect.
    The only way to move forward, is to surpass what has already been done.
    Creator of many things.

+ Reply to Thread
Page 9 of 40 FirstFirst ... 789101119 ... 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