Raised This Month: $ Target: $400
 0% 

[?]Velocity/Direction Help Con't!!!


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
heliumdream
Senior Member
Join Date: Aug 2006
Old 11-19-2006 , 01:02   [?]Velocity/Direction Help Con't!!!
Reply With Quote #1

Alright! My hero is getting there. I've got some neat things going on, with even more possibilities spouting in my mind. However I've still got a few things I need some clarification with.

Here are my results thus far...

What is going on in the picture? - on keydown you fire 12 successions of 4 missiles. One of each pointing 'forward', 'backward', 'left', and 'right'. I did this by...Adding an additional variable passed to make_rocket. It now looks like this - make_rocket(id,icmd,iarg1,antimissile,directi ontype). Then I added this code.
Code:
    if (directiontype == 1) 
    {
        fl_iNewVelocity[0] = fl_iNewVelocity[0]/24
        fl_iNewVelocity[1] = fl_iNewVelocity[1]/24
        fl_iNewVelocity[2] = 800.0
    }
    else if (directiontype == 2) 
    {
        fl_iNewVelocity[0] = fl_iNewVelocity[0]/-24
        fl_iNewVelocity[1] = fl_iNewVelocity[1]/24
        fl_iNewVelocity[2] = 800.0
    }
    else if (directiontype == 3) 
    {
        fl_iNewVelocity[0] = fl_iNewVelocity[0]/-24
        fl_iNewVelocity[1] = fl_iNewVelocity[1]/-24
        fl_iNewVelocity[2] = 800.0
    }
    else if (directiontype == 4) 
    {
        fl_iNewVelocity[0] = fl_iNewVelocity[0]/24
        fl_iNewVelocity[1] = fl_iNewVelocity[1]/-24
        fl_iNewVelocity[2] = 800.0
    }
    else
    {
        fl_iNewVelocity[0] = fl_iNewVelocity[0]/24
        fl_iNewVelocity[1] = fl_iNewVelocity[1]/24
        fl_iNewVelocity[2] = 800.0
    }
This is moderately what I was going for. When you spin while doing this, it makes almost a perfect double helix. Which is neat. However - when you stand still and fire, ideally it should make a perfect box. But depending on which direction you stand when you shoot, sometimes the missiles draw extremely close to each other. It's like the value is too close to 1 or 0 - so when its bouncing the direction vector on x or y between between positive and negative, the change therefore is negligable, the missiles only draw far enough apart not to collide with one another.

Also! - I want to add at least another 4 cases, to account for 'forward-right', 'forward-left', 'back-right', and 'back-left'. How can I do this? I cannot for the life of me figure out how they come up with the number that explains the vector. I used some client output to debug what a vector number looks like and I can't make sense of it. Here are some vecs =/
Code:
[SH](Armageddon): fl_iNewVelocity[0]=1084819239, fl_iNewVelocity[1]=-1044238900
[SH](Armageddon): fl_iNewVelocity[0]=1097728794, fl_iNewVelocity[1]=-1046534568
[SH](Armageddon): fl_iNewVelocity[0]=1103425955, fl_iNewVelocity[1]=-1068217565
[SH](Armageddon): fl_iNewVelocity[0]=1102984338, fl_iNewVelocity[1]=1088830518
[SH](Armageddon): fl_iNewVelocity[0]=1096640857, fl_iNewVelocity[1]=1101334531
[SH](Armageddon): fl_iNewVelocity[0]=1085292137, fl_iNewVelocity[1]=1103218444
[SH](Armageddon): fl_iNewVelocity[0]=-1050281669, fl_iNewVelocity[1]=1101140955
[SH](Armageddon): fl_iNewVelocity[0]=-1045846265, fl_iNewVelocity[1]=1095694415
[SH](Armageddon): fl_iNewVelocity[0]=-1043963392, fl_iNewVelocity[1]=1069164112
[SH](Armageddon): fl_iNewVelocity[0]=-1044312471, fl_iNewVelocity[1]=-1061389409
[SH](Armageddon): fl_iNewVelocity[0]=-1054178281, fl_iNewVelocity[1]=-1045200546
[SH](Armageddon): fl_iNewVelocity[0]=-1074592246, fl_iNewVelocity[1]=-1043979152
I guess I'm wondering what I can do to control the direction more precisely by changing the velocity - only I have no clue what to do to the velocity to make this happen.

This is also neat, when you fire a laser missile its starting vector is straight up, instead of forward. How could I give it a jolt backward and up?

Thanks in advance,
-helium

Last edited by heliumdream; 11-28-2006 at 14:42.
heliumdream is offline
heliumdream
Senior Member
Join Date: Aug 2006
Old 11-19-2006 , 15:18   Re: [?]Velocity/Direction Help Con't
Reply With Quote #2


This is the ORIGINAL pattern i was trying to replicate. I did this one without the use to multiple firings, this was done with the normal bazooka hero - looking straight up while spining and firing a single common missile every 1/4 beat or so.

I would like to be able to push a key, and fire that same pattern, only without having the need for spinning the character model to change the direction vector...I can't seem to be able to make vectors for the missiles fire properly in all those directions... I really wanted 'eight' primary directions, as described above in my prementioned post.

Once I can do this, I want to remove the staggering of the missiles, so instead of firing off each missile .3 seconds apart, it would fire all the missiles at the same time - resulting in a perfect ring. That's the idea - I really dont know what what my question is, I guess, I just know I need help with controling direction thru velocity.
Thanks again :-D,
-helium
heliumdream is offline
tinlab
Member
Join Date: Oct 2006
Location: malaysia
Old 11-19-2006 , 19:41   Re: [?]Velocity/Direction Help Con't
Reply With Quote #3

the hero looks pretty damn cool, sorry i cant helpu out tho
tinlab is offline
Send a message via AIM to tinlab Send a message via MSN to tinlab
heliumdream
Senior Member
Join Date: Aug 2006
Old 11-28-2006 , 14:43   Re: [?]Velocity/Direction Help Con't!!!
Reply With Quote #4

*bump*
I hope everyone had a great turkey day!
-helium
heliumdream is offline
Zenith77
Veteran Member
Join Date: Aug 2005
Old 11-29-2006 , 16:39   Re: [?]Velocity/Direction Help Con't
Reply With Quote #5

Quote:
Originally Posted by tinlab View Post
the hero looks pretty damn cool, sorry i cant helpu out tho
Then don't reply.
__________________
Quote:
Originally Posted by phorelyph View Post
your retatred
Zenith77 is offline
heliumdream
Senior Member
Join Date: Aug 2006
Old 11-29-2006 , 17:09   Re: [?]Velocity/Direction Help Con't!!!
Reply With Quote #6

I need answers peoples - not useless comments and flames =D
heliumdream is offline
Zenith77
Veteran Member
Join Date: Aug 2005
Old 11-29-2006 , 23:18   Re: [?]Velocity/Direction Help Con't!!!
Reply With Quote #7

Quote:
Originally Posted by heliumdream View Post
I need answers peoples - not useless comments and flames =D
I'm just going to be honest, this is a pretty advanced subject, especially for the people in this forum, since they're all mostly beginers and/or can't do all this calculation stuff (I wish I could...). So, you probably won't get a valid answer for a while.
__________________
Quote:
Originally Posted by phorelyph View Post
your retatred
Zenith77 is offline
Emp`
AMX Mod X Plugin Approver
Join Date: Aug 2005
Location: Decapod 10
Old 11-30-2006 , 01:32   Re: [?]Velocity/Direction Help Con't!!!
Reply With Quote #8

you can just use math to figure out how far out each thing is from the original origin. doesn't seem to be too hard.
Emp` is offline
Send a message via AIM to Emp` Send a message via MSN to Emp` Send a message via Yahoo to Emp` Send a message via Skype™ to Emp`
heliumdream
Senior Member
Join Date: Aug 2006
Old 12-01-2006 , 13:19   Re: [?]Velocity/Direction Help Con't!!!
Reply With Quote #9

Emp please elaborate...what sort of calculations am I looking for to define the movement? I am a serious mathematician and my pops has his masters in math...I still don't know what that 12 digit vector is telling me.

As for zenith - this is the script helping forum. Meaning everyone here is asking help, obv. Then, smart sharks like Emp come and help us noobs out...That just the way a 'help' forum works.

And again, useless comments not appreciated

Thanks in advance Emp, heh,
-helium
heliumdream is offline
Zenith77
Veteran Member
Join Date: Aug 2005
Old 12-01-2006 , 13:31   Re: [?]Velocity/Direction Help Con't!!!
Reply With Quote #10

Oh wow, I never knew that. I'm so happy now, I finally realize the point of this forum!
__________________
Quote:
Originally Posted by phorelyph View Post
your retatred
Zenith77 is offline
Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 21:44.


Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Theme made by Freecode