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
[code]if(Updatetarget){Target = owner():aimEntity()}[/code]
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
[code]
@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
[/code]
[editline]10:25PM[/editline]
what abstrakt said
[QUOTE=Abstrakt;19813142]whats updatetarget do[/QUOTE]
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.
[QUOTE=krail9;19814409]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.[/QUOTE]
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.
[QUOTE=alexxx4156;19823019]could someone try to paste this into an e2 and test it? i cant until next saturday. and also what is persist[/QUOTE]
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.
[QUOTE=StreetFight;19828314]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.[/QUOTE]
[QUOTE=MacTrekkie;19811743]aha! You want
[code]if(Updatetarget){Target = owner():aimEntity()}[/code]
Works both in and out of a seat.[/QUOTE]
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.
[highlight](User was banned for this post ("Spam" - SteveUK))[/highlight]
[QUOTE=StreetFight;19829319]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.[/QUOTE]
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
sure thing. btw the basically done code is at the top right now
Unsmart make me admin.
[QUOTE=L-NAESA;20018516]Unsmart make me admin.[/QUOTE]
What are you talking about?
OK TESTED AND EPIC FAIL. if anyone could run it and modify it then good
[QUOTE=alexxx4156;19810199]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.[/QUOTE]
Is there gonig to be a pic or something? Otherwise I think this thread fails.
well it ended up failing anyway look at previous post..
[QUOTE=L-NAESA;20018516]Unsmart make me admin.[/QUOTE]
Lol.
--------
Today I finished my holo javelin, will be releasing on wiremod, so you can see the code there. It does exactly what you want it to do.
cool il make sure too look at it
yay! starting to get it to work again. finalizing the e2
[editline]05:38PM[/editline]
btw unsmart thats not a javelin thats just a homing missile. but still much better then what i could do :)
Wait, what...
Has this taken you 3 weeks?
It's such a simple formula to get an parabolic arch to fly to your target [B]only[/B] with V2:distance(V2).
That together with a slight bit of trigometry you can make it even better.
Sorry, you need to Log In to post a reply to this thread.