Gamestudio Links
Zorro Links
Newest Posts
AlpacaZorroPlugin v1.3.0 Released
by kzhao. 05/22/24 13:41
Free Live Data for Zorro with Paper Trading?
by AbrahamR. 05/18/24 13:28
Change chart colours
by 7th_zorro. 05/11/24 09:25
Data from CSV not parsed correctly
by dr_panther. 05/06/24 18:50
AUM Magazine
Latest Screens
The Bible Game
A psychological thriller game
SHADOW (2014)
DEAD TASTE
Who's Online Now
2 registered members (AndrewAMD, dr_panther), 730 guests, and 4 spiders.
Key: Admin, Global Mod, Mod
Newest Members
lorikob361, LucasJoshua, Baklazhan, Hanky27, firatv
19054 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,370
Caucasus
3run Offline
Senior Expert
3run  Offline
Senior Expert

Joined: May 2009
Posts: 5,370
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,370
Caucasus
3run Offline
Senior Expert
3run  Offline
Senior Expert

Joined: May 2009
Posts: 5,370
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 | 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