+ Reply to Thread
Results 1 to 3 of 3

Thread: Expression2: Direction Vector

  1. #1
    Wire Amateur RabidCrab's Avatar
    Join Date
    Jan 2008
    Location
    Oregon
    Posts
    90

    Default Expression2: Direction Vector

    Code:
    N@Proximity Mine
    I@Xin Yin Zin TimerIn RangeIn TargetIn Unlocked
    O@Xout Yout Zout EngineOn VectorOn Detonate TimerOut
    interval(1000/60)
    TargetIn == 1 & TimerIn < 3 & A == 1 ->
    TimerOut = 1,
    Xout = 0,
    Yout = 0,
    Zout = -100;
    VectorOn = 10000,
    TargetIn == 1 & TimerIn > 3 & A == 1 ->
    VectorOn = 10000 * (TimerIn > 1.8),
    Xout = Xin /-1,
    Yout = Yin /-1,
    Zout = Zin /-1;
    TargetIn == 1 & RangeIn < 50 & TimerIn > 3 & A == 1 ->
    Detonate = 1;
    TargetIn == 0 & TimerIn > 3 & A == 1 ->
    Detonate = 1;
    Unlocked == 1 ->
    A = 1;
    I'm interested in porting this to Expression2 and pushing it into a combined vector, but I'm not sure how to get the direction vector of the target, like this expression uses. I looked around the wiki and played with the expression for a while, but I can't figure it out . Anyone know how to get the direction vector of a target?

  2. #2
    Arc
    Arc is offline
    Wirererer Arc's Avatar
    Join Date
    Jan 2008
    Posts
    178

    Default Re: Expression2: Direction Vector

    Code:
    @inputs Target:entity
    @Outputs Direction:vector
    Direction = (entity():pos() - Target:pos())
    Scott: You can gib a child with one stroke of the nanosword!
    Chris: That's because children have fewer hit points. They are inferior and weak.

  3. #3
    Wire Amateur RabidCrab's Avatar
    Join Date
    Jan 2008
    Location
    Oregon
    Posts
    90

    Default Re: Expression2: Direction Vector

    Thanks Arc, that did it. Feel like an idiot for not figuring that one out

+ Reply to Thread

Similar Threads

  1. [E2 Help] Entity -> Direction Vector
    By Alchemise in forum Expression 2 Discussion & Help
    Replies: 7
    Last Post: 02-15-2009, 02:22 PM
  2. Vector Thrusters and Vector Direction with a Pod
    By zentiger in forum Installation and Malfunctions Support
    Replies: 8
    Last Post: 09-26-2008, 12:01 AM
  3. Finding direction for vector thruster
    By sukasa in forum Installation and Malfunctions Support
    Replies: 3
    Last Post: 01-03-2008, 08:38 AM
  4. Normalizing vector direction.
    By Shockbolt in forum Installation and Malfunctions Support
    Replies: 6
    Last Post: 11-17-2007, 04:28 AM
  5. Beacon Sensor "direction vector" suggestion
    By kuro11 in forum Ideas & Suggestions
    Replies: 10
    Last Post: 08-20-2007, 08:04 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