Gamestudio Links
Zorro Links
Newest Posts
Zorro Trader GPT
by TipmyPip. 12/04/23 11:34
Newbie Questions
by AndrewAMD. 12/04/23 11:14
Square root rule
by Smallz. 12/02/23 09:15
RTest not found error
by TipmyPip. 12/01/23 21:43
neural function for Python to [Train]
by TipmyPip. 12/01/23 14:47
Xor Memory Problem.
by TipmyPip. 11/28/23 14:23
Training with command line parameters
by TipmyPip. 11/26/23 08:42
Combine USD & BTC Pairs In Asset Loop
by TipmyPip. 11/26/23 08:30
AUM Magazine
Latest Screens
A psychological thriller game
SHADOW (2014)
DEAD TASTE
Tactics of World War I
Who's Online Now
2 registered members (TipmyPip, izorro), 556 guests, and 2 spiders.
Key: Admin, Global Mod, Mod
Newest Members
fairtrader, hus, Vurtis, Harry5, KelvinC
19019 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
Page 1 of 2 1 2
Realistic Missile Trail Code #98622
11/13/06 06:59
11/13/06 06:59
Joined: Aug 2005
Posts: 1,558
HK
V
vlau Offline OP
Serious User
vlau  Offline OP
Serious User
V

Joined: Aug 2005
Posts: 1,558
HK
Here is my realistic (I think so) missile code
that I've made sometimes ago.



Code:


bmap mslTrailBmp = <mslTrail02.tga>; // use your own bmap

action mslLaunch
{
while(my!=NULL)
{
c_move(my,vector(65*time_step,0,0),nullvector,glide);
vec_for_vertex(my.skill1,my,145); // play with 145

effect(mslTrail,30*time_step,my.skill1,nullvector);

// View Missile (option)
camera.x = my.x + 15;
camera.y = my.y + 15;
camera.z = my.z + 2;

vec_diff(temp,my.x,camera.x);
vec_to_angle(camera.pan,temp);
my.pan += (key_a - key_d) * 5 * time_step;
my.tilt += (key_w - key_s) * 5 * time_step;

wait(1);
}
}

function mslTrailPty()
{
my.skill_d = my.size/2; // velocity

my.vel_x = random(my.skill_d) - my.skill_d/2;
my.vel_y = random(my.skill_d) - my.skill_d/2;
my.vel_z = random(my.skill_d) - my.skill_d/2;

my.x -= (my.skill_x - you.skill1);
my.y -= (my.skill_y - you.skill2);
my.z -= (my.skill_z - you.skill3);
vec_set(my.skill_x,you.skill1);

vec_normalize(my.skill_a,min(my.skill_d,1)); // set speed
vec_add(my.x, my.skill_a);

my.size += 0.01 * time_step;
my.alpha -= 3 * time_step;

if (my.alpha <= 0 || my.size > 2)
{
my.lifespan = 0;
}
}


function mslTrail()
{
if (my.lifespan == 80)
{
my.move = on;
my.size = random(0.6)+0.6;
my.bmap = mslTrailBmp;
my.flare = on;
my.bright = on;
my.alpha = random(70) + 30;

my.lifespan = random(200) + 150;
}


vec_set(my.skill_x,you.skill1);
vec_set(my.skill_a,vector(-0.1,0,0));
vec_rotate(my.skill_a,you.pan);
vec_add(my.vel_x,my.skill_a);

my.function = mslTrailPty;
}



There are no gaps between particle trail when the missile
is flying.

Hope you find it useful.

Re: Realistic Missile Trail Code [Re: vlau] #98623
11/13/06 17:13
11/13/06 17:13
Joined: Jul 2006
Posts: 783
London, UK
sheefo Offline
User
sheefo  Offline
User

Joined: Jul 2006
Posts: 783
London, UK
Why hasn't anyone posted here yet? This is some great, useful code. I was actually searching for a missile particle track, and I found the perfect one.

Thank you vlau, for your contribution.

Re: Realistic Missile Trail Code [Re: sheefo] #98624
11/13/06 17:15
11/13/06 17:15
Joined: Jun 2006
Posts: 2,640
Earth
Germanunkol Offline
Expert
Germanunkol  Offline
Expert

Joined: Jun 2006
Posts: 2,640
Earth
I agree, looking great! I might use this in a game I'm working on right now... good job, and thx for contributing!!


~"I never let school interfere with my education"~
-Mark Twain
Re: Realistic Missile Trail Code [Re: Germanunkol] #98625
11/13/06 17:19
11/13/06 17:19
Joined: Feb 2005
Posts: 3,687
Hessen, Germany
T
Tempelbauer Offline
Expert
Tempelbauer  Offline
Expert
T

Joined: Feb 2005
Posts: 3,687
Hessen, Germany
cool, letz see if i can need it...
thanks for constribute it

Re: Realistic Missile Trail Code [Re: Tempelbauer] #98626
11/13/06 19:07
11/13/06 19:07
Joined: Mar 2006
Posts: 2,758
Antwerp,Belgium
frazzle Offline
Expert
frazzle  Offline
Expert

Joined: Mar 2006
Posts: 2,758
Antwerp,Belgium
Same here vlau ^^ Nice contribution

Cheers

Frazzle


Antec® Case
Intel® X58 Chipset
Intel® i7 975 Quad Core
8 GB RAM DDR3
SSD OCZ®-VERTEX2 3.5 x4 ; HD 600 GB
NVIDIA® GeForce GTX 295 Memory 1795GB
Re: Realistic Missile Trail Code [Re: frazzle] #98627
11/13/06 19:57
11/13/06 19:57
Joined: Oct 2005
Posts: 196
ambe Offline
Member
ambe  Offline
Member

Joined: Oct 2005
Posts: 196
well done:P


- code monkey
Re: Realistic Missile Trail Code [Re: ambe] #98628
11/14/06 01:06
11/14/06 01:06
Joined: May 2005
Posts: 819
U.S.
Why_Do_I_Die Offline
Warned
Why_Do_I_Die  Offline
Warned

Joined: May 2005
Posts: 819
U.S.
looks like a very nice effect , thnx for the script : )

Re: Realistic Missile Trail Code [Re: vlau] #98629
11/14/06 03:52
11/14/06 03:52
Joined: Aug 2002
Posts: 572
Toronto
MadMark Offline
User
MadMark  Offline
User

Joined: Aug 2002
Posts: 572
Toronto
Good contrib, Vlau.

Thanks!
Mark


People who live in glass houses shouldn't vacuum naked.
Re: Realistic Missile Trail Code [Re: MadMark] #98630
11/14/06 13:50
11/14/06 13:50
Joined: Aug 2003
Posts: 842
alabama
Drittz_Dourden Offline
User
Drittz_Dourden  Offline
User

Joined: Aug 2003
Posts: 842
alabama
very nice contributation, thanks

Daniel

Re: Realistic Missile Trail Code [Re: Drittz_Dourden] #98631
11/14/06 15:28
11/14/06 15:28
Joined: Mar 2006
Posts: 752
Portugal
demiGod Offline
User
demiGod  Offline
User

Joined: Mar 2006
Posts: 752
Portugal
Great contribution, thanks vlau.

Page 1 of 2 1 2

Moderated by  adoado, checkbutton, mk_1, Perro 

Gamestudio download | chip programmers | Zorro platform | shop | Data Protection Policy

oP group Germany GmbH | Birkenstr. 25-27 | 63549 Ronneburg / Germany | info (at) opgroup.de

Powered by UBB.threads™ PHP Forum Software 7.7.1