Lol what is this vector thruster fetish everyone is having :P
Hi, I need help getting an expression for expression 2 to make a drone that can move forward, back, side to side, and look at the angle you are looking at, purly by vector thrusters. If you were a help enough, I would give you a cookie, if I could...
Last edited by Matte; 07-19-2009 at 02:44 PM.
Lol what is this vector thruster fetish everyone is having :P
i'm not sure if you could do look angles with vector thrusters...if so it would be hard. you could do vector thrusters to go to the position and apply angular force to look id say it the easiest way. no code handouts sry.
Yeah, maybe I should use apply force, but I have no idea why that did not hit me using the idea using apply force on it though.
lol thanks if i helpedif you need help with applyforce Maso has a great tutorial thats how i learned.
I don't understand though (since I am new to the wiremod forums), why won't people handout codes when you ask for them?
Okay, ignore the last line, I found out why you should not give out codes for help, LOL.
Giving out code is a personal choice that several choose not to ever do, but there are a few like me who just want to code something. Thank you for asking for the code, this was actually fun to do because it was a bit challenging.
To make it work paste the expression on something, put 4 vector thrusters on it (location doesn't matter much), use the "Expression 2 - Wirelink" gun on each VThruster and then wire each wirelink input to a VThuster. Feed it a vector to stay at and an angle to face.
Code:@name @inputs Angle:angle Vector:vector @inputs W1:wirelink W2:wirelink W3:wirelink W4:wirelink runOnTick(1) EE=entity(),EV=EE:massCenter() LocalE=transpose(matrix(EE:right(),EE:forward(),EE:up())) LocalA=transpose(matrix(Angle:right(),Angle:forward(),Angle:up())) E1=W1:entity() E2=W2:entity() E3=W3:entity() E4=W4:entity() V1=(Vector+LocalA*(LocalE*(E1:pos()-EV))-EV)*10-E1:vel() V2=(Vector+LocalA*(LocalE*(E2:pos()-EV))-EV)*10-E2:vel() V3=(Vector+LocalA*(LocalE*(E3:pos()-EV))-EV)*10-E3:vel() V4=(Vector+LocalA*(LocalE*(E4:pos()-EV))-EV)*10-E4:vel() W1:setVector("Vector",-V1) W2:setVector("Vector",-V2) W3:setVector("Vector",-V3) W4:setVector("Vector",-V4) W1:setNumber("Mul",V1:length()) W2:setNumber("Mul",V1:length()) W3:setNumber("Mul",V1:length()) W4:setNumber("Mul",V1:length())
(\__/) Expression 2 Resources: E2 Beginner's Guide | E2 Formatting Guide | E2 Function Reference | E2 Examples | Me
(='.'=) PM me code and I'll send it back optimized if possible. (I find it fun dammit!)
(")_(") Drunkie referring to an E2: "It's obvious that Chinoto made this, his coding style is all over it."
Bookmarks