Phun Guided Rocket
12 posts • Page 1 of 1
Phun Guided Rocket
I need some help to make a guided rocket for my Gravity rocket.
can someone give me a script to launch my rocket from one side of the scene to the other? My Gravity rocket's script is
an on collide script to make it a black hole.
this makes it into a black hole and i need the guided missile to complete the scene.
can someone give me a script to launch my rocket from one side of the scene to the other? My Gravity rocket's script is
an on collide script to make it a black hole.
- Code: Select all
{e.this.density:= +inf ; e.this.attraction:= 10000; e.this.killer:= true}
this makes it into a black hole and i need the guided missile to complete the scene.
Last edited by Blackonyx2234 on Sun Jan 16, 2011 6:34 pm, edited 1 time in total.
-

Blackonyx2234 - Posts: 24
- Joined: Sun Jan 31, 2010 5:12 am
Re: Phun Guided Rocket
I actually need the guided rocket script soon, because i am not going to work on this for long.
live to learn
learn to survive
survive to eventually die successful
learn to survive
survive to eventually die successful
-

Blackonyx2234 - Posts: 24
- Joined: Sun Jan 31, 2010 5:12 am
-

davidz40 - Posts: 438
- Joined: Sun Sep 06, 2009 10:30 am
Re: Phun Guided Rocket
davidz40 wrote:
Here You have simple phun compatible guidance.
I just wish it was more tutorial-like, it is awesome though...
live to learn
learn to survive
survive to eventually die successful
learn to survive
survive to eventually die successful
-

Blackonyx2234 - Posts: 24
- Joined: Sun Jan 31, 2010 5:12 am
Re: Phun Guided Rocket
All the secret is one scripted box. It measures velocity, and then increases attraction if missile is too slow, and decreases when too fast. Attraction keeps pulling missile to target. Missile needs to be very light, so it's attraction won't affect target motion.
Phundamentalist
-

davidz40 - Posts: 438
- Joined: Sun Sep 06, 2009 10:30 am
Re: Phun Guided Rocket
davidz40 wrote:All the secret is one scripted box. It measures velocity, and then increases attraction if missile is too slow, and decreases when too fast. Attraction keeps pulling missile to target. Missile needs to be very light, so it's attraction won't affect target motion.
sorry for the long time span,
so the secret is in a scripted box... how would i script it to increase attraction and decrease attraction by measuring velocity?
what would the script be?
(I am fairly new to advanced scripting and basic scripting and well every type of scripting except collide set scripts...)
live to learn
learn to survive
survive to eventually die successful
learn to survive
survive to eventually die successful
-

Blackonyx2234 - Posts: 24
- Joined: Sun Jan 31, 2010 5:12 am
Re: Phun Guided Rocket
Basically, it uses texture matrix variables to store position, and then uses actual pos, and previously stored values to calculate velocity.
Here updated, simplier code that I'm going to use in my next missiles, feel free to use it.
Just put it on some alternating collider.
Here updated, simplier code that I'm going to use in my next missiles, feel free to use it.
Just put it on some alternating collider.
- Code: Select all
(e)=>{texturematrix = [texturematrix(2) - e.pos(0), texturematrix(3) - e.pos(1), e.pos(0), e.pos(1), texturematrix(0) ^ 2 + texturematrix(1) ^ 2, 0, 0, 0, 0]; texturematrix(4) < 15 ? {attraction = attraction + 20} : {attraction = attraction * 0.98}}
Phundamentalist
-

davidz40 - Posts: 438
- Joined: Sun Sep 06, 2009 10:30 am
Re: Phun Guided Rocket
davidz40 wrote:Basically, it uses texture matrix variables to store position, and then uses actual pos, and previously stored values to calculate velocity.
Here updated, simplier code that I'm going to use in my next missiles, feel free to use it.
Just put it on some alternating collider.
- Code: Select all
(e)=>{texturematrix = [texturematrix(2) - e.pos(0), texturematrix(3) - e.pos(1), e.pos(0), e.pos(1), texturematrix(0) ^ 2 + texturematrix(1) ^ 2, 0, 0, 0, 0]; texturematrix(4) < 15 ? {attraction = attraction + 20} : {attraction = attraction * 0.98}}
thanks this will come in handy
live to learn
learn to survive
survive to eventually die successful
learn to survive
survive to eventually die successful
-

Blackonyx2234 - Posts: 24
- Joined: Sun Jan 31, 2010 5:12 am
Re: Phun Guided Rocket
Blackonyx2234 wrote:davidz40 wrote:Basically, it uses texture matrix variables to store position, and then uses actual pos, and previously stored values to calculate velocity.
Here updated, simplier code that I'm going to use in my next missiles, feel free to use it.
Just put it on some alternating collider.
- Code: Select all
(e)=>{texturematrix = [texturematrix(2) - e.pos(0), texturematrix(3) - e.pos(1), e.pos(0), e.pos(1), texturematrix(0) ^ 2 + texturematrix(1) ^ 2, 0, 0, 0, 0]; texturematrix(4) < 15 ? {attraction = attraction + 20} : {attraction = attraction * 0.98}}
thanks this will come in handy
crap it didn't work i must be doing something wrong...
live to learn
learn to survive
survive to eventually die successful
learn to survive
survive to eventually die successful
-

Blackonyx2234 - Posts: 24
- Joined: Sun Jan 31, 2010 5:12 am
Re: Phun Guided Rocket
The code is ok, I copied it from working missile. Just remember to keep missile very light, put the script box on the front, and put some stabilisation fins on the rear.
Phundamentalist
-

davidz40 - Posts: 438
- Joined: Sun Sep 06, 2009 10:30 am
Re: Phun Guided Rocket
davidz40 wrote:The code is ok, I copied it from working missile. Just remember to keep missile very light, put the script box on the front, and put some stabilisation fins on the rear.
K ill see if it works, and also
can you explain the texture matrix a little more? i like to understand what i am coding in...(once again new to scripting and I have had several brain blocks whenever i try to script advanced topics. i am better at scripts when i know what i am doing) ex. scene.my.laserfade=10
scene.my.speedoflight=2
live to learn
learn to survive
survive to eventually die successful
learn to survive
survive to eventually die successful
-

Blackonyx2234 - Posts: 24
- Joined: Sun Jan 31, 2010 5:12 am
Re: Phun Guided Rocket
Texture matrix is set of numbers that control position,scale and rotation of texture. Full explanation what number does what is on this forum somewhere. If no textures are used, these numbers can be used for storage. I use them to save position, and difference between saved pos and current pos to calculate speed.
Phundamentalist
-

davidz40 - Posts: 438
- Joined: Sun Sep 06, 2009 10:30 am
12 posts • Page 1 of 1
Who is online
Users browsing this forum: No registered users and 6 guests




