Gamestudio Links
Zorro Links
Newest Posts
Zorro 2.70
by jcl. 09/29/25 09:24
optimize global parameters SOLVED
by dBc. 09/27/25 17:07
ZorroGPT
by TipmyPip. 09/27/25 10:05
assetHistory one candle shift
by jcl. 09/21/25 11:36
Plugins update
by Grant. 09/17/25 16:28
AUM Magazine
Latest Screens
Rocker`s Revenge
Stug 3 Stormartillery
Iljuschin 2
Galactic Strike X
Who's Online Now
4 registered members (TipmyPip, AndrewAMD, dBc, clonman), 18,643 guests, and 5 spiders.
Key: Admin, Global Mod, Mod
Newest Members
krishna, DrissB, James168, Ed_Love, xtns
19168 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
Tilting Bullets with Mouse Movement #351089
12/21/10 19:30
12/21/10 19:30
Joined: Jul 2010
Posts: 129
B
bk9iq Offline OP
Member
bk9iq  Offline OP
Member
B

Joined: Jul 2010
Posts: 129
Hello Everybody...
I am trying to make a very simple side viewed game...
I added all the movements and shooting codes, however the bullets right now go straight forward but I want them to tilt up and down with my mouse movement ... I tried to use
my.tilt=mouse_force.y;
but I doesn't do anything...
Is there anyway to solve this problem please?

Re: Tilting Bullets with Mouse Movement [Re: bk9iq] #351093
12/21/10 19:47
12/21/10 19:47
Joined: Jul 2010
Posts: 129
B
bk9iq Offline OP
Member
bk9iq  Offline OP
Member
B

Joined: Jul 2010
Posts: 129
Sorry I could solve the problem even though I guess It is not the best solution::

here's what I did:::

Quote:
var bullet_tilt;
function move_bullet()
{
VECTOR bullet_speed;
bullet_speed.x= 10*time_step;
bullet_speed.y= 0;
bullet_speed.z= 0;
my.pan=player.pan;
vec_rotate(bullet_speed.x,vector(0,bullet_tilt,0));
while(me)
{
bullet_tilt += mouse_force.y * 8 * time_step;
bullet_tilt = clamp(bullet_tilt,-15,45);
c_move(me,bullet_speed.x, nullvector,0);
wait(1);
}

}


is there any better way??
Thanks


Last edited by bk9iq; 12/21/10 19:48.
Re: Tilting Bullets with Mouse Movement [Re: bk9iq] #351096
12/21/10 20:14
12/21/10 20:14
Joined: May 2009
Posts: 5,377
Caucasus
3run Offline
Senior Expert
3run  Offline
Senior Expert

Joined: May 2009
Posts: 5,377
Caucasus
As you can see in your bullet script, each bullet's PAN equals to player PAN (my.pan = player.pan). But you didn't define TILT...
You can place model at the center of player, and then make a pointer (for example) bullet_pos.
Then you change bullet_pos.TILT with mouse_force.y and make it's PAN equal to player's PAN.
And after all that, in your bullet script, make bullet's PAN,TILT,ROLL equal to 'bullet_pos' PAN,TILT and ROLL (vec_set(my.pan,bullet_pos.pan);)
I hope point taken.

Edit: I've noticed that there are a lot of errors in your script, that's why it doesn't work...


Last edited by 3run; 12/21/10 20:43. Reason: *****

Looking for free stuff?? Take a look here: http://badcom.at.ua
Support me on: https://boosty.to/3rung
Re: Tilting Bullets with Mouse Movement [Re: 3run] #351101
12/21/10 20:42
12/21/10 20:42
Joined: Jul 2010
Posts: 129
B
bk9iq Offline OP
Member
bk9iq  Offline OP
Member
B

Joined: Jul 2010
Posts: 129
Thanks Bro..
My only problem is that it is not very accurate .... It only changes to 2 or 3 angles ... I don't know why.... When I make the arrow visible and look at the shot bullets they don't point to or go to the exact same level as of the mouse location ....
I don't know whether that's understandable or not...

Re: Tilting Bullets with Mouse Movement [Re: bk9iq] #351103
12/21/10 20:47
12/21/10 20:47
Joined: May 2009
Posts: 5,377
Caucasus
3run Offline
Senior Expert
3run  Offline
Senior Expert

Joined: May 2009
Posts: 5,377
Caucasus
Please PM me dude (explain more what you want to do, and tell me about your project), I'll make a demo for you.


Looking for free stuff?? Take a look here: http://badcom.at.ua
Support me on: https://boosty.to/3rung

Moderated by  HeelX, Lukas, rayp, Rei_Ayanami, Superku, Tobias, TWO, VeT 

Gamestudio download | 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