Javelin missle.

this is currently a WIP but what i need to know is how to make you lock onto some thing with your mouse. like using E:shootPos() but then i would want it to save that entity somewhere so i can fire after i stop looking at it.

Are you in a seat or not?

If not, you can use laser pointer

aha! You want


if(Updatetarget){Target = owner():aimEntity()}

Works both in and out of a seat.

MacTrekkie plz explain

whats updatetarget do

im aiming to make it all applyAngForce and applyForce.
my current code is:
NOTE: everything is yet to be tested i havent been on gmod and wont be till next saturday
post any corrections



@inputs Time1 MakeTarget Fire ## T1 starts main engine going upwards after it equals 0 it heads down.
@persist EngActv Target Exp:entity Up P:ang Y:ang R:ang
Me=owner()

if(MakeTarget){Target=owner():shootPos()}

Exp:entity()

if(Time1 >1.5){EngActv ? 1:0}


if(Time1>1.5 & Time1<9){Up ? 75:0}

if(Time1>1.5 & Time1<9){P= Exp:angles():pitch()-Up}
elseif(Time1>9){P=Exp:elevation(Target)}

Y=Exp:bearing(Target)

R=Exp:angles():roll()

Gyro= -ang(P,Y,R)*1000*EngActv

Exp:applyAngForce(Gyro+$Gyro*5)

Exp:applyForce (entity:forward()*1000*Fire)##Initial launch

Exp:applyForce (entity:forward()*500*EngActv) ##500 may be changed (missile speed)

if(EngActv==1){Exp:setTrails(4,4,4,"trails/smoke",V,255)} ##the V is still to be determined since i dont know the numbers for gray


[editline]10:25PM[/editline]

what abstrakt said

Updatetarget could just be an input that you activate when you want to target what you’re aiming at. That way it will only adjust the target when you press a button but afterwards it would save that location if you look away.

Exactly. I assume he wanted to target players, so all he has to do is look at a player and press a button, numpad input, whatever, he has wired to the input updatetarget. It will target whatever entity you are aiming at.

O i get it

could someone try to paste this into an e2 and test it? i cant until next saturday. and also what is persist

this is currently a WIP but what i need to know is how to make you lock onto some thing with your mouse. like using E:shootPos() but then i would want it to save that entity somewhere so i can fire after i stop looking at it.

If you’re going to use a value in expression to it needs to be defined somewhere.
You can do this in @Inputs , @Persist and @Output. Persist is just like input and output except that only the e2’s sees it. So when you’re not going to be using it for something else, or aren’t taking it from something else, then it should be persist.

streetfight why did you repost my thing? and kp3 so if you look at my expression i would put: Up Target EngActv Exp:entity Gyro?

thanks everyone!

this is currently a WIP but what i need to know is how to make you lock onto some thing with your mouse. like using E:shootPos() but then i would want it to save that entity somewhere so i can fire after i stop looking at it.

this is currently a WIP but what i need to know is how to make you lock onto some thing with your mouse. like using E:shootPos() but then i would want it to save that entity somewhere so i can fire after i stop looking at it.


(User was banned for this post ("Spam" - SteveUK))

Hi mambu!

streettfight why are you spamming

could someone check my code for any errors? and say if it would actually work?

Post it when you’re done, I’d like something like this