Harpoon E-1 Guided Missile
4 posters
RigidChips :: Rigid-Chips :: Files :: Works In Progress
Page 1 of 1
Harpoon E-1 Guided Missile
Here it is:
My first guided missile prototype.
At the moment it doesnt shoot/explode because its still not finished.
Im really happy about the stabilization and the guiding system this missile has. Although it doesnt hit anything at all because of the random error its pretty good so far.
The other aspect of this project was to make a foldable missile which made the whole project a lot more complex but its succesful after all!
Press A to start the missile, the missile does the rest (only short... and dont hold the key otherwise it will malfunction)
Oh and by the way: Dont start it when unbreakable is off....
HAVE FUN!!!
My first guided missile prototype.
At the moment it doesnt shoot/explode because its still not finished.
Im really happy about the stabilization and the guiding system this missile has. Although it doesnt hit anything at all because of the random error its pretty good so far.
The other aspect of this project was to make a foldable missile which made the whole project a lot more complex but its succesful after all!
Press A to start the missile, the missile does the rest (only short... and dont hold the key otherwise it will malfunction)
Oh and by the way: Dont start it when unbreakable is off....
- Code:
// [RCD]
Val
{
ARMED(default=0, max=1)
BDX(default=0, min=-10000)
BDY(default=0, min=-10000)
BDZ(default=0, min=-10000)
DX(default=0, min=-10000)
DY(default=0, min=-10000)
DZ(default=0, min=-10000)
ENG(default=0)
LAUNCH1(default=0, max=2)
LAUNCH2(default=0, max=1)
R(default=0, min=-25, max=25)
STAB(default=0, min=-10000)
U1(default=180, max=180)
U2(default=150, min=-30, max=150)
U3(default=0, max=90)
U4(default=180, min=29, max=180)
U5A(default=180, min=-180, max=180)
U5V(default=180, min=-180, max=180)
}
Key
{
}
Body
{
Core() {
S:Frame(angle=-50) {
S:Frame(angle=-100) {
S:Jet(angle=90, power=ENG, effect=2, color=#000000, name=MCore) {
N:Frame(angle=119, color=#000000) {
S:Arm(angle=209, color=#000000) { }
}
S:Frame(angle=119, color=#000000) {
S:Chip(angle=U2, color=#000000) {
S:Trim(angle=U3, color=#000000) {
S:Chip(angle=-U5V, color=#000000) { }
E:Trim(angle=-R, color=#000000) { }
W:Trim(angle=-R, color=#000000) { }
}
S:Chip(color=#000000, name=guide) {
N:Trim(angle=U3, color=#000000) {
N:Chip(angle=U1, color=#000000) {
N:Cowl(angle=U1, option=5, color=#000000) { }
}
N:Frame(angle=U4, color=#000000) {
N:Arm(angle=-209, color=#000000) { }
}
N:Frame(angle=-U4, color=#000000) {
N:Arm(angle=209, color=#000000) { }
}
}
S:Chip(angle=U1, color=#000000) { }
E:Trim(angle=-U5A, color=#000000) { }
W:Trim(angle=U5A, color=#000000) { }
}
N:Chip(angle=U1, option=5, color=#000000) {
N:Cowl(angle=U1, option=5, color=#000000) { }
}
}
N:Arm(angle=209, color=#000000) { }
}
}
}
}
S:Chip() {
S:Chip() {
S:Chip() {
S:Chip() {
S:Chip(angle=90) {
S:Weight() { }
}
}
}
}
}
E:Chip() {
E:Chip(angle=90) {
E:Weight() { }
}
}
W:Chip() {
W:Chip(angle=90) {
W:Weight() { }
}
}
N:Chip() {
N:Chip(angle=90) {
N:Weight() { }
}
}
}
}
Script
{
STAB = _AZ(guide)
if _key(7)>0 {Launch1=1}
if Launch1=1 {U1=U1-10}
if Launch1=1 {U2=U2-10}
if Launch1=1 {U3=U3+5}
if Launch1=1 {U4=U4-9}
if U2=-30 & Launch1=1 {Launch1=2}
if Launch1=2 {U5A=U5A-9}
if Launch1=2 {U5V=U5V-9}
if U5A=0 {Launch1=0}
if U5A=0 {Launch2=1}
if Launch2=1 {
ENG=600000
_BYE(MCore)
}
if ENG=600000 {ARMED=1}
if ARMED=1 {R=STAB*30}
if ARMED=1 {U5V=bdX/5}
if ARMED=1 {U5A=(bdy/5)}
dx = _PLAYERX(1)-_X(guide)
dy = _PLAYERY(1)-_Y(guide)
dz = _PLAYERZ(1)-_Z(guide)
bdx = dx*_XX(guide)+dy*_XY(guide)+dz*_XZ(guide)
bdy = dx*_YX(guide)+dy*_YY(guide)+dz*_YZ(guide)
bdz = dx*_ZX(guide)+dy*_ZY(guide)+dz*_ZZ(guide)
print 1,$_PLAYERNAME(0)," ID=",_PLAYERID(0)," Color=",_PLAYERCOLOR(0)," arm=",_PLAYERARMS(0)
print 2," crush=",_PLAYERCRUSHES(0)," init=",_PLAYERINITS(0)," reset=",_PLAYERRESETS(0)
print 3," x=",_PLAYERX(0)," y=",_PLAYERY(0)," z=",_PLAYERZ(0)
print 4,$_PLAYERNAME(1)," ID=",_PLAYERID(1)," Color=",_PLAYERCOLOR(1)," arm=",_PLAYERARMS(1)
print 5," crush=",_PLAYERCRUSHES(1)," init=",_PLAYERINITS(1)," reset=",_PLAYERRESETS(1)
print 6," x=",_PLAYERX(1)," y=",_PLAYERY(1)," z=",_PLAYERZ(1)
print 7,$_PLAYERNAME(2)," ID=",_PLAYERID(2)," Color=",_PLAYERCOLOR(2)," arm=",_PLAYERARMS(2)
print 8," crush=",_PLAYERCRUSHES(2)," init=",_PLAYERINITS(2)," reset=",_PLAYERRESETS(2)
print 9," x=",_PLAYERX(2)," y=",_PLAYERY(2)," z=",_PLAYERZ(2)
}
HAVE FUN!!!
Last edited by Warbird on Thu Dec 02, 2010 11:38 am; edited 1 time in total (Reason for editing : forgot to mention how to launch the missile... <.<)
Warbird- Tank
- Posts : 60
Join date : 2010-10-27
Age : 29
Location : Germany
Re: Harpoon E-1 Guided Missile
use _SPLIT(chip) instead of _BYE(chip).
that will allow for unlimited fuel.
Edit : try to use thrust vectoring for the missile - it looks like fins just cant get it to turn enough.
that will allow for unlimited fuel.
Edit : try to use thrust vectoring for the missile - it looks like fins just cant get it to turn enough.
RA2lover- Walker
- Posts : 382
Join date : 2010-10-11
Age : 29
Location : Brazil
Re: Harpoon E-1 Guided Missile
hey thats great!
Now i can rebuild the alpha E-1 which also had 5 engines but of course didnt work with _BYE.
And yes: It does have quite some steering problems, especially with pitch manouvers and the gliding phase as it was originally designed to be a simple balisitic rocket and not a fast and maneuverable missile but it packs some serious punch with the 4 arms (i´ve been thinking about a power of about 4*10.000.000 so it kicks some serious ass)
Now i can rebuild the alpha E-1 which also had 5 engines but of course didnt work with _BYE.
And yes: It does have quite some steering problems, especially with pitch manouvers and the gliding phase as it was originally designed to be a simple balisitic rocket and not a fast and maneuverable missile but it packs some serious punch with the 4 arms (i´ve been thinking about a power of about 4*10.000.000 so it kicks some serious ass)
Warbird- Tank
- Posts : 60
Join date : 2010-10-27
Age : 29
Location : Germany
Re: Harpoon E-1 Guided Missile
i would suggest 3.2/6.4/12.8 million instead.
why?
because weights are the most resistent kind of chip. it's strength varies with its option setting, while the weight of that chip increases with it too.
option 8 weights are the strongest, and need a whooping 12.8 million damage to get destroyed.
for the gliding/thrust vectoring, you would want to learn PID control, as proportional control only wouldn't work very well with jets.
why?
because weights are the most resistent kind of chip. it's strength varies with its option setting, while the weight of that chip increases with it too.
option 8 weights are the strongest, and need a whooping 12.8 million damage to get destroyed.
for the gliding/thrust vectoring, you would want to learn PID control, as proportional control only wouldn't work very well with jets.
RA2lover- Walker
- Posts : 382
Join date : 2010-10-11
Age : 29
Location : Brazil
Re: Harpoon E-1 Guided Missile
If the missile is designed well, a PD controller works just fine.
JHaskly- Admin
- Posts : 235
Join date : 2010-07-16
Age : 28
Location : Brisbane
Re: Harpoon E-1 Guided Missile
Try using _KEYDOWN() instead of _KEY() so that holding down the key wouldn't cause any errors.
As for the controller type, I agree that using PID controller is essential for an accurate missile, as it eliminates "steady-state error". However, the noise in online player tracking is going to ruin it, so I have to say PD controller is good enough in this case.
As for the controller type, I agree that using PID controller is essential for an accurate missile, as it eliminates "steady-state error". However, the noise in online player tracking is going to ruin it, so I have to say PD controller is good enough in this case.
Re: Harpoon E-1 Guided Missile
Finn Peacock, an australian engineer wrote:These 3 modes(Proportional,integral and derivative) are used in different combinations:
P – Sometimes used
PI - Most often used
PID – Sometimes used
PD – rare as hen’s teeth but can be useful for controlling servomotors.
...
RA2lover- Walker
- Posts : 382
Join date : 2010-10-11
Age : 29
Location : Brazil
Re: Harpoon E-1 Guided Missile
You are just pulling quotes from a commercial website which says something completely unrelated to the topic.
Re: Harpoon E-1 Guided Missile
actually, the derivative control would be what ruins the accuracy - it just looks where the target will be on the future, but that would be useless with online noise.
so the best bet would be a PID controller with a negative D value.
so the best bet would be a PID controller with a negative D value.
RA2lover- Walker
- Posts : 382
Join date : 2010-10-11
Age : 29
Location : Brazil
Re: Harpoon E-1 Guided Missile
It all depends on what you are controlling with the PID. Bwansy and I are talking about a controller that controls the missile's state, rather that its state in relation to the missile.
JHaskly- Admin
- Posts : 235
Join date : 2010-07-16
Age : 28
Location : Brisbane
Re: Harpoon E-1 Guided Missile
Oh yes, I was talking about SAS. As for CAS, personally I use a linear prediction rather than simple player tracking.
Re: Harpoon E-1 Guided Missile
Well im currently working on the jet-steered Harpoon E-2
Its getting better but i had an idea about the random error
some kind of what capacitors do with alternating current: It collects the past 10 or 20 coordinates of the Player, adds them and divides them through their number so you get the average coordinate (each for x y and z seperatly)
.. but how to do that?
Its getting better but i had an idea about the random error
some kind of what capacitors do with alternating current: It collects the past 10 or 20 coordinates of the Player, adds them and divides them through their number so you get the average coordinate (each for x y and z seperatly)
.. but how to do that?
Warbird- Tank
- Posts : 60
Join date : 2010-10-27
Age : 29
Location : Germany
Re: Harpoon E-1 Guided Missile
You can do that by taking the position of the player multiple times within one single frame. To do this, you have to learn how to use tables in Lua. Also, here's another tip: taking the mid-point between the min and the max among those values is more accurate then taking the average.
Good luck!
Good luck!
Re: Harpoon E-1 Guided Missile
sounds good
but sry but im not Lua - Compatible
but sry but im not Lua - Compatible
Warbird- Tank
- Posts : 60
Join date : 2010-10-27
Age : 29
Location : Germany
Re: Harpoon E-1 Guided Missile
If you're going to do it in script, I'm afraid that you'll have to manually repeat the process a hundred times, literally.
EDIT: I have found out that you can use "LABEL" and "GOTO" commands in script, which allows you to make loops.
EDIT: I have found out that you can use "LABEL" and "GOTO" commands in script, which allows you to make loops.
- Code:
GOTO xxxx //jump to label with name xxxx
LABEL xxxx //set-up a label
Re: Harpoon E-1 Guided Missile
just plain text, without quotes.
RCD has a sample model, rollings, which uses those functions.
RCD has a sample model, rollings, which uses those functions.
RA2lover- Walker
- Posts : 382
Join date : 2010-10-11
Age : 29
Location : Brazil
Re: Harpoon E-1 Guided Missile
It's a possibility, but... given the speed of RCScript, it may not be as fast as Lua.
JHaskly- Admin
- Posts : 235
Join date : 2010-07-16
Age : 28
Location : Brisbane
Re: Harpoon E-1 Guided Missile
Okay... as i fixed the wobbly steering of the missile lately, i am trying to finish this thing now. It works fine besides the noise problem which i still wasnt able to fix because i dont know enough about scripting to make that buffer to kill the noise. My knowledge about scripting is simply to small to make something which "records" the coordinates every frame and to get the average out of these. Any suggestions?
Warbird- Tank
- Posts : 60
Join date : 2010-10-27
Age : 29
Location : Germany
RigidChips :: Rigid-Chips :: Files :: Works In Progress
Page 1 of 1
Permissions in this forum:
You cannot reply to topics in this forum